Created
October 29, 2014 18:33
-
-
Save eiriktsarpalis/ec4a108444a91c0e7e8f to your computer and use it in GitHub Desktop.
F# bug reproduction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Foo<'T>(bar (* add explicit type annotation to fix *), value : 'T) = | |
member __.Value = value | |
and Bar () as self = | |
let create (x : 'T) : Foo<'T> = | |
printfn "%O" typeof<'T> | |
new Foo<'T>(self, x) | |
member __.Create<'T>(x : 'T) : Foo<'T> = create x | |
Bar().Create 1 |
Here's the peverify error:
[IL]: Error: [C:\GitHub\dsyme\visualfsharp\a.exe : A+Bar::create[T]][offset 0x00 000037][found (unboxed) 'T'][expected ref 'System.Object'] Unexpected type on th e stack.
[IL]: Error: [C:\GitHub\dsyme\visualfsharp\a.exe : A+Bar::create[T]][offset 0x0000003C][found ref 'A+Foo`1[System.Object]'][expected ref 'A+Foo`1[T]'] Unexpected type on the stack.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, that's a bug. Thanks!