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

Error at definition of Type #343

Closed
oskoi opened this Issue Feb 7, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@oskoi

oskoi commented Feb 7, 2016

I try write this:

type T = {

but get an error:

SyntaxError: found "{", expected NamedType ~ Refinement.? | Refinement at index 9
type T = {
         ^

If i use scala REPL, all works fine:

scala> type T = {
     | type X = Int
     | def x: X
     | type Y
     | def y: Y
     | }
defined type alias T

@lihaoyi lihaoyi added the bug label Feb 13, 2016

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Feb 13, 2016

Looks like a bug in ScalaParse where it's not properly inserting a ~/ cut after the open-curly after a type declaration:

https://github.com/lihaoyi/fastparse/blob/master/scalaparse/shared/src/main/scala/scalaparse/Types.scala#L32

The second ~ on that line should be a ~/ to make this behave correctly.

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Feb 19, 2016

This is fixed in master

lihaoyi pushed a commit that referenced this issue Feb 19, 2016

Li Haoyi
- Scalaparse 0.3.5 to fix #343
- Wrap long line in `TermCore.scala` to make tests pass
- Piles of comments in `Ansi.scala`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment