-
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
6 changed files
with
76 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
matcher_1.scala:8: warning: match may not be exhaustive. | ||
It would fail on the following input: ORANGE | ||
jb match { | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
1 warning | ||
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,16 @@ | ||
|
||
public enum JetBrains { | ||
APPLE { | ||
public enum Leaves { | ||
A,B,C; | ||
} | ||
@Override public String text() { | ||
return "Cupertino tech company"; | ||
} | ||
}, | ||
ORANGE | ||
; | ||
public String text() { | ||
return "Boring default"; | ||
} | ||
} |
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 -Xsource:3 | ||
|
||
import JetBrains.* | ||
|
||
class C { | ||
def f(jb: JetBrains): Int = | ||
jb match { | ||
case APPLE => 42 | ||
} | ||
} |
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,17 @@ | ||
|
||
public enum JetBrains { | ||
APPLE { | ||
public enum Leaves { | ||
A,B,C; | ||
} | ||
@Override public String text() { | ||
return "Cupertino tech company"; | ||
} | ||
}, | ||
ORANGE { | ||
@Override public String text() { | ||
return "SoCal county"; | ||
} | ||
}; | ||
public abstract String text(); | ||
} |
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,12 @@ | ||
|
||
// scalac: -Werror -Xsource:3 | ||
|
||
import JetBrains.* | ||
|
||
class C { | ||
def f(jb: JetBrains): Int = | ||
jb match { | ||
case APPLE => 42 | ||
case ORANGE => 27 | ||
} | ||
} |