{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/342","labels_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/342/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/342/comments","events_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/342/events","html_url":"https://github.com/Microsoft/visualfsharp/issues/342","id":66004831,"number":342,"title":"FS0193 error when specifying sequential struct layout of a type","user":{"login":"kasperhj","id":1327538,"avatar_url":"https://avatars.githubusercontent.com/u/1327538?v=3","gravatar_id":"","url":"https://api.github.com/users/kasperhj","html_url":"https://github.com/kasperhj","followers_url":"https://api.github.com/users/kasperhj/followers","following_url":"https://api.github.com/users/kasperhj/following{/other_user}","gists_url":"https://api.github.com/users/kasperhj/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperhj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperhj/subscriptions","organizations_url":"https://api.github.com/users/kasperhj/orgs","repos_url":"https://api.github.com/users/kasperhj/repos","events_url":"https://api.github.com/users/kasperhj/events{/privacy}","received_events_url":"https://api.github.com/users/kasperhj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/visualfsharp/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Microsoft/visualfsharp/labels/fix%20ready","name":"fix ready","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-02T20:25:41Z","updated_at":"2015-05-19T01:54:26Z","closed_at":"2015-05-19T01:54:26Z","body":"While translating some C# code into F# I noticed some unexpected behavior with structlayout.\r\n\r\nHaving\r\n```\r\ntype MyType =\r\n    struct\r\n        val a: int\r\n    end\r\n```\r\nis fine, but having\r\n```\r\nopen System.Runtime.InteropServices\r\n[<type:StructLayout(LayoutKind.Sequential, Pack=1)>]\r\ntype LayoutType =\r\n    struct\r\n        val a: int\r\n    end\r\n```\r\nresults in an error:\r\n> error FS0193: internal error: Could not load type 'LayoutType' from assembly 'FSI-ASSEMBLY,  Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' because field 'a@' was not given an explicit  offset.\r\n\r\nSetting `Pack=0` and everything is fine.\r\n\r\nI tried this out in VS2013 and VS2015 CTP 6, and the results are identical.\r\n\r\n/@kasperhj"}}