未验证 提交 c4e5d138 编写于 作者: M msftbot[bot] 提交者: GitHub

Merge pull request #40281 from dotnet/merges/release/dev16.4-to-release/dev16.4-vs-deps

Merge release/dev16.4 to release/dev16.4-vs-deps
......@@ -3607,7 +3607,7 @@ protected override void VisitArguments(ImmutableArray<BoundExpression> arguments
}
}
if (method is object && (method.FlowAnalysisAnnotations & FlowAnalysisAnnotations.DoesNotReturn) == FlowAnalysisAnnotations.DoesNotReturn)
if (!IsAnalyzingAttribute && method is object && (method.FlowAnalysisAnnotations & FlowAnalysisAnnotations.DoesNotReturn) == FlowAnalysisAnnotations.DoesNotReturn)
{
SetUnreachable();
}
......
......@@ -7235,6 +7235,31 @@ class C { }
);
}
[Fact, WorkItem(40136, "https://github.com/dotnet/roslyn/issues/40136")]
public void SelfReferencingAttribute()
{
var source = @"
using System;
[AttributeUsage(AttributeTargets.All)]
[ExplicitCrossPackageInternal(ExplicitCrossPackageInternalAttribute.s)]
internal sealed class ExplicitCrossPackageInternalAttribute : Attribute
{
internal const string s = """";
[ExplicitCrossPackageInternal(s)]
internal ExplicitCrossPackageInternalAttribute([ExplicitCrossPackageInternal(s)] string prop)
{
}
[return: ExplicitCrossPackageInternal(s)]
[ExplicitCrossPackageInternal(s)]
internal void Method() { }
}";
var comp = CreateNullableCompilation(source);
comp.VerifyDiagnostics();
}
[Fact]
public void NullableAndConditionalOperators()
{
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册