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

REPL checks for fatal parse warnings #7482

Merged
merged 1 commit into from
Dec 4, 2018
Merged

Conversation

som-snytt
Copy link
Contributor

Previously, user input was re-parsed embedded in a template.
Also strip the marker for extended explanations.

scala> List(1) map (42 +) ; List(1) map (42 +)
                       ^
       error: postfix operator + needs to be enabled
       by making the implicit value scala.language.postfixOps visible.
       This can be achieved by adding the import clause 'import
scala.language.postfixOps'
       or by setting the compiler option -language:postfixOps.
       See the Scaladoc for value scala.language.postfixOps for a
discussion
       why the feature needs to be explicitly enabled.
                                            ^
       error: postfix operator + needs to be enabled
       by making the implicit value scala.language.postfixOps visible.

scala> def f() { }
               ^
       warning: procedure syntax is deprecated: instead, add `: Unit =`
to explicitly declare `f`'s return type
error: No warnings can be incurred under -Xfatal-warnings.

scala>

Fixes scala/bug#11278

Previously, user input was re-parsed embedded in a template.
Also strip the marker for extended explanations.

```
scala> List(1) map (42 +) ; List(1) map (42 +)
                       ^
       error: postfix operator + needs to be enabled
       by making the implicit value scala.language.postfixOps visible.
       This can be achieved by adding the import clause 'import
scala.language.postfixOps'
       or by setting the compiler option -language:postfixOps.
       See the Scaladoc for value scala.language.postfixOps for a
discussion
       why the feature needs to be explicitly enabled.
                                            ^
       error: postfix operator + needs to be enabled
       by making the implicit value scala.language.postfixOps visible.

scala> def f() { }
               ^
       warning: procedure syntax is deprecated: instead, add `: Unit =`
to explicitly declare `f`'s return type
error: No warnings can be incurred under -Xfatal-warnings.

scala>
```
@scala-jenkins scala-jenkins added this to the 2.13.0-RC1 milestone Dec 1, 2018
@SethTisue
Copy link
Member

merging, because not having this is driving my OCD crazy. hey REPL, I just used procedure syntax right inside you, and you're not arresting me?

@SethTisue SethTisue merged commit 853a519 into scala:2.13.x Dec 4, 2018
@som-snytt som-snytt deleted the issue/11278 branch December 4, 2018 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants