提交 72ae5183 编写于 作者: C Chris Sienkiewicz

Fix failing tests:

- Don't do analysis for speculative attributes
- Manually call TryGetThisParameter, rather than MethodThisParameter which can throw
上级 ce65b091
......@@ -261,7 +261,7 @@ protected override ImmutableArray<PendingBranch> Scan(ref bool badRegion)
_returnTypesOpt.Clear();
}
this.Diagnostics.Clear();
ParameterSymbol methodThisParameter = MethodThisParameter;
((MethodSymbol)_symbol).TryGetThisParameter(out var methodThisParameter);
this.State = TopState(); // entry point is reachable
this.regionPlace = RegionPlace.Before;
EnterParameters(); // with parameters assigned
......@@ -293,7 +293,8 @@ protected override ImmutableArray<PendingBranch> Scan(ref bool badRegion)
BoundAttribute attribute,
DiagnosticBag diagnostics)
{
if (attribute.Constructor is null)
if (attribute.Constructor is null ||
!compilation.SyntaxTrees.Contains(attribute.SyntaxTree))
{
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册