The formatter can't format the following code: (@MakeNowJust :smiley:)
p NamedTuple(foo: Int32 bar: Bool).types
(there is no comma and it compiles! https://carc.in/#/r/3wvz)
NOTE: This syntax only works for the generic type, not in actual named tuples.
I think the syntax can be confusing, I'd suggest to remove it (by making the comma mandatory).
I think it should not be compiled and this is a simple parser bug.
-- εζζ₯, 21 4ζ 2018, 00:29εεΎ +09:00 from Benoit de Chezelles [email protected] :
The formatter can't format the following code: ( @MakeNowJust π)
p NamedTuple(foo: Int32 bar: Bool).types(there is no comma and it compiles! https://carc.in/#/r/3wvz )
NOTE: This syntax only works for the generic type, not in actual named tuples.
I think the syntax can be quite confusing, I'd suggest to remove it (by making the comma mandatory).
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub , or mute the thread .
I don't think that's a parser bug, just a feature that's never used and that looks weird to me with the rest of the language.
Just to add, this bug actually goes a bit deeper. Because when you compile you will not see any error, but when you are using Sublime for Crystal (or a console that runs crystal tool format on save), the formatter will echo out an Error: expecting ,, not IDENT, and ask the user to run a stack-trace. This will cause a small delay when saving files on WSL. Once the , was added, the delay went away, and the console flash is now instant.
εζζ₯, 21 4ζ 2018, 00:40εεΎ +09:00 from Benoit de Chezelles [email protected] :
I don't think that's a parser bug, just a feature that's never used and that looks weird to me with the rest of the language.
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub , or mute the thread .
Good point, I can't find a spec for that
Most helpful comment
I think it should not be compiled and this is a simple parser bug.
-- εζζ₯, 21 4ζ 2018, 00:29εεΎ +09:00 from Benoit de Chezelles [email protected] :