rescript-lang / rescript-lang/rescript
Uncapitalized cmi path in the error message
Nessuno ha ancora preso questa issue.
- Lingua principale
- OCaml
- Stelle
- 7.5k
- Fork
- 485
- Merge medio
- 1g 2h
- PR unite (30g)
- 55
Descrizione
// ABC.resi
type a = X | Y0
// ABC.res
type a = X | Y
The compiler failed to compile and show the message as below:
rescript: [3/3] src/ABC.cmj
FAILED: src/ABC.cmj
We've found a bug for you!
/Users/woonki/GitHub/projects/rescript-test2/src/ABC.res:1:1-14
1 │ type a = X | Y
2 │
The implementation /Users/woonki/GitHub/projects/rescript-test2/src/ABC.res
does not match the interface src/aBC.cmi: // ?? aBC.cmi
Type declarations do not match:
type a = X | Y
is not included in
type a = X | Y0
/Users/woonki/GitHub/projects/rescript-test2/src/ABC.resi:1:1-15:
Expected declaration
/Users/woonki/GitHub/projects/rescript-test2/src/ABC.res:1:1-14:
Actual declaration
Fields number 2 have different names, Y and Y0.
FAILED: cannot make progress due to previous errors.
I guess here is the place makes the module name uncapitalized https://github.com/rescript-lang/rescript-compiler/blob/master/jscomp/ext/misc.ml#L221-L222
If we change the order of if else as finding the fullname first then ufullname as last would fix this issue, but I don't know the history why finding the uncapitalized file path first instead of original path.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da jscomp/ext/misc.ml intorno alle righe 221-222 e riproduci il mismatch ABC.res/ABC.resi mostrato nell’issue. Traccia come vengono selezionati fullname e il nome del file non capitalizzato nel messaggio di errore, quindi verifica che il percorso .cmi segnalato conservi la capitalizzazione originale. Il lavoro è completato quando la riproduzione non mostra più aBC.cmi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- ocaml
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100