HaxeFoundation / HaxeFoundation/haxe
Type not found error causes questionable error state
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
I noticed today that when deleting the haxe.crypto package and trying to compile haxelib, the reported errors look like this:
```
C:\git\haxe\std/haxe/zip/InflateImpl.hx:26: characters 8-27 : Type not found : haxe.crypto.Adler32
C:\git\haxe\std/haxe/zip/InflateImpl.hx:35: characters 10-17 : Type not found : Adler32
C:\git\haxe\std/haxe/zip/InflateImpl.hx:146: characters 12-27 : haxe.zip._InflateImpl.Window does not have a constructor
C:\git\haxe\std/haxe/zip/InflateImpl.hx:287: characters 23-31 : haxe.zip._InflateImpl.Window has no field checksum
C:\git\haxe\std/haxe/zip/InflateImpl.hx:292: characters 15-22 : Type not found : Adler32
C:\git\haxe\std/haxe/zip/InflateImpl.hx:205: characters 10-18 : haxe.zip._InflateImpl.Window has no field addBytes
C:\git\haxe\std/haxe/zip/InflateImpl.hx:219: characters 18-29 : haxe.zip._InflateImpl.Window has no field getLastChar
C:\git\haxe\std/haxe/zip/InflateImpl.hx:212: characters 10-17 : haxe.zip._InflateImpl.Window has no field addByte
C:\git\haxe\std/haxe/zip/InflateImpl.hx:380: characters 24-33 : haxe.zip._InflateImpl.Window has no field available
```
This suggests a strange error state where compilation continues despite the original error, but without the erroneous class having any structure. I find this to be an odd middle ground, because compilation should either:
1. Fail harder so these followup errors don't occur in the first place.
2. Don't fail so hard so that the class still has a structure.
Personally, I dislike how we try to recover from errors because I rarely find the followup errors useful, but I'm aware that others disagree with that. Either way, I'd first like to understand where the original error is caught.
Contributor guide
Research direction
Reproduce the failure by removing haxe.crypto and compiling haxelib, using the diagnostics from std/haxe/zip/InflateImpl.hx as the starting point. Trace the compiler's missing-type error recovery to identify where the original error is caught. Done means clarifying the intended recovery behavior and covering it with an appropriate regression case.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100