From 73c60ead277438882b4b3236f311d6efd6f3e704 Mon Sep 17 00:00:00 2001 From: Charles Stoner Date: Tue, 16 Oct 2018 22:34:30 -0700 Subject: [PATCH] Misc. --- .../Source/SourceMemberMethodSymbol.cs | 5 +++-- .../Semantics/NullableReferenceTypesTests.cs | 20 ++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberMethodSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberMethodSymbol.cs index 64b8b6f9fbb..7a5e4ea26f3 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberMethodSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberMethodSymbol.cs @@ -1623,8 +1623,11 @@ internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, r { base.AddSynthesizedAttributes(moduleBuilder, ref attributes); + AddSynthesizedNonNullTypesAttributeForMember(ref attributes); + bool isAsync = this.IsAsync; bool isIterator = this.IsIterator; + if (!isAsync && !isIterator) { return; @@ -1661,8 +1664,6 @@ internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, r // to have correct stepping behavior during debugging. AddSynthesizedAttribute(ref attributes, compilation.SynthesizeDebuggerStepThroughAttribute()); } - - AddSynthesizedNonNullTypesAttributeForMember(ref attributes); } /// diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs index 0e9ee3d5b86..cfd3617b98b 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs @@ -39479,18 +39479,20 @@ public void TypeInference_LowerBounds_NestedNullability_Pointers() static void G(object?* x, object* y) { var z = CreatePointer(A.F)/*T:object**/; - F(x, x)/*T:object?*!*/; - F(x, y)/*T:object*!*/; - F(x, z)/*T:object*!*/; - F(y, x)/*T:object*!*/; - F(y, y)/*T:object!*!*/; - F(y, z)/*T:object*!*/; - F(z, x)/*T:object*!*/; - F(z, y)/*T:object*!*/; - F(z, z)/*T:object*!*/; + F(x, x)/*T:object**/; + F(x, y)/*T:object**/; + F(x, z)/*T:object**/; + F(y, x)/*T:object**/; + F(y, y)/*T:object**/; + F(y, z)/*T:object**/; + F(z, x)/*T:object**/; + F(z, y)/*T:object**/; + F(z, z)/*T:object**/; } }"; var comp = CreateCompilation(new[] { source }, options: WithNonNullTypesTrue(TestOptions.UnsafeDebugDll), references: new[] { ref0 }); + // NullableWalker.VisitCall is currently skipping F(x, y), etc. because + // each BoundCall has errors. comp.VerifyTypes(); comp.VerifyDiagnostics( // (4,12): error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('T') -- GitLab