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

Should default type parameters abide by imports? #11161

Closed
0b1kn00b opened this issue Apr 18, 2023 · 6 comments
Closed

Should default type parameters abide by imports? #11161

0b1kn00b opened this issue Apr 18, 2023 · 6 comments
Assignees

Comments

@0b1kn00b
Copy link

Using absolute paths seems to be necessary atm. online

import haxe.ds.Option;

class Test {
	static function main() {
		trace("Haxe is great!");
	}
}

class TestDefaultTypeParameter<T = Option<String>> {
	final data:T;

	public function new(data) {
		this.data = data;
	}
}
[ERROR] Test.hx:9: characters 36-50

 9 | class TestDefaultTypeParameter<T = Option<String>> {
   |                                    ^^^^^^^^^^^^^^
   | Type not found : Option
@Simn Simn self-assigned this Apr 18, 2023
@Simn Simn added this to the 4.3 Hotfix milestone Apr 18, 2023
@Simn
Copy link
Member

Simn commented Apr 18, 2023

Huh, very surprising that this fails even when everything is in the same module. Though I'd expect it to work even with separate modules.

@0b1kn00b
Copy link
Author

It's a great feature: proxies have 6 terms and might even be usable now.

@Simn Simn assigned kLabz and unassigned Simn Apr 18, 2023
@Simn
Copy link
Member

Simn commented Apr 18, 2023

This was actually pretty bad because it tried loading the type way too early. Definitely 4.3.1 material.

@kLabz
Copy link
Contributor

kLabz commented Apr 18, 2023

Any chance to get this to work too? 👀
https://try.haxe.org/#4a7aa8B3

@Simn
Copy link
Member

Simn commented Apr 18, 2023

Not here, but that does seem like it could be supported.

@0b1kn00b
Copy link
Author

Wait, that looks an awful lot like higher types.

@kLabz kLabz closed this as completed Apr 27, 2023
@kLabz kLabz removed this from the 4.3 Hotfix milestone Sep 8, 2023
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