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
expecting =, not`IDENT, id`, at :2:12 (Exception)
from /crystal/src/compiler/crystal/tools/formatter.cr:5170:9 in'??'
from /crystal/src/compiler/crystal/tools/formatter.cr:3395:7 in'visit'
from /crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in'accept'
from /crystal/src/compiler/crystal/tools/formatter.cr:4815:7 in'??'
from /crystal/src/compiler/crystal/tools/formatter.cr:4664:7 in'format_nested_with_end'
from /crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in'accept'
from /crystal/src/compiler/crystal/syntax/visitor.cr:20:7 in'visit'
from /crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in'accept'
from /crystal/src/compiler/crystal/tools/formatter.cr:23:7 in'format_source'
from /crystal/src/compiler/crystal/command/format.cr:133:7 in'format_many'
from /crystal/src/compiler/crystal/command/format.cr:63:5 in'format'
from /crystal/src/compiler/crystal/command.cr:179:7 in'tool'
from /crystal/src/compiler/crystal/command.cr:117:7 in'run'
from /crystal/src/compiler/crystal.cr:11:1 in'__crystal_main'
from /crystal/src/crystal/main.cr:129:5 in'main'
from src/env/__libc_start_main.c:95:2 in'libc_start_main_stage2'
Seems it does not like the invalid syntax in combination with an assignment to a nilable type.
So it turns out the parser is very lax when detecting valid assignment targets. In particular, Crystal::Parser#can_be_assigned? accepts far more Call nodes than #multi_assign_target?, so all the following lines have a similar issue:
Trying to format this results in:
Seems it does not like the invalid syntax in combination with an assignment to a nilable type.
Also somewhat related to #10698.
The text was updated successfully, but these errors were encountered: