Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Custom errors aren't reported at the right location

Chiusa
#599 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Ambito
compilers

Direzione di ricerca

Install the stated debug and yoga-json packages, then reproduce the diagnostics with the provided Main.purs example. Trace how the compiler assigns locations to the custom errors and warnings shown in the output; done means those diagnostics point to their actual originating spans rather than the reported locations.

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

Descrizione

module Main where

import Prelude

import Effect (Effect)
import Data.Variant (Variant)
import Data.Variant as Variant
import Type.Proxy (Proxy(..))
import Yoga.JSON as JSON
import Debug (traceM)
import Yoga.JSON.Variant (TaggedVariant(..))

type V = (a :: {}, b :: {})
type TV = TaggedVariant "type" "value" V
type Var = Variant V

main :: Effect Unit
main = do
  tv
  tv2

tv = do
  let f = JSON.write ((fromHomogeneous { a: {} }) :: Var)
  traceM f
  traceM $ JSON.read @Var f

tv2 = do
  let f = JSON.write (TaggedVariant $ (Variant.inj (Proxy @"a") {}) :: TV)
  traceM f
  traceM $ JSON.read @TV f

Error! · [NotInScope] · src/Main.purs:23:24
  •
  │
  • 'fromHomogeneous' is not in scope
  │
  │     let f = JSON.write ((fromHomogeneous { a: {} }) :: Var)
  │                          ╰──────────────
  •

Warning! · [CustomWarning] · src/Main.purs:27:1
  •
  │
  • Debug function usage
  │
  │   tv2 = do
  │   ╰───────
  •

Warning! · [CustomWarning] · src/Main.purs:27:1
  •
  │
  • Debug function usage
  │
  │   tv2 = do
  │   ╰───────
  •

Error! · [CannotUnify] · src/Main.purs:23:24
  •
  │
  • Cannot unify '?[invalid function application]' with 'Variant V'
  │
  │     let f = JSON.write ((fromHomogeneous { a: {} }) :: Var)
  │                          ╰────────────────────────
  •

Warning! · [CustomWarning] · src/Main.purs:22:1
  •
  │
  • Debug function usage
  │
  │   tv = do
  │   ╰──────
  •

Warning! · [CustomWarning] · src/Main.purs:22:1
  •
  │
  • Debug function usage
  │
  │   tv = do
  │   ╰──────
  •

You'll need spago install debug and spago install yoga-json

Lingua principale
Rust
Stelle
117
Fork
11
Merge medio
4h 22m
PR unite (30g)
126

Preparare l'ambiente

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.

Altre issue di purefunctor/purescript-iris

Tutte le issue di purefunctor/purescript-iris

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.