haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Cannot resolve std.Module.AnyClass

Open lublak opened this issue 6 years ago • 4 comments

Like the titel says: It is currently impossible to resolve a sub class in a module with std. std.Module.AnyClass => Class<Module> has no field AnyClass

I think if its not find any field it should look up the Types. Like the documentations says: https://haxe.org/manual/type-system-resolution-order.html

https://github.com/HaxeFoundation/haxe/issues/8470

lublak avatar Jun 25 '19 11:06 lublak

What exactly is being reported here? var x:std.Type.ValueType; works as expected.

Simn avatar Aug 06 '19 12:08 Simn

@Simn here is an example:

class Main {
	static function main() {
		test(std.Type.ValueType); // src/Main.hx:3: characters 8-26 : Class<Type> has no field ValueType
	}
	static function test<T>(cls:Class<T>) {}
}

lublak avatar Aug 07 '19 10:08 lublak

Ah, so it's about expression-level. And that means we're talking about that code, so I recommend that you work around this.

Simn avatar Aug 08 '19 11:08 Simn

@Simn i now fix it with an typedef.

You think that it is impossible to fix. Or? Because it would be too complicated?

What about the idea of a "class" construtor? "new Class<std.Type.ValueType>()"

this would a better workaround and i think it is simpler to implate this.

lublak avatar Aug 09 '19 08:08 lublak