Custom errors aren't reported at the right location
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- compilers
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Rust
- Stars
- 117
- Forks
- 11
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 126
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from purefunctor/purescript-iris
-
bug language-server
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
purefunctor/purescript-iris#552 ·
Maintainers usually reply within 1 day
-
bug language-server
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
purefunctor/purescript-iris#551 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
purefunctor/purescript-iris#613 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 58/100
purefunctor/purescript-iris#610 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
purefunctor/purescript-iris#560 ·
Maintainers usually reply within 1 day
All issues in purefunctor/purescript-iris
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
vercel-labs/agent-browser#2017 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tursodatabase/turso#9405 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolyMeilex/Neothesia#447 ·
Maintainers usually reply within 1 day
-
backend::vllm diffusion multimodal
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
trezor/trezor-firmware#7985 ·
Maintainers usually reply within 2 days