{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/3585","repository_url":"https://api.github.com/repos/Microsoft/visualfsharp","labels_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/3585/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/3585/comments","events_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/3585/events","html_url":"https://github.com/Microsoft/visualfsharp/issues/3585","id":257815907,"number":3585,"title":"Funny behaviour for \"member .. interface with .. end\" on the same line","user":{"login":"piaste","id":12280683,"avatar_url":"https://avatars0.githubusercontent.com/u/12280683?v=4","gravatar_id":"","url":"https://api.github.com/users/piaste","html_url":"https://github.com/piaste","followers_url":"https://api.github.com/users/piaste/followers","following_url":"https://api.github.com/users/piaste/following{/other_user}","gists_url":"https://api.github.com/users/piaste/gists{/gist_id}","starred_url":"https://api.github.com/users/piaste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piaste/subscriptions","organizations_url":"https://api.github.com/users/piaste/orgs","repos_url":"https://api.github.com/users/piaste/repos","events_url":"https://api.github.com/users/piaste/events{/privacy}","received_events_url":"https://api.github.com/users/piaste/received_events","type":"User","site_admin":false},"labels":[{"id":295281377,"url":"https://api.github.com/repos/Microsoft/visualfsharp/labels/Area-Compiler","name":"Area-Compiler","color":"5319e7","default":false},{"id":164789606,"url":"https://api.github.com/repos/Microsoft/visualfsharp/labels/bug","name":"bug","color":"fc2929","default":true},{"id":308829121,"url":"https://api.github.com/repos/Microsoft/visualfsharp/labels/Urgency-Later","name":"Urgency-Later","color":"fad8c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-09-14T18:35:32Z","updated_at":"2017-09-19T19:25:19Z","closed_at":null,"author_association":"NONE","body":"Ok, this is about as low-priority as an issue can be. The only way I can imagine it _ever_ being a problem would require, I don't know, a code generation tool that steadfastedly refused to use newlines.\r\n\r\nI almost didn't want to open this issue, but I figure there's always a chance it could help as a clue to some other, actually significant problems with the lexer. Also, I find it interesting because of how bizarre it is.\r\n\r\n#### Repro steps\r\n\r\nThis code compiles:\r\n\r\n    type I = \r\n      abstract member M : int\r\n\r\n    type T0 = { F : string }\r\n      with \r\n        interface I with member __.M = 0 end\r\n      end\r\n\r\nThis code does _not_ compile, with squiggles under `interface`, the second `member`, and the second `end`:\r\n\r\n    type T1 = { F : string }\r\n      with \r\n        member x.M1 = 0 interface I with member __.M = 0 end\r\n      end\r\n\r\n```\r\nFS0010 Unexpected keyword 'interface' in expression. Expected incomplete structured construct at or before this point or other token.\r\nFS0010 Incomplete structured construct at or before this point in member definition. Expected 'member', 'override' or other token.\r\nFS0010 Unexpected keyword 'end' in type definition. Expected incomplete structured construct at or before this point or other token.\r\n```\r\n\r\nOk, so you can't put an interface implementation on the same line as a member? Nope! This code _does_ compile:\r\n\r\n    type T2 = { F : string }\r\n      with \r\n        member x.M1 = 0 member x.M2 = 0 interface I with member __.M = 0 end\r\n      end\r\n\r\nBut add a third member and the same compilation errors re-appear:\r\n\r\n    type T3 = { F : string }\r\n      with \r\n        member x.M1 = 0 member x.M2 = 0 member x.M3 = 0 interface I with member __.M = 0 end\r\n      end\r\n\r\nAnd so forth. `interface` after an even number of `member`s = OK, after an odd number of `member`s = error. (Tested up to n = 16.)\r\n\r\nNote that only _immediately preceding_ members on the _same line_ matter. Adding members before or after the line has no effect on the above behaviour. For example, in this code, the first `interface` is fine but the second causes errors:\r\n\r\n```\r\ntype T3a = { F : string }\r\n  with \r\n    member x.L = 0\r\n    member x.M1 = 0 member x.M2 = 0 interface I with member __.M = 0 end member x.M3 = 0 interface I2 with member __.M2 = 1 end\r\n    member x.N = 0\r\n  end\r\n```\r\n\r\n#### Expected behavior\r\n\r\nAll of the above examples should compile.\r\n\r\n#### Known workarounds\r\n\r\n - Don't commit crimes against basic coding standards\r\n - Put `interface` on its own line \r\n - Add `#light \"off\"`\r\n\r\n#### Related information \r\n\r\nI'm using the nightly release 15.4.1.17091101 on VS2017, but the issue appears just as easily on DotNetFiddle: https://dotnetfiddle.net/wsbL0f\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/comments/330647308","html_url":"https://github.com/Microsoft/visualfsharp/issues/3585#issuecomment-330647308","issue_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/3585","id":330647308,"user":{"login":"dsyme","id":7204669,"avatar_url":"https://avatars1.githubusercontent.com/u/7204669?v=4","gravatar_id":"","url":"https://api.github.com/users/dsyme","html_url":"https://github.com/dsyme","followers_url":"https://api.github.com/users/dsyme/followers","following_url":"https://api.github.com/users/dsyme/following{/other_user}","gists_url":"https://api.github.com/users/dsyme/gists{/gist_id}","starred_url":"https://api.github.com/users/dsyme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsyme/subscriptions","organizations_url":"https://api.github.com/users/dsyme/orgs","repos_url":"https://api.github.com/users/dsyme/repos","events_url":"https://api.github.com/users/dsyme/events{/privacy}","received_events_url":"https://api.github.com/users/dsyme/received_events","type":"User","site_admin":false},"created_at":"2017-09-19T19:25:19Z","updated_at":"2017-09-19T19:25:19Z","author_association":"CONTRIBUTOR","body":">  Fixing it might even result in other mysterious compile behaviours to disappear and give users a stronger feeling of reliability.\r\n\r\nYes, but it might also create instability - given the workarounds I would be loathe to make a fix until a more serious customer-facing scenario was documented\r\n\r\nBut my initial categorization was based on reading just the first line of the issue, and the workarounds -\r\n I've adjusted it :)\r\n\r\n"}}
{"actor":{"display_login":"dsyme"}}