Skip to content

Commit 51adb13

Browse files
authored
Add experimental.packageObjectValues language setting (#23001)
By an ovsersight this was available only as a language import. Fixes #22830
2 parents 05b102a + b6257dd commit 51adb13

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

compiler/src/dotty/tools/dotc/config/Feature.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ object Feature:
6161
(pureFunctions, "Enable pure functions for capture checking"),
6262
(captureChecking, "Enable experimental capture checking"),
6363
(into, "Allow into modifier on parameter types"),
64-
(modularity, "Enable experimental modularity features")
64+
(modularity, "Enable experimental modularity features"),
65+
(packageObjectValues, "Enable experimental package objects as values"),
6566
)
6667

6768
// legacy language features from Scala 2 that are no longer supported.

tests/pos/packageObjectValues.scala

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//> using options -language:experimental.packageObjectValues
2+
3+
package object p { }
4+
5+
object Test:
6+
val x = p
7+

0 commit comments

Comments
 (0)