-
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.
check if package names will be encoded in desugar
produce a warning if they are - this is because encoding a package name is mostly undefined behaviour that the scala 3 compiler magically recovers from - but could be problematic.
- Loading branch information
1 parent
d57a4a4
commit d7e4cfa
Showing
5 changed files
with
63 additions
and
7 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
16 changes: 16 additions & 0 deletions
16
tests/neg-custom-args/fatal-warnings/symbolic-packages.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- Error: tests/neg-custom-args/fatal-warnings/symbolic-packages.scala:1:8 --------------------------------------------- | ||
1 |package `with spaces` { // error | ||
| ^^^^^^^^^^^^^ | ||
| The package name `with spaces` will be encoded on the classpath, and can lead to undefined behaviour. | ||
-- Error: tests/neg-custom-args/fatal-warnings/symbolic-packages.scala:5:10 -------------------------------------------- | ||
5 |package +.* { // error // error | ||
| ^ | ||
| The package name `*` will be encoded on the classpath, and can lead to undefined behaviour. | ||
-- Error: tests/neg-custom-args/fatal-warnings/symbolic-packages.scala:5:8 --------------------------------------------- | ||
5 |package +.* { // error // error | ||
| ^ | ||
| The package name `+` will be encoded on the classpath, and can lead to undefined behaviour. | ||
-- Error: tests/neg-custom-args/fatal-warnings/symbolic-packages.scala:9:16 -------------------------------------------- | ||
9 |package object `mixed_*` { // error | ||
| ^^^^^^^ | ||
| The package name `mixed_*` will be encoded on the classpath, and can lead to undefined behaviour. |
11 changes: 11 additions & 0 deletions
11
tests/neg-custom-args/fatal-warnings/symbolic-packages.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,11 @@ | ||
package `with spaces` { // error | ||
class Foo | ||
} | ||
|
||
package +.* { // error // error | ||
class Bar | ||
} | ||
|
||
package object `mixed_*` { // error | ||
class Baz | ||
} |
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 @@ | ||
def foo = 23 | ||
val bar = foo | ||
var baz = bar | ||
type Qux = Int |