public MetadataNamedInterface(
     InterfaceAttribute attribute,
     SourceSymbolContext sourceSymbolContext,
     DiagnosticBag diagnostics) : base(diagnostics)
 {
     _anonymousSourceInterface = new SourceAnonymousInterface(
         Utils.Parse(
             attribute.AnonymousInterfaceDeclaration,
             p => p.anonymous_interface_declaration_metadata().anonymous_interface_declaration(),
             _diagnostics),
         sourceSymbolContext.WithTypeParameters(() => TypeParameters),
         true,
         _diagnostics);
     _attribute           = attribute;
     _sourceSymbolContext = sourceSymbolContext;
     FullyQualifiedName   = QualifiedName.Parse(attribute.FullyQualifiedName);
     _typeParameters      = new Lazy <ImmutableArray <ITypeParameter> >(GenerateTypeParameters);
 }
Example #2
0
 public MetadataMethod(
     IAssembly metadataAssembly,
     DiagnosticBag diagnostics,
     MethodSignatureAttribute attribute) : base(diagnostics)
 {
     DeclaringAssembly = metadataAssembly;
     _attribute        = attribute;
     _methodSignature  = Utils.Parse(
         attribute.Signature,
         p => p.method_signature_metadata(),
         _diagnostics);
     _sourceSymbolContext = new SourceSymbolContext(null, DeclaringAssembly, ImmutableArray <QualifiedName> .Empty, null, () => ImmutableArray <ITypeParameter> .Empty);
     _sourceSymbolContextWithTypeParams = _sourceSymbolContext.WithTypeParameters(() => TypeParameters);
     FullyQualifiedName  = _methodSignature.qualified_name().GetQualifiedName();
     _typeParameters     = new Lazy <ImmutableArray <ITypeParameter> >(GenerateTypeParameters);
     _returnType         = new Lazy <IType>(GenerateReturnType);
     _parameters         = new Lazy <ImmutableArray <IParameter> >(GenerateParameters);
     _requiredMethodKeys = new Lazy <ImmutableArray <MethodOrInterfaceMethod> >(GenerateRequiredMethodKeys);
 }