Alias package

Where can I suggest this feature?

import com.rialight.temporal.* in Temporal;

new Temporal.ZonedDateTime(...);

It’s basically a “package” alias.

Does this not work for you?

import hxmath.math.Vector2 as MyTestVector2;
import haxe.Int64 as MyInt64;

class Test {
	static function main() {
		var myVar = new MyTestVector2(4.0, 10.0);
    trace("Length: "+myVar.length);
    var myInt64 = MyInt64.make(0x3434,0x752);
    trace("Int64: "+myInt64);

It works to alias types, but not packages. I mean, this doesn’t work:

import haxe.ds as DS;

Test.hx:1: characters 13-15 : Module name must start with an uppercase letter

You could try to create issue or pull request here: GitHub - HaxeFoundation/haxe-evolution: Repository for maintaining proposal for changes to the Haxe programming language

1 Like