提交 13b3faea 编写于 作者: J John Hamby

Add instrumentForDynamicAnalysis parameter to...

Add instrumentForDynamicAnalysis parameter to MethodSymbol.CalculateLocalSyntaxOffset, so that an error test can be retained when not instrumenting.
上级 1f45d8f0
......@@ -147,7 +147,7 @@ private LocalDefinition LazyReturnTemp
var bodySyntax = _methodBodySyntaxOpt;
if (_ilEmitStyle == ILEmitStyle.Debug && bodySyntax != null)
{
int syntaxOffset = _method.CalculateLocalSyntaxOffset(bodySyntax.SpanStart, bodySyntax.SyntaxTree);
int syntaxOffset = _method.CalculateLocalSyntaxOffset(bodySyntax.SpanStart, bodySyntax.SyntaxTree, instrumentForDynamicAnalysis: false);
var localSymbol = new SynthesizedLocal(_method, _method.ReturnType, SynthesizedLocalKind.FunctionReturnValue, bodySyntax);
result = _builder.LocalSlotManager.DeclareLocal(
......
......@@ -1489,7 +1489,7 @@ private string GetLocalDebugName(ILocalSymbolInternal local, out LocalDebugId lo
if (_ilEmitStyle == ILEmitStyle.Debug)
{
var syntax = local.GetDeclaratorSyntax();
int syntaxOffset = _method.CalculateLocalSyntaxOffset(syntax.SpanStart, syntax.SyntaxTree);
int syntaxOffset = _method.CalculateLocalSyntaxOffset(syntax.SpanStart, syntax.SyntaxTree, instrumentForDynamicAnalysis: false);
int ordinal = _synthesizedLocalOrdinals.AssignLocalOrdinal(localKind, syntaxOffset);
......
......@@ -242,9 +242,9 @@ bool ISynthesizedMethodBodyImplementationSymbol.HasMethodBodyDependency
get { return true; }
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
return _stateMachineType.KickoffMethod.CalculateLocalSyntaxOffset(localPosition, localTree);
return _stateMachineType.KickoffMethod.CalculateLocalSyntaxOffset(localPosition, localTree, instrumentForDynamicAnalysis);
}
}
}
......@@ -74,15 +74,6 @@ private static void AssertIsClosureScopeSyntax(CSharpSyntaxNode syntaxOpt)
return;
}
switch (syntaxOpt.Kind())
{
case SyntaxKind.ClassDeclaration:
case SyntaxKind.StructDeclaration:
// With instrumentation, type declarations can be the syntax associated with a synthesized constructor.
// This is not truly a closure scope syntax, but must be allowed to pass here.
return;
}
throw ExceptionUtilities.UnexpectedValue(syntaxOpt.Kind());
}
......
......@@ -1121,12 +1121,14 @@ private DebugId GetClosureId(SyntaxNode syntax, ArrayBuilder<ClosureDebugInfo> c
closureId = new DebugId(closureDebugInfo.Count, CompilationState.ModuleBuilderOpt.CurrentGenerationOrdinal);
}
int syntaxOffset = _topLevelMethod.CalculateLocalSyntaxOffset(syntax.SpanStart, syntax.SyntaxTree);
int syntaxOffset = _topLevelMethod.CalculateLocalSyntaxOffset(syntax.SpanStart, syntax.SyntaxTree, InstrumentForDynamicAnalysis);
closureDebugInfo.Add(new ClosureDebugInfo(syntaxOffset, closureId));
return closureId;
}
private bool InstrumentForDynamicAnalysis => CompilationState.ModuleBuilderOpt != null ? CompilationState.ModuleBuilderOpt.EmitOptions.EmitDynamicAnalysisData : false;
private DebugId GetLambdaId(SyntaxNode syntax, ClosureKind closureKind, int closureOrdinal)
{
Debug.Assert(syntax != null);
......@@ -1175,7 +1177,7 @@ private DebugId GetLambdaId(SyntaxNode syntax, ClosureKind closureKind, int clos
lambdaId = new DebugId(_lambdaDebugInfoBuilder.Count, CompilationState.ModuleBuilderOpt.CurrentGenerationOrdinal);
}
int syntaxOffset = _topLevelMethod.CalculateLocalSyntaxOffset(lambdaOrLambdaBodySyntax.SpanStart, lambdaOrLambdaBodySyntax.SyntaxTree);
int syntaxOffset = _topLevelMethod.CalculateLocalSyntaxOffset(lambdaOrLambdaBodySyntax.SpanStart, lambdaOrLambdaBodySyntax.SyntaxTree, InstrumentForDynamicAnalysis);
_lambdaDebugInfoBuilder.Add(new LambdaDebugInfo(syntaxOffset, lambdaId, closureOrdinal));
return lambdaId;
}
......
......@@ -130,11 +130,11 @@ private static string MakeName(string topLevelMethodName, DebugId topLevelMethod
internal override bool IsExpressionBodied => false;
internal MethodSymbol TopLevelMethod => _topLevelMethod;
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
// Syntax offset of a syntax node contained in a lambda body is calculated by the containing top-level method.
// The offset is thus relative to the top-level method body start.
return _topLevelMethod.CalculateLocalSyntaxOffset(localPosition, localTree);
return _topLevelMethod.CalculateLocalSyntaxOffset(localPosition, localTree, instrumentForDynamicAnalysis);
}
IMethodSymbol ISynthesizedMethodBodyImplementationSymbol.Method => _topLevelMethod;
......
......@@ -436,7 +436,7 @@ private BoundExpression HoistRefInitialization(SynthesizedLocal local, BoundAssi
if (F.Compilation.Options.OptimizationLevel == OptimizationLevel.Debug)
{
awaitSyntaxOpt = (AwaitExpressionSyntax)local.GetDeclaratorSyntax();
syntaxOffset = this.OriginalMethod.CalculateLocalSyntaxOffset(awaitSyntaxOpt.SpanStart, awaitSyntaxOpt.SyntaxTree);
syntaxOffset = this.OriginalMethod.CalculateLocalSyntaxOffset(awaitSyntaxOpt.SpanStart, awaitSyntaxOpt.SyntaxTree, instrumentForDynamicAnalysis: false);
}
else
{
......
......@@ -166,7 +166,7 @@ protected BoundStatement Rewrite()
// EnC: When emitting the baseline (gen 0) the id is stored in a custom debug information attached to the kickoff method.
// When emitting a delta the id is only used to map to the existing field in the previous generation.
SyntaxNode declaratorSyntax = local.GetDeclaratorSyntax();
int syntaxOffset = this.method.CalculateLocalSyntaxOffset(declaratorSyntax.SpanStart, declaratorSyntax.SyntaxTree);
int syntaxOffset = this.method.CalculateLocalSyntaxOffset(declaratorSyntax.SpanStart, declaratorSyntax.SyntaxTree, instrumentForDynamicAnalysis: false);
int ordinal = synthesizedLocalOrdinals.AssignLocalOrdinal(synthesizedKind, syntaxOffset);
id = new LocalDebugId(syntaxOffset, ordinal);
......
......@@ -41,9 +41,9 @@ IMethodSymbol ISynthesizedMethodBodyImplementationSymbol.Method
get { return StateMachineType.KickoffMethod; }
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
return this.StateMachineType.KickoffMethod.CalculateLocalSyntaxOffset(localPosition, localTree);
return this.StateMachineType.KickoffMethod.CalculateLocalSyntaxOffset(localPosition, localTree, instrumentForDynamicAnalysis);
}
}
......
......@@ -212,7 +212,7 @@ protected SyntheticBoundNodeFactory CreateBoundNodeFactory(TypeCompilationState
return F;
}
internal sealed override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal sealed override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -245,7 +245,7 @@ internal sealed override IEnumerable<Cci.SecurityAttribute> GetSecurityInformati
throw ExceptionUtilities.Unreachable;
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -1062,7 +1062,7 @@ internal override ImmutableArray<string> GetAppliedConditionalSymbols()
}
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -967,7 +967,7 @@ internal virtual bool SynthesizesLoweredBoundBody
/// as if all source these parts were concatenated together and prepended to the constructor body.
/// The resulting syntax offset is then negative for locals defined outside of the constructor body.
/// </remarks>
internal abstract int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree);
internal abstract int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis);
#region IMethodSymbol Members
......@@ -1220,7 +1220,7 @@ public virtual MethodSymbol TupleUnderlyingMethod
bool IMethodSymbolInternal.IsIterator => IsIterator;
int IMethodSymbolInternal.CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) => CalculateLocalSyntaxOffset(localPosition, localTree);
int IMethodSymbolInternal.CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis) => CalculateLocalSyntaxOffset(localPosition, localTree, instrumentForDynamicAnalysis);
#endregion
......
......@@ -410,7 +410,7 @@ private ImmutableArray<ParameterSymbol> MakeParameters()
}
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -312,7 +312,7 @@ internal override bool GenerateDebugInfo
get { return false; }
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
// retargeting symbols refer to a symbol from another compilation, they don't define locals in the current compilation
throw ExceptionUtilities.Unreachable;
......
......@@ -143,7 +143,7 @@ internal override bool IsMetadataFinal
}
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) { throw ExceptionUtilities.Unreachable; }
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis) { throw ExceptionUtilities.Unreachable; }
#endregion
}
......
......@@ -375,7 +375,7 @@ internal override bool GenerateDebugInfo
get { return true; }
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -303,7 +303,7 @@ internal override IEnumerable<SecurityAttribute> GetSecurityInformation()
throw ExceptionUtilities.Unreachable;
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -234,7 +234,7 @@ internal override bool GenerateDebugInfo
get { return true; }
}
internal override int CalculateLocalSyntaxOffset(int position, SyntaxTree tree)
internal override int CalculateLocalSyntaxOffset(int position, SyntaxTree tree, bool instrumentForDynamicAnalysis)
{
Debug.Assert(position >= 0 && tree != null);
......
......@@ -883,7 +883,7 @@ internal ImmutableArray<ImmutableArray<FieldOrPropertyInitializer>> InstanceInit
get { return GetMembersAndInitializers().InstanceInitializers; }
}
internal int CalculateSyntaxOffsetInSynthesizedConstructor(int position, SyntaxTree tree, bool isStatic)
internal int CalculateSyntaxOffsetInSynthesizedConstructor(int position, SyntaxTree tree, bool isStatic, bool instrumentForDynamicAnalysis)
{
if (IsScriptClass && !isStatic)
{
......@@ -909,12 +909,17 @@ internal int CalculateSyntaxOffsetInSynthesizedConstructor(int position, SyntaxT
return syntaxOffset;
}
// With instrumentation, a synthesized constructor has a local variable for the instrumentation payload,
// and an ininitializer with a lambda can refer to that local.
return 0;
if (instrumentForDynamicAnalysis)
{
// With dynamic analysis instrumentation, a type declaration can be the syntax associated
// with the analysis payload local of a synthesized constructor.
// If the synthesized constructor includes an initializer with a lambda,
// that lambda needs a closure that captures the analysis payload of the constructor.
return 0;
}
// an implicit constructor has no body and no initializer, so the variable has to be declared in a member initializer
// throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.Unreachable;
}
/// <summary>
......
......@@ -1565,7 +1565,7 @@ protected void CheckModifiersForBody(Location location, DiagnosticBag diagnostic
/// </remarks>
internal abstract bool IsExpressionBodied { get; }
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
// Method without body doesn't declare locals.
Debug.Assert(this.BodySyntax != null);
......
......@@ -357,7 +357,7 @@ private ImmutableArray<ParameterSymbol> SubstituteParameters()
}
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -276,7 +276,7 @@ internal sealed override ImmutableArray<string> GetAppliedConditionalSymbols()
return ImmutableArray<string>.Empty;
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -307,7 +307,7 @@ internal override bool SynthesizesLoweredBoundBody
internal abstract override void GenerateMethodBody(TypeCompilationState compilationState, DiagnosticBag diagnostics);
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -255,10 +255,10 @@ public sealed override ImmutableArray<MethodSymbol> ExplicitInterfaceImplementat
get { return ImmutableArray<MethodSymbol>.Empty; }
}
internal sealed override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal sealed override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
var containingType = (SourceMemberContainerTypeSymbol)this.ContainingType;
return containingType.CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, isStatic: false);
return containingType.CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, isStatic: false, instrumentForDynamicAnalysis: instrumentForDynamicAnalysis);
}
#endregion
......
......@@ -52,7 +52,7 @@ internal sealed override ObsoleteAttributeData ObsoleteAttributeData
get { return null; }
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -220,9 +220,9 @@ internal override bool IsMetadataVirtual(bool ignoreInterfaceImplementationChang
return false;
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
return _containingType.CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, isStatic: false);
return _containingType.CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, isStatic: false, instrumentForDynamicAnalysis: instrumentForDynamicAnalysis);
}
internal TypeSymbol ResultType
......
......@@ -397,7 +397,7 @@ internal override ObsoleteAttributeData ObsoleteAttributeData
}
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -351,10 +351,10 @@ internal override ImmutableArray<string> GetAppliedConditionalSymbols()
return ImmutableArray<string>.Empty;
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
var containingType = (SourceMemberContainerTypeSymbol)this.ContainingType;
return containingType.CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, isStatic: true);
return containingType.CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, isStatic: true, instrumentForDynamicAnalysis: instrumentForDynamicAnalysis);
}
}
}
......@@ -162,7 +162,7 @@ public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes()
return _underlyingMethod.GetReturnTypeAttributes();
}
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree, bool instrumentForDynamicAnalysis)
{
throw ExceptionUtilities.Unreachable;
}
......
......@@ -394,6 +394,14 @@ internal static bool IsClosureScope(SyntaxNode node)
case SyntaxKind.YieldReturnStatement:
return true;
case SyntaxKind.ClassDeclaration:
case SyntaxKind.StructDeclaration:
// With dynamic analysis instrumentation, a type declaration can be the syntax associated
// with the analysis payload local of a synthesized constructor.
// If the synthesized constructor includes an initializer with a lambda,
// that lambda needs a closure that captures the analysis payload of the constructor.
return true;
default:
break;
}
......
......@@ -92,7 +92,7 @@ private int CalculateSyntaxOffsetInPreviousMethod(int position, SyntaxTree tree)
// Note that syntax offset of a syntax node contained in a lambda body is calculated by the containing top-level method,
// not by the lambda method. The offset is thus relative to the top-level method body start. We can thus avoid mapping
// the current lambda symbol or body to the corresponding previous lambda symbol or body, which is non-trivial.
return _previousTopLevelMethod.CalculateLocalSyntaxOffset(position, tree);
return _previousTopLevelMethod.CalculateLocalSyntaxOffset(position, tree, instrumentForDynamicAnalysis: false);
}
public override void AddPreviousLocals(ArrayBuilder<Cci.ILocalDefinition> builder)
......
......@@ -9,6 +9,6 @@ internal interface IMethodSymbolInternal : IMethodSymbol
/// </summary>
bool IsIterator { get; }
int CalculateLocalSyntaxOffset(int declaratorPosition, SyntaxTree declaratorTree);
int CalculateLocalSyntaxOffset(int declaratorPosition, SyntaxTree declaratorTree, bool instrumentForDynamicAnalysis);
}
}
......@@ -609,7 +609,7 @@ Friend Class MockMethodSymbol
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -1961,7 +1961,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -1329,7 +1329,7 @@ OtherExpressions:
If _ilEmitStyle = ILEmitStyle.Debug Then
Dim syntax = local.GetDeclaratorSyntax()
Dim syntaxOffset = _method.CalculateLocalSyntaxOffset(syntax.SpanStart, syntax.SyntaxTree)
Dim syntaxOffset = _method.CalculateLocalSyntaxOffset(syntax.SpanStart, syntax.SyntaxTree, instrumentForDynamicAnalysis:=False)
Dim ordinal = _synthesizedLocalOrdinals.AssignLocalOrdinal(localKind, syntaxOffset)
......
......@@ -105,10 +105,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Case SyntaxKind.ObjectMemberInitializer
' TODO: Closure capturing a synthesized "with" variable
Return
Case SyntaxKind.ClassBlock, SyntaxKind.StructureBlock
' With instrumentation, class declarations can be the syntax associated with a synthesized constructor.
' This is not truly a closure scope syntax, but must be allowed to pass here.
Return
End Select
ExceptionUtilities.UnexpectedValue(syntaxOpt.Kind())
......
......@@ -58,7 +58,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Get
End Property
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
......
......@@ -970,11 +970,17 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
closureId = New DebugId(closureDebugInfo.Count, CompilationState.ModuleBuilderOpt.CurrentGenerationOrdinal)
End If
Dim syntaxOffset As Integer = _topLevelMethod.CalculateLocalSyntaxOffset(syntax.SpanStart, syntax.SyntaxTree)
Dim syntaxOffset As Integer = _topLevelMethod.CalculateLocalSyntaxOffset(syntax.SpanStart, syntax.SyntaxTree, InstrumentForDynamicAnalysis)
closureDebugInfo.Add(New ClosureDebugInfo(syntaxOffset, closureId))
Return closureId
End Function
Private ReadOnly Property InstrumentForDynamicAnalysis As Boolean
Get
Return If(CompilationState.ModuleBuilderOpt IsNot Nothing, CompilationState.ModuleBuilderOpt.EmitOptions.EmitDynamicAnalysisData, False)
End Get
End Property
Private Function GetLambdaId(syntax As SyntaxNode, closureKind As ClosureKind, closureOrdinal As Integer) As DebugId
Debug.Assert(syntax IsNot Nothing)
......@@ -1011,7 +1017,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
lambdaId = New DebugId(_lambdaDebugInfoBuilder.Count, CompilationState.ModuleBuilderOpt.CurrentGenerationOrdinal)
End If
Dim syntaxOffset As Integer = _topLevelMethod.CalculateLocalSyntaxOffset(lambdaOrLambdaBodySyntax.SpanStart, lambdaOrLambdaBodySyntax.SyntaxTree)
Dim syntaxOffset As Integer = _topLevelMethod.CalculateLocalSyntaxOffset(lambdaOrLambdaBodySyntax.SpanStart, lambdaOrLambdaBodySyntax.SyntaxTree, InstrumentForDynamicAnalysis)
_lambdaDebugInfoBuilder.Add(New LambdaDebugInfo(syntaxOffset, lambdaId, closureOrdinal))
Return lambdaId
End Function
......
......@@ -218,10 +218,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
' Syntax offset of a syntax node contained in a lambda body is calculated by the containing top-level method.
' The offset is thus relative to the top-level method body start.
Return _topLevelMethod.CalculateLocalSyntaxOffset(localPosition, localTree)
Return _topLevelMethod.CalculateLocalSyntaxOffset(localPosition, localTree, instrumentForDynamicAnalysis)
End Function
' The lambda method body needs to be updated when the containing top-level method body is updated.
......
......@@ -313,7 +313,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -290,7 +290,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
' When emitting a delta the id is only used to map to the existing field in the previous generation.
Dim declaratorSyntax As SyntaxNode = local.GetDeclaratorSyntax()
Dim syntaxOffset As Integer = Me.Method.CalculateLocalSyntaxOffset(declaratorSyntax.SpanStart, declaratorSyntax.SyntaxTree)
Dim syntaxOffset As Integer = Me.Method.CalculateLocalSyntaxOffset(declaratorSyntax.SpanStart, declaratorSyntax.SyntaxTree, instrumentForDynamicAnalysis:=False)
Dim ordinal As Integer = SynthesizedLocalOrdinals.AssignLocalOrdinal(local.SynthesizedKind, syntaxOffset)
id = New LocalDebugId(syntaxOffset, ordinal)
......
......@@ -153,8 +153,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Return Me.StateMachineType.KickoffMethod.CalculateLocalSyntaxOffset(localPosition, localTree)
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Return Me.StateMachineType.KickoffMethod.CalculateLocalSyntaxOffset(localPosition, localTree, instrumentForDynamicAnalysis)
End Function
Public ReadOnly Property HasMethodBodyDependency As Boolean Implements ISynthesizedMethodBodyImplementationSymbol.HasMethodBodyDependency
......
......@@ -34,7 +34,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -49,7 +49,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -92,7 +92,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -60,7 +60,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -98,7 +98,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -51,7 +51,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -66,7 +66,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -245,7 +245,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -1176,7 +1176,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -762,7 +762,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
''' as if all source these parts were concatenated together and prepended to the constructor body.
''' The resulting syntax offset is then negative for locals defined outside of the constructor body.
''' </remarks>
Friend MustOverride Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend MustOverride Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
''' <summary>
''' Specifies whether existing, "unused" locals (corresponding to proxies) are preserved during lambda rewriting.
......@@ -999,8 +999,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Private Function IMethodSymbolInternal_CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer Implements IMethodSymbolInternal.CalculateLocalSyntaxOffset
Return CalculateLocalSyntaxOffset(localPosition, localTree)
Private Function IMethodSymbolInternal_CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer Implements IMethodSymbolInternal.CalculateLocalSyntaxOffset
Return CalculateLocalSyntaxOffset(localPosition, localTree, instrumentForDynamicAnalysis)
End Function
#End Region
......
......@@ -615,7 +615,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
......
......@@ -490,7 +490,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Retargeting
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
' retargeting symbols refer to a symbol from another compilation, they don't define locals in the current compilation
Throw ExceptionUtilities.Unreachable
End Function
......
......@@ -302,7 +302,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
#End Region
......
......@@ -332,7 +332,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
......
......@@ -3235,7 +3235,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Function CalculateSyntaxOffsetInSynthesizedConstructor(position As Integer, tree As SyntaxTree, isShared As Boolean) As Integer
Friend Function CalculateSyntaxOffsetInSynthesizedConstructor(position As Integer, tree As SyntaxTree, isShared As Boolean, instrumentForDynamicAnalysis As Boolean) As Integer
If IsScriptClass AndAlso Not isShared Then
Dim aggregateLength As Integer = 0
......@@ -3258,13 +3258,17 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Return syntaxOffset
End If
' With instrumentation, a synthesized constructor has a local variable for the instrumentation payload,
' and an ininitializer with a lambda can refer to that local.
Return 0
If instrumentForDynamicAnalysis Then
' With dynamic analysis instrumentation, a type declaration can be the syntax associated
' with the analysis payload local of a synthesized constructor.
' If the synthesized constructor includes an initializer with a lambda,
' that lambda needs a closure that captures the analysis payload of the constructor.
Return 0
End If
' This point should not be reachable. An implicit constructor has no body and no initializer,
' so the variable has to be declared in a member initializer.
' Throw ExceptionUtilities.Unreachable
Throw ExceptionUtilities.Unreachable
End Function
' Calculates a syntax offset of a syntax position that is contained in a property or field initializer (if it is in fact contained in one).
......
......@@ -1201,7 +1201,7 @@ lReportErrorOnTwoTokens:
Return New BoundBlock(methodBlock, methodBlock.Statements, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(boundStatement))
End Function
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Dim span As TextSpan
Dim block = BlockSyntax
......
......@@ -1342,7 +1342,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -56,11 +56,11 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
' although the containing type can be PE symbol, such a constructor doesn't
' declare source locals And thus this method shouldn't be called.
Dim containingType = DirectCast(Me.ContainingType, SourceMemberContainerTypeSymbol)
Return containingType.CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, IsShared)
Return containingType.CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, IsShared, instrumentForDynamicAnalysis)
End Function
End Class
End Namespace
......@@ -181,7 +181,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
......
......@@ -508,7 +508,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
......
......@@ -139,8 +139,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
ImmutableArray.Create(Of BoundStatement)(New BoundLabelStatement(syntax, ExitLabel)))
End Function
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Return DirectCast(m_containingType, SourceMemberContainerTypeSymbol).CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, isShared:=False)
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Return DirectCast(m_containingType, SourceMemberContainerTypeSymbol).CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, isShared:=False, instrumentForDynamicAnalysis:=instrumentForDynamicAnalysis)
End Function
Private Shared Sub CalculateReturnType(
......
......@@ -88,7 +88,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -128,7 +128,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
......
......@@ -128,9 +128,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Dim containingType = DirectCast(Me.ContainingType, SourceMemberContainerTypeSymbol)
Return containingType.CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, IsShared)
Return containingType.CalculateSyntaxOffsetInSynthesizedConstructor(localPosition, localTree, IsShared, instrumentForDynamicAnalysis)
End Function
End Class
End Namespace
......@@ -103,7 +103,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -451,7 +451,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
......
......@@ -430,7 +430,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -335,7 +335,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -192,7 +192,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -173,7 +173,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
......
......@@ -61,7 +61,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -108,7 +108,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
......
......@@ -116,7 +116,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Return Me._underlyingMethod.GetReturnTypeAttributes()
End Function
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree, instrumentForDynamicAnalysis As Boolean) As Integer
Throw ExceptionUtilities.Unreachable
End Function
......
......@@ -677,6 +677,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
' lambda expression body closure
Return True
Case SyntaxKind.ClassBlock, SyntaxKind.StructureBlock
' With dynamic analysis instrumentation, a type declaration can be the syntax associated
' with the analysis payload local of a synthesized constructor.
' If the synthesized constructor includes an initializer with a lambda,
' that lambda needs a closure that captures the analysis payload of the constructor.
Return True
Case Else
If IsLambdaBody(node) Then
Return True
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册