HaxeFoundation / haxe-evolution

Repository for maintaining proposal for changes to the Haxe programming language
111 stars 58 forks source link

[PROPOSAL] Making package statement optional #107

Open basro opened 1 year ago

basro commented 1 year ago

The package statement at the top of the file has always felt superfluous to me. The compiler already knows the package the file should have from the directory path it walked to find it.

I propose that when the package statement is missing the haxe compiler will automatically assign a package generated from the module's file path.

I'd like to know the general sentiment on this, I'll write formal proposal PR if it makes sense.

Aurel300 commented 1 year ago

Previous discussion here: https://github.com/HaxeFoundation/haxe/issues/6607

(@simn is it still used for completion somehow?)