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 as value error disappears on second compilation #11184

Closed
Tracked by #11707
RblSb opened this issue Apr 26, 2023 · 7 comments
Closed
Tracked by #11707

Void as value error disappears on second compilation #11184

RblSb opened this issue Apr 26, 2023 · 7 comments
Assignees

Comments

@RblSb
Copy link
Member

RblSb commented Apr 26, 2023

Regression since 4.2.5.

class Main {
	static function main() {
		// compiles fine on second build try (bad)
		// also generates empty main.js or eval null exception
		function foo():Void {}

		final arr = [
			foo(),
			// bar()
		];
	}

	// always fails (good)
	function bar():Void {}
}

Another related bug, output tab with -D message-reporting=pretty looks like this for this code:

Failed - try fixing the error(s) and restarting the language server:

�[30;41m ERROR �[0m src/Main.hx:8: characters 4-9

 8 | �[2m   �[0m�[1mfoo()�[0m�[2m,�[0m
   |    �[31m^^^^^�[0m
   | Cannot use Void as value

And it generates bad Problem info in comparison to basic reporting, so you don't see red error highlighting in file.

@RblSb RblSb changed the title Void as value dissapers on second compilation Void as value error disappears on second compilation Apr 26, 2023
@kLabz
Copy link
Contributor

kLabz commented Apr 26, 2023

Yeah vshaxe has not been updated for pretty errors.

@Simn
Copy link
Member

Simn commented Apr 26, 2023

This looks pretty bad, might suggest that some error flag isn't set correctly and the server then caches the context...

@kLabz
Copy link
Contributor

kLabz commented Apr 26, 2023

I can bisect this tonight if you want (have to go for a couple hours now)

@Simn
Copy link
Member

Simn commented Apr 26, 2023

I'll do it

@Simn Simn self-assigned this Apr 26, 2023
@Simn
Copy link
Member

Simn commented Apr 26, 2023

7321f18

Note that this only reproduces with diagnostics enabled.

@RblSb
Copy link
Member Author

RblSb commented Nov 21, 2023

Fixed in #11220, but test needed

@RblSb RblSb closed this as completed Nov 21, 2023
@kLabz kLabz mentioned this issue Jul 18, 2024
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

No branches or pull requests

3 participants