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
{{ message }}
Repository navigation
Generic use of member constraint solved to record field causes crash #238
#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
changed the title [-]Polymorphic function with member constraint applied to record causes crash[/-][+]Generic use of member constraint solved to record field causes crash[/+]on May 11, 2015
Activity
latkin commentedon Feb 19, 2015
Repros for me in 4.0. The "bad" lines result in nonverifiable generated code with
objecttype parameter in calls, instead of properintorstring.dsyme commentedon May 9, 2015
Minified repro:
[-]Polymorphic function with member constraint applied to record causes crash[/-][+]Generic use of member constraint solved to record field causes crash[/+]