-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
60 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/compiler/scala/tools/nsc/transform/patmat/package.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Scala (https://www.scala-lang.org) | ||
* | ||
* Copyright EPFL and Lightbend, Inc. | ||
* | ||
* Licensed under Apache License 2.0 | ||
* (http://www.apache.org/licenses/LICENSE-2.0). | ||
* | ||
* See the NOTICE file distributed with this work for | ||
* additional information regarding copyright ownership. | ||
*/ | ||
|
||
package scala.tools.nsc.transform | ||
|
||
import scala.reflect.internal.Symbols | ||
|
||
package object patmat { | ||
private[patmat] implicit class `symbol helpers`(val symbol: Symbols#Symbol) extends AnyVal { | ||
|
||
//def isAbstractClassOrEnum: Boolean = symbol.isAbstractClass || symbol.hasJavaEnumFlag | ||
//def isSealedOrEnum: Boolean = symbol.isSealed || symbol.hasJavaEnumFlag | ||
// Distinguish the Enum<T> class from its instances, which are also marked as JAVA_ENUM. | ||
def isSealedEnum: Boolean = symbol.isSealed && symbol.hasJavaEnumFlag | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// scalac: -Xfatal-warnings | ||
// scalac: -Werror | ||
// | ||
import java.lang.Thread.State | ||
import java.lang.Thread.State._ | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
test/files/neg/t8700b-old.check → test/files/neg/t8700b.check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
Bar_2.scala:4: warning: match may not be exhaustive. | ||
It would fail on the following input: B | ||
def bar1(foo: Foo_1) = foo match { | ||
^ | ||
def bar1(foo: Foo) = foo match { | ||
^ | ||
Bar_2.scala:8: warning: match may not be exhaustive. | ||
It would fail on the following input: B | ||
def bar2(foo: Baz_1) = foo match { | ||
^ | ||
def bar2(foo: Baz) = foo match { | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
2 warnings | ||
1 error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// scalac: -Werror | ||
// | ||
object Bar { | ||
def bar1(foo: Foo) = foo match { | ||
case Foo.A => 1 | ||
} | ||
|
||
def bar2(foo: Baz) = foo match { | ||
case Baz.A => 1 | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
test/files/neg/t8700b-old/Baz_1.java → test/files/neg/t8700b/Baz.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
// javaVersion: 8 | ||
public enum Baz_1 { | ||
public enum Baz { | ||
A { | ||
public void baz1() {} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
public enum Foo { | ||
A, | ||
B | ||
} |