Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added IsSealed and IsAbstract attribute (for typedef) and update CCIP… #28

Open
wants to merge 1 commit into
base: metadata-provider
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CCIProvider/TypeExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public TypeDefinition ExtractEnum(Cci.INamedTypeDefinition typedef)
type.UnderlayingType = ExtractType(typedef.UnderlyingType) as IBasicType;
ExtractAttributes(type.Attributes, typedef.Attributes);
ExtractConstants(type, type.Fields, typedef.Fields);
type.IsSealed = typedef.IsSealed;
type.IsAbstract = typedef.IsAbstract;

return type;
}
Expand All @@ -79,6 +81,8 @@ public TypeDefinition ExtractInterface(Cci.INamedTypeDefinition typedef, Cci.ISo
ExtractGenericTypeParameters(type, typedef);
ExtractInterfaces(type.Interfaces, typedef.Interfaces);
ExtractMethods(type, type.Methods, typedef.Methods, sourceLocationProvider);
type.IsSealed = typedef.IsSealed;
type.IsAbstract = typedef.IsAbstract;

defGenericContext.TypeParameters.Clear();
return type;
Expand Down Expand Up @@ -107,6 +111,8 @@ public TypeDefinition ExtractClass(Cci.INamedTypeDefinition typedef, Cci.ISource
ExtractInterfaces(type.Interfaces, typedef.Interfaces);
ExtractFields(type, type.Fields, typedef.Fields);
ExtractMethods(type, type.Methods, typedef.Methods, sourceLocationProvider);
type.IsSealed = typedef.IsSealed;
type.IsAbstract = typedef.IsAbstract;

defGenericContext.TypeParameters.Clear();
return type;
Expand All @@ -122,6 +128,8 @@ public TypeDefinition ExtractStruct(Cci.INamedTypeDefinition typedef, Cci.ISourc
ExtractInterfaces(type.Interfaces, typedef.Interfaces);
ExtractFields(type, type.Fields, typedef.Fields);
ExtractMethods(type, type.Methods, typedef.Methods, sourceLocationProvider);
type.IsSealed = typedef.IsSealed;
type.IsAbstract = typedef.IsAbstract;

defGenericContext.TypeParameters.Clear();
return type;
Expand Down
3 changes: 2 additions & 1 deletion Model/Types/TypeDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ public class TypeDefinition : IBasicType, IGenericDefinition, ITypeMemberDefinit
public IList<MethodDefinition> Methods { get; private set; }
public IList<TypeDefinition> Types { get; private set; }
public IBasicType UnderlayingType { get; set; }

public bool IsSealed { get; set; }
public bool IsAbstract { get; set; }
public TypeDefinition(string name, TypeKind typeKind = TypeKind.Unknown, TypeDefinitionKind kind = TypeDefinitionKind.Unknown)
{
this.Name = name;
Expand Down