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

Void expressions in value places... in non-value places #11391

Closed
Simn opened this issue Nov 19, 2023 · 0 comments
Closed

Void expressions in value places... in non-value places #11391

Simn opened this issue Nov 19, 2023 · 0 comments

Comments

@Simn
Copy link
Member

Simn commented Nov 19, 2023

#11356 lead to a discussion which can be simplified to the following example:

class Main {
	static function main() {
		[var tmp];
	}
}

There are two interpretations here:

  1. It should fail because the var tmp expression is Void, so we have Void in a value-place.
  2. It should not fail because the array declaration itself is in a non-value place, which means its elements could be generated as a block instead.

The analyzer already interprets it as 2., but the typer currently emits the array declaration. It's easy to argue that it shouldn't, but I'm somewhat worried about trying to be too clever here. So it anyone has an opinion on this, please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant