HaxeFoundation / HaxeFoundation/haxe

Error: Typename X is redefined from module X (Windows)

Open
#11,579 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

If a .hx file is located in a capitalized folder in Windows, I get the following error:
"Type name X is redefined from module X (cb5ac375c8b3161f1f85bbfe7b70069e)"
This does not seem to affect building, but completely breaks VSCode's intellisense.

To reproduce, create a project where,
1.) Create https://heaps.io/documentation/hello-world.html
2.) Create a .hx file in a capitalized folder
3.) That .hx file is imported into another .hx

Example Project (Note that the "Test" folder is capitalized):
![image](https://github.com/HaxeFoundation/haxe/assets/13601282/627ff278-9ce2-4a4c-8bdc-09159b076aa1)

Main:
```
import test.SomeClass;

class Main extends hxd.App {
override function init() {}
static function main() {
new Main();
}
}
```
SomeClass:
```
package test;

class SomeClass{
var x:Int;

public function new(){
this.x = 1;
}
}
```

If you click on the SomeClass.hx file in VSCode, you'll get this error:
![image](https://github.com/HaxeFoundation/haxe/assets/13601282/a7a9ffe5-7d21-4dfa-b2cc-8f023c0bbe09)

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue using the heaps.io hello-world setup on Windows, placing an imported .hx file in a capitalized folder such as Test and opening SomeClass.hx in VSCode. Compare the language-service behavior with a lowercase folder; done means VSCode no longer reports the type as redefined and IntelliSense works while the project still builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
compilers, developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.