"the following two should never happen" span happens #968

Closed
DanBurton opened this Issue Jul 6, 2012 · 2 comments

Comments

Projects
None yet
3 participants
@DanBurton
Contributor

DanBurton commented Jul 6, 2012

According to this file http://hackage.haskell.org/packages/archive/Cabal/1.14.0/doc/html/src/Distribution-ParseUtils.html

-- the following two should never happen:
Span n     l  :_ -> syntaxError n $ "unexpected span: " ++ show l
Line n _ _ l  :_ -> syntaxError n $ "unexpected line: " ++ show l

However if you attempt to use Haskell record update syntax as example code in the "description" field, you can make it happen. For example, if you use the following as the contents of a .cabal file:

description: > quux (foo { bar = baz })

You will get the error message

cabal: foo.cabal:1:  unexpected span: ")"

This may be connected to a deeper defect: curly braces do not display at all on Hackage package description pages.

@manzyuk

This comment has been minimized.

Show comment
Hide comment
@manzyuk

manzyuk May 4, 2013

Contributor

Related to (duplicate of?) Issue #774.

Contributor

manzyuk commented May 4, 2013

Related to (duplicate of?) Issue #774.

@ttuegel

This comment has been minimized.

Show comment
Hide comment
@ttuegel

ttuegel Apr 23, 2015

Member

Closing duplicate.

Member

ttuegel commented Apr 23, 2015

Closing duplicate.

@ttuegel ttuegel closed this Apr 23, 2015

frerich added a commit to frerich/catamorphism that referenced this issue Apr 10, 2018

Shortening the synposis and extending the description
It appears this is more like what's intended to get nice Haddock
documentation. Alas, I couldn't seem to reproduce the 'Expr' example
100% since passing a custom name for the catamorphism via

  $(makeCata defaultOptions { cataName = "foobar" } ''T)

always makes cabal choke with

  cabal: foo.cabal:1:  unexpected span: "''T"

It appears it's because of the curly braces, much like what was noted
in haskell/cabal#968 (but that ticket got
resolved years ago).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment