From 0855bb5f7fb62b7bf434aceb9a8059c91402e5dd Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Wed, 27 Mar 2019 15:26:07 -0700 Subject: [PATCH] Implement ReadOnly method API in CodeGenerationConstructedMethodSymbol --- .../Symbols/CodeGenerationAbstractMethodSymbol.cs | 6 ++---- .../Symbols/CodeGenerationConstructedMethodSymbol.cs | 4 ++++ .../CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs index b06147cfe6d85..5aa2fc03e47ce 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs @@ -40,6 +40,8 @@ protected CodeGenerationAbstractMethodSymbol( public abstract ImmutableArray TypeParameters { get; } public abstract ImmutableArray Parameters { get; } public abstract IMethodSymbol ConstructedFrom { get; } + public abstract bool IsDeclaredReadOnly { get; } + public abstract bool IsEffectivelyReadOnly { get; } public abstract IMethodSymbol OverriddenMethod { get; } public abstract IMethodSymbol ReducedFrom { get; } public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter); @@ -70,10 +72,6 @@ public override TResult Accept(SymbolVisitor visitor) public override SymbolKind Kind => SymbolKind.Method; - public virtual bool IsDeclaredReadOnly => throw new NotImplementedException(); - - public virtual bool IsEffectivelyReadOnly => throw new NotImplementedException(); - public virtual bool IsGenericMethod { get diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs index 28e10e143a3d9..b0e262ff9f88c 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs @@ -70,6 +70,10 @@ public override ImmutableArray Parameters public override IMethodSymbol ConstructedFrom => _constructedFrom; + public override bool IsDeclaredReadOnly => _constructedFrom.IsDeclaredReadOnly; + + public override bool IsEffectivelyReadOnly => _constructedFrom.IsEffectivelyReadOnly; + public override IMethodSymbol OverriddenMethod => // TODO(cyrusn): Construct this. _constructedFrom.OverriddenMethod; diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs index 06fc76867d504..a6b1346f5f0df 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs @@ -85,6 +85,10 @@ public override ImmutableArray TypeArguments public override IMethodSymbol ConstructedFrom => this; + public override bool IsDeclaredReadOnly => throw new NotImplementedException(); + + public override bool IsEffectivelyReadOnly => throw new NotImplementedException(); + public override IMethodSymbol OverriddenMethod => null; public override IMethodSymbol ReducedFrom => null;