-
Notifications
You must be signed in to change notification settings - Fork 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
5 changed files
with
88 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- Error: tests/neg/export-in-extension.scala:14:13 -------------------------------------------------------------------- | ||
14 | export c1.* // error | ||
| ^^ | ||
| export qualifier c1 is not a parameterless companion extension method | ||
-- Error: tests/neg/export-in-extension.scala:19:22 -------------------------------------------------------------------- | ||
19 | export cm.{bar, D} // error | ||
| ^ | ||
| no eligible member D at O.O2.cm | ||
| O.O2.cm.D cannot be exported because it is a type, so it cannot be exported as extension method | ||
-- Error: tests/neg/export-in-extension.scala:20:18 -------------------------------------------------------------------- | ||
20 | export this.cm.baz // error | ||
| ^^^^^^^ | ||
| export qualifier must be a simple reference to a companion extension method | ||
-- Error: tests/neg/export-in-extension.scala:24:13 -------------------------------------------------------------------- | ||
24 | export missing.* // error | ||
| ^^^^^^^ | ||
| export qualifier missing is not a parameterless companion extension method | ||
-- Error: tests/neg/export-in-extension.scala:28:13 -------------------------------------------------------------------- | ||
28 | export cm.* // error | ||
| ^^ | ||
| export qualifier cm is not a parameterless companion extension method | ||
-- Error: tests/neg/export-in-extension.scala:33:13 -------------------------------------------------------------------- | ||
33 | export cm.* // error | ||
| ^^ | ||
| export qualifier cm is not a parameterless companion extension method | ||
-- Error: tests/neg/export-in-extension.scala:38:13 -------------------------------------------------------------------- | ||
38 | export cm.* // error | ||
| ^^^^^^^^^^^ | ||
| exports are only allowed from objects and classes |
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,40 @@ | ||
object O: | ||
|
||
class C(x: Int): | ||
def bar = x | ||
def baz(y: Int) = x + y | ||
val bam = x * x | ||
def :: (y: Int) = x - y | ||
class D | ||
|
||
val c1 = C(1) | ||
|
||
object O1: | ||
extension (x: Int) | ||
export c1.* // error | ||
|
||
object O2: | ||
extension (x: Int) | ||
private def cm = new C(x) | ||
export cm.{bar, D} // error | ||
export this.cm.baz // error | ||
|
||
object O3: | ||
extension (x: Int) | ||
export missing.* // error | ||
|
||
object O4: | ||
extension (x: Int) | ||
export cm.* // error | ||
|
||
object O5: | ||
extension (x: Int) | ||
private def cm(y: C) = C | ||
export cm.* // error | ||
|
||
{ | ||
extension (x: Int) | ||
private def cm = new C(x) | ||
export cm.* // 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