1

Closed

Compiler generating invalid code.

description

Here is a minimal reproduction example:

https://gist.github.com/eiriktsarpalis/ec4a108444a91c0e7e8f

And here is the code generated, as shown in ILSpy

https://gist.github.com/eiriktsarpalis/197499e416227f7f91ff#file-generated-cs-L45

For further reference, here is a screenshot of what happens when trying to evaluate in fsi:

https://twitter.com/eiriktsarpalis/status/527528870699089920

The issue seems to go away when I add an explicit annotation to the Bar argument in the Foo constructor. Not sure whether this is a typecheck or codegen issue, type checker does complain if I change create into an explicit member method.
Closed Jan 27, 2015 at 6:17 PM by KevinRansom
Manage at github

comments