-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add message parameter to
@experimental
annotation
- Loading branch information
1 parent
6bb6b43
commit dbdfcff
Showing
16 changed files
with
125 additions
and
27 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
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
4 changes: 4 additions & 0 deletions
4
library/src-non-bootstrapped/scala/annotation/experimental.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,4 @@ | ||
package scala.annotation | ||
|
||
@deprecatedInheritance("Scheduled for being final in the future", "3.4.0") | ||
class experimental extends StaticAnnotation |
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
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,10 @@ | ||
|
||
-- Error: tests/neg/experimental-message-experimental-flag/Test_2.scala:3:10 ------------------------------------------- | ||
3 |def g() = f() // error | ||
| ^ | ||
| method f is marked @experimental: Added by -experimental | ||
| | ||
| Experimental definition may only be used under experimental mode: | ||
| 1. in a definition marked as @experimental, or | ||
| 2. compiling with the -experimental compiler flag, or | ||
| 3. with a nightly or snapshot version of the compiler. |
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,3 @@ | ||
//> using options -Yno-experimental -experimental | ||
|
||
def f() = ??? |
3 changes: 3 additions & 0 deletions
3
tests/neg/experimental-message-experimental-flag/Test_2.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,3 @@ | ||
//> using options -Yno-experimental | ||
|
||
def g() = f() // 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,27 @@ | ||
-- Error: tests/neg/experimental-message.scala:15:2 -------------------------------------------------------------------- | ||
15 | f1() // error | ||
| ^^ | ||
| method f1 is marked @experimental | ||
| | ||
| Experimental definition may only be used under experimental mode: | ||
| 1. in a definition marked as @experimental, or | ||
| 2. compiling with the -experimental compiler flag, or | ||
| 3. with a nightly or snapshot version of the compiler. | ||
-- Error: tests/neg/experimental-message.scala:16:2 -------------------------------------------------------------------- | ||
16 | f2() // error | ||
| ^^ | ||
| method f2 is marked @experimental | ||
| | ||
| Experimental definition may only be used under experimental mode: | ||
| 1. in a definition marked as @experimental, or | ||
| 2. compiling with the -experimental compiler flag, or | ||
| 3. with a nightly or snapshot version of the compiler. | ||
-- Error: tests/neg/experimental-message.scala:17:2 -------------------------------------------------------------------- | ||
17 | f3() // error | ||
| ^^ | ||
| method f3 is marked @experimental: not yet stable | ||
| | ||
| Experimental definition may only be used under experimental mode: | ||
| 1. in a definition marked as @experimental, or | ||
| 2. compiling with the -experimental compiler flag, or | ||
| 3. with a nightly or snapshot version of the compiler. |
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 @@ | ||
//> using options -Yno-experimental | ||
|
||
import scala.annotation.experimental | ||
|
||
@experimental | ||
def f1() = ??? | ||
|
||
@experimental() | ||
def f2() = ??? | ||
|
||
@experimental("not yet stable") | ||
def f3() = ??? | ||
|
||
def g() = | ||
f1() // error | ||
f2() // error | ||
f3() // 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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
-- Error: tests/neg/use-experimental-def.scala:7:15 -------------------------------------------------------------------- | ||
7 |def bar: Int = foo // error | ||
| ^^^ | ||
| method foo is marked @experimental | ||
| | ||
| Experimental definition may only be used under experimental mode: | ||
| 1. in a definition marked as @experimental, or | ||
| 2. compiling with the -experimental compiler flag, or | ||
| 3. with a nightly or snapshot version of the compiler. | ||
| | ||
| method foo is marked @experimental | ||
| |