Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

DanBurton opened this issue Jul 6, 2012 · 2 comments

Comments

@DanBurton
Copy link
Contributor

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
Copy link
Contributor

manzyuk commented May 4, 2013

Related to (duplicate of?) Issue #774.

@ttuegel
Copy link
Member

ttuegel commented Apr 23, 2015

Closing duplicate.

@ttuegel ttuegel closed this as completed Apr 23, 2015
frerich pushed a commit to frerich/catamorphism that referenced this issue Apr 10, 2018
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
Projects
None yet
Development

No branches or pull requests

3 participants