haskell / haskell/cabal

Wrong position report on parse failure

Open
#11,482 0 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/check Cabal: parser exact-print type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Given

```
cabal-version: 2.4
name: bug
version: 0

library
if impl(<9.4)
build-depends: something
```

`Cabal` reports wrong position of parse error:

```
cabal-3.16.1.0 check
Warning: bug.cabal:1:1:
unexpected SecArgOther (Position 7 11) "<"
Errors encountered when parsing cabal file bug.cabal:

bug.cabal:1:1: error:
unexpected SecArgOther (Position 7 11) "<"

1 | cabal-version: 2.4
| ^
Error: [Cabal-7035]
parse error
```

The issue is in `impl(<9.4)` (which probably should be `impl(ghc <9.4)`.

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.