haskell / haskell/cabal

`cabal check` error location not propagated ("unexpected SecArgName")

Open
#7,846 2 comments 0 reactions 0 assignees View on GitHub
attention: pr-welcome cabal-install: cmd/check Cabal: parser re: error-message type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

The syntax error
```
if (base < 4.7)
build-depends:
errorcall-eq-instance == 0.3.*
```
is reported by `cabal check` as follows:
```
Warning: MissingH.cabal:1:1:
unexpected SecArgName (Position 204 7) "base"
Errors encountered when parsing cabal file ./MissingH.cabal:

MissingH.cabal:1:1: error:
unexpected SecArgName (Position 204 7) "base"

1 | cabal-version: 1.12
| ^
Error: cabal: parse error
```

Expected behavior:
- Report error at 204:7 not at 1:1
- User-friendly error message

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.