Replies: 1 comment 4 replies
-
Could you share a self-contained code snippet that you'd like to compile that does not today? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
async
/await
and "task-like" friends is a really interesting system that actually allows to conjure a completely unmanaged stackless coroutine system, without ever involving the GC. This allows to build performant graph processing systems for games that do not suffer from recursion (and thereby stack overflow) for instance.Unfortunately, the lowering of the feature changes codegen when running compiling under debug in an effort to support edit and continue - specifically the generated closure is a
class
under debug:https://github.com/dotnet/roslyn/blob/master/src/Compilers/CSharp/Portable/Lowering/AsyncRewriter/AsyncRewriter.cs#L68
This makes it impossible to constrain generic arguments in methods in the builder pointed to by
AsyncMethodBuilder
to be: unmanaged
.Worse, lowering happens after proposed source generation and compilation checks before assembly is emitted, so the usual suspects like Cecil cannot be employed to solve this.
I'm working in a domain where edit and continue would never work anyway, so a reasonable compromise could be having a compiler flag for overriding whether EnC is enabled, looks like
CompilationOptions
was already encapsulating this perhaps with that in mind?Thanks for any thoughts!
Beta Was this translation helpful? Give feedback.
All reactions