rescript-lang / rescript-lang/rescript

[bug] error reporting for res/resi/ conflict is hard to parse?

Aperta
#7,950 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
OCaml
Stelle
7.5k
Fork
485
Merge medio
1g 2h
PR unite (30g)
55

Descrizione

i guess this is pretty opinionated of me but to me, it's hard to read:

  The implementation <project path>/src/utils.res
  does not match the interface ../ocaml/utils.cmi:
  Values do not match:
    let anyToJson: (
  'a,
  ~breakCycle: ('a, array<string>) => JSON.t=?,
  ~encodeBigInt: BigInt.t => JSON.t=?,
  ~encodeSymbol: Symbol.t => JSON.t=?,
  ~encodeFunction: {..} => JSON.t=?,
) => JSON.t
  is not included in
    let anyToJson: (
  'a,
  ~breakCycle: ('a, array<string>) => JSON.t=?,
  ~encodeBigInt: BigInt.t => JSON.t=?,
  ~encodeSymbol: Symbol.t => JSON.t=?,
  ~encodeFunction: 'a => JSON.t=?,
) => JSON.t
  <project path>/src/utils.resi:1:1-7:11:
    Expected declaration
  <project path>/src/utils.res:69:5-13:
    Actual declaration
  1. the formatting and indentation is all weird
  2. it doesn't immediately tell me what the problem is
  3. it says something about Expected declaration which makes it even more confusin
  The implementation <project path>/src/utils.res
  does not match its expected interface:

  Implementation:

    let anyToJson: (
      'a,
      ~breakCycle: ('a, array<string>) => JSON.t=?,
      ~encodeBigInt: BigInt.t => JSON.t=?,
      ~encodeSymbol: Symbol.t => JSON.t=?,
      ~encodeFunction: {..} => JSON.t=?,
    ) => JSON.t

  Declaration:

    let anyToJson: (
      'a,
      ~breakCycle: ('a, array<string>) => JSON.t=?,
      ~encodeBigInt: BigInt.t => JSON.t=?,
      ~encodeSymbol: Symbol.t => JSON.t=?,
      ~encodeFunction: 'a => JSON.t=?,
    ) => JSON.t

  ~encodeFunction has the following type in implementation: {..} => JSON.t=?,
  but should have this type according to interface:         'a => JSON.t=?

i don't need to see something about a .cmi file, and it's always easy enough to grep that i don't need to see line and column numbers for both implementation and declaration anyway. it's probably more common that a file is so small that reading the convoluted message costs me more time than the off-chance that the module is an absolute huge monolith to the point it'd save me time, so all in all, better to remove it.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci il conflitto res/resi usando i percorsi di esempio src/utils.res e src/utils.resi, quindi esamina il percorso di segnalazione degli errori del compilatore per questa incompatibilità tra interfacce. Il lavoro è completato quando la diagnostica è più leggibile, spiega direttamente la differenza tra i tipi ed evita dettagli .cmi non necessari e informazioni sulla posizione duplicate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ocaml
Ambito
compilers
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.