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

"Cannot access field or identifier timeout for writing" with call before assignment #8079

Closed
Gama11 opened this issue Apr 1, 2019 · 3 comments · Fixed by #8096
Closed

"Cannot access field or identifier timeout for writing" with call before assignment #8079

Gama11 opened this issue Apr 1, 2019 · 3 comments · Fixed by #8096

Comments

@Gama11
Copy link
Member

Gama11 commented Apr 1, 2019

The following used to compile with Haxe 4.0.0-rc.2, but no longer does on dev (probably related to #8011):

class Main {
	static function main() {}

	static function foo(state:Dynamic) {
		var instance = state.instance;
		instance.timeout.stop();
		instance.timeout = null; // Cannot access field or identifier timeout for writing
	}
}

The above code is isolated from Lime 7.2.1. Is this an intentional breaking change, or a regression?

@Simn
Copy link
Member

Simn commented Apr 1, 2019

¬_(&!")£&!"$(£&)"(*$"£($"£$£"}~~}£"?$

@nadako
Copy link
Member

nadako commented Apr 1, 2019

what if you type-hint var instance with Dynamic?

@Simn
Copy link
Member

Simn commented Apr 1, 2019

Yes that works, it's an instance of the dynamic inference issue.

@Simn Simn added the regression label Apr 1, 2019
@Simn Simn added this to the Release 4.0 milestone Apr 1, 2019
RealyUniqueName added a commit that referenced this issue Apr 3, 2019
RealyUniqueName added a commit that referenced this issue Apr 5, 2019
RealyUniqueName added a commit that referenced this issue Apr 5, 2019
* Revert "Final vs. never vs. null (#8011)"

This reverts commit 3096727.

* test for #8079, #8081, #8093

* fix test for #8079
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants