You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#light"off"#nowarn"62";;openSystemtypehober<'a>={ foo :'a }typegromus<'a>={ foo :'a }typehoobler<'a>(arg: 'a)=classmember__.foo= arg
endlet inlineprint_foo_memb<'a, 'b when^a :(member foo : 'b)>x =printfn "%A" (^a:(member foo : 'b)x)[<EntryPoint>]let main _ =let a :hober<_> ={foo=1 }inlet b :gromus<_> ={foo="horp" }inlet c =hoobler("durr")in//these are okprint_foo_memb<_,int> a;print_foo_memb<_,string> b;print_foo_memb<_,string> c;//these will cause a crash!print_foo_memb a;print_foo_memb b;//but it seems to only happen when the (unannotated)function is applied to//a record--classes are okprint_foo_memb c;0
On .NET:
Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'c:\users\msjp_000\documents\visual studio 2013\Projects\crashy\crashy\bin\Debug\crashy.exe'.
Additional information: The runtime has encountered a fatal error. The address of the error was at 0x72110237, on thread 0xd68. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
On Mono:
Unhandled Exception:
System.InvalidProgramException: Invalid IL code in Horp:main (string[]): IL_0082: callvirt 0x0a00000f
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in Horp:main (string[]): IL_0082: callvirt 0x0a00000f
This is with both fsc 3.1 and fsharpc 3.1.
The text was updated successfully, but these errors were encountered:
type hober<'a> = { foo : 'a }
let inline f x = box (^a : (member foo : 'b) x)
let v = f { foo=1 }
dsyme
changed the title
Polymorphic function with member constraint applied to record causes crash
Generic use of member constraint solved to record field causes crash
May 11, 2015
The following program typechecks, but crashes.
On .NET:
On Mono:
This is with both fsc 3.1 and fsharpc 3.1.
The text was updated successfully, but these errors were encountered: