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

[Flow] Blank types and generics not working properly without marking a field @public #253

Closed
Neverbirth opened this issue Dec 12, 2017 · 1 comment

Comments

@Neverbirth
Copy link
Collaborator

This (dummy) sample will fail:

class Sample {
	public function new() {}

	public function test(value:Sample):Void
		trace(value);

	public static function getSomething<T>():T
		return cast new Sample();
}

In Flow:

	@type("memberapplet.configuration.Sample")
	sample = Sample.getSomething();
	sample.test(sample);

Doing this works

	@public
	@type("memberapplet.configuration.Sample")
	sample = Sample.getSomething();
	sample.test(sample);
@Neverbirth
Copy link
Collaborator Author

Neverbirth commented Dec 12, 2017

I guess if we could do this in Flow it wouldn't fail:

	sample.test(Sample.getSomething());

Or if the generated code would be replaced to

	sample.test(cast(Sample.getSomething(), Sample));

But both of these 2 solutions are not optimal if we reuse sample on many places.

By the way, I think it's worth saying that the raised error in this case is not very helpful and can be difficult to track down the source of the problem.

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