Roslyn: Local function lacking `ref` check on return type

Created on 4 Sep 2018  路  4Comments  路  Source: dotnet/roslyn

I noticed this when looking at LazyAsyncMethodChecks in comparison to LocalFunctionSymbol.ComputeReturnType.

``C# public class C { async ref System.Threading.Tasks.Task M() { } // error CS1073 (badref` token)

public void M2()
{
   async ref System.Threading.Tasks.Task M() { } // no error
}

}
```

FYI @jaredpar I intend to fix this as part of async-streams work. Let me know if you think this should be fixed sooner.

Area-Compilers Bug

Most helpful comment

@RikkiGibson I just realized that I've fixed this issue already (in a feature branch which I'm about to merge back to trunk). Sorry about that.
I'll go ahead and close.

All 4 comments

Think this is fine to fix for dev16

The example in the description above hits a Debug.Assert in the emitter.

http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp/CodeGen/EmitStatement.cs,730

@RikkiGibson I just realized that I've fixed this issue already (in a feature branch which I'm about to merge back to trunk). Sorry about that.
I'll go ahead and close.

If you're curious the fix is here: https://github.com/dotnet/roslyn/pull/29741/files#diff-ae5907044cfb4d86b6675da5718d9aafR217

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdamSpeight2008 picture AdamSpeight2008  路  3Comments

OndrejPetrzilka picture OndrejPetrzilka  路  3Comments

joshua-mng picture joshua-mng  路  3Comments

glennblock picture glennblock  路  3Comments

JesperTreetop picture JesperTreetop  路  3Comments