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

Wrong error message when for ,) inside anonymous function or in flatMap/map/flapTap etc #356

Open
lemastero opened this issue Jan 10, 2020 · 0 comments

Comments

@lemastero
Copy link

lemastero commented Jan 10, 2020

Observed incorrect behavior:

class WrongError extends App {
  def foo: () => Map[String, Double] = () =>
    Map(
      "age of star HD 140283" -> 14.46,
      "age of Universe" -> 13.8,
    )
}

produce an incorrect error message:

WrongError.scala: Expected token SEMI but got Token(ARROW,=>,119,=>)

Expected behavior:

provide proper error message sth like
WrongError.scala: Expected token SEMI but got Token(RPAREN,),119,))

In the following situation:

class WrongError extends App {
  Map(
    "age of star HD 140283" -> 14.46,
    "age of Universe" -> 13.8,
  )
}

gives WrongError.scala: illegal start of simple expression: Token(RPAREN,),155,)) that correctly state problem but no line number.

Severity:

Because there is no line number and the error message is misleading it is hard to find the issue

Version

"org.scalastyle" % "scalastyle_2.12" % "1.0.0"
Scala 2.12.10
sbt 1.3.5
used by: "org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0"

Related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant