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

@:using should work on typedefs #7859

Closed
Gama11 opened this issue Feb 24, 2019 · 1 comment
Closed

@:using should work on typedefs #7859

Gama11 opened this issue Feb 24, 2019 · 1 comment
Assignees

Comments

@Gama11
Copy link
Member

Gama11 commented Feb 24, 2019

Regular static extensions with on typedefs with using:

using Main.Tools;

class Main {
	static function main() {
		({value: 0} : A).print();
	}
}

typedef A = {value:Int};

class Tools {
	public static function print(a:A) {
		trace(a.value);
	}
}

Consequently, it feels quite inconsistent that this doesn't work with the new @:using metadata:

class Main {
	static function main() {
		({value: 0} : A).print(); // A has no field print
	}
}

@:using(Main.Tools)
typedef A = {value:Int};

class Tools {
	public static function print(a:A) {
		trace(a.value);
	}
}
@Gama11
Copy link
Member Author

Gama11 commented Apr 18, 2019

#8188

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