Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined macro method 'TypeNode#new' with strict_multi_assign on multi assignment count mismatch #14056

Open
Blacksmoke16 opened this issue Dec 5, 2023 · 1 comment

Comments

@Blacksmoke16
Copy link
Member

Blacksmoke16 commented Dec 5, 2023

{%
  a, b, c, d = {1, 2, 3}
%}

Running with -Dstrict_multi_assign results in:

In test.cr:1:1

 1 | {%
     ^
Error: expanding macro


In test.cr:2:16

 2 | a, b, c, d = {1, 2, 3}
                  ^--
Error: undefined macro method 'TypeNode#new'

Created that method in the compiler and added some additional output:

method     # => "new"
args       # => ["Multiple assignment count mismatch"]
named_args # => nil
self       # => IndexError

Seems to be coming from

index_error = Call.new(Path.global("IndexError"), "new", StringLiteral.new("Multiple assignment count mismatch")).at(value)
. Likely another regression from #11597 given it works on 1.9.0, but fails on 1.10.0.

@Blacksmoke16 Blacksmoke16 added kind:bug topic:lang:macros kind:regression Something that used to correctly work but no longer works labels Dec 5, 2023
@Blacksmoke16 Blacksmoke16 changed the title Undefined macro method 'TypeNode#new' with recursive loop, strict_multi_assign, and block unpacking in macro Undefined macro method 'TypeNode#new' with strict_multi_assign on multi assignment count mismatch Dec 5, 2023
@HertzDevil
Copy link
Contributor

I don't think this has ever worked since the introduction of -Dstrict_multi_assign, so it is just the error message that needs to be changed

@HertzDevil HertzDevil removed the kind:regression Something that used to correctly work but no longer works label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants