{"action":"reopened","issue":{"url":"https://api.github.com/repos/fsharp/fsharp/issues/652","repository_url":"https://api.github.com/repos/fsharp/fsharp","labels_url":"https://api.github.com/repos/fsharp/fsharp/issues/652/labels{/name}","comments_url":"https://api.github.com/repos/fsharp/fsharp/issues/652/comments","events_url":"https://api.github.com/repos/fsharp/fsharp/issues/652/events","html_url":"https://github.com/fsharp/fsharp/issues/652","id":196077086,"number":652,"title":"Record types problem in F# interactive on Mono ","user":{"login":"evelinag","id":5541162,"avatar_url":"https://avatars2.githubusercontent.com/u/5541162?v=4","gravatar_id":"","url":"https://api.github.com/users/evelinag","html_url":"https://github.com/evelinag","followers_url":"https://api.github.com/users/evelinag/followers","following_url":"https://api.github.com/users/evelinag/following{/other_user}","gists_url":"https://api.github.com/users/evelinag/gists{/gist_id}","starred_url":"https://api.github.com/users/evelinag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evelinag/subscriptions","organizations_url":"https://api.github.com/users/evelinag/orgs","repos_url":"https://api.github.com/users/evelinag/repos","events_url":"https://api.github.com/users/evelinag/events{/privacy}","received_events_url":"https://api.github.com/users/evelinag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-12-16T14:56:01Z","updated_at":"2017-10-17T08:55:30Z","closed_at":null,"author_association":"NONE","body":"I'm having problems with F# interactive 4.1 on mono 4.8. When creating a record type and running some code using that type, F# interactive throws an exception that it can't load the record type. \r\n\r\nI've seen the same error on several different mac laptops at the F# tutorials last week, so it's not an isolated problem. \r\n\r\n#### Repro steps\r\n\r\nRun the following code in F# interactive on mono:\r\n```\r\ntype Foo = { Bar : string }\r\nlet xs =\r\n    [| \"a\"; \"b\" ; \"c\" |]\r\n    |> Array.map (fun x -> { Bar = x })\r\n```\r\n\r\n#### Actual behavior\r\n\r\nF# interactive throws the following exception:\r\n```\r\nSystem.TypeLoadException: Could not load type 'FSI_0002+Foo[]' from assembly 'FSI-ASSEMBLY, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.\r\n  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)\r\n  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, Syste\r\nm.Globalization.CultureInfo culture) [0x00038] in <829ce140006e4cad9124766ee7f51179>:0\r\nStopped due to error\r\n```\r\n\r\n#### Known workarounds\r\n\r\nSurprisingly, when the record type is instantiated first, F# interactive works as expected. For example:\r\n\r\n```\r\ntype Foo = { Bar : string }\r\nlet x = { Bar = \"x\" }\r\nlet xs =\r\n    [| \"a\"; \"b\" ; \"c\" |]\r\n    |> Array.map (fun x -> { Bar = x })\r\n```\r\n\r\nThe code above works correctly in F# interactive and writes out:\r\n```\r\ntype Foo =\r\n  {Bar: string;}\r\nval x : Foo = {Bar = \"x\";}\r\nval xs : Foo [] = [|{Bar = \"a\";}; {Bar = \"b\";}; {Bar = \"c\";}|]\r\n```\r\n\r\nAlso surprisingly, if I replace the Array with List, the code works correctly without instantiating the record first:\r\n```\r\ntype Foo = { Bar : string }\r\nlet xs =\r\n    [ \"a\"; \"b\" ; \"c\" ]\r\n    |> List.map (fun x -> { Bar = x })\r\n```\r\n\r\n#### Related information \r\n\r\n* Operating system : OS X El Capitan 10.11.6\r\n* F# Interactive for F# 4.1\r\n* Mono: Mono JIT compiler version 4.8.0 (mono-4.8.0-branch/f5fbc32 Mon Nov 14 14:18:03 EST 2016)\r\n* Editing Tools: VS Code and fsharpi run in the command line"}}
{"actor":{"display_login":"tpetricek"}}