We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
main
1 parent 29deb05 commit ef4888bCopy full SHA for ef4888b
compiler/src/dotty/tools/dotc/typer/Namer.scala
@@ -1257,7 +1257,9 @@ class Namer { typer: Typer =>
1257
forwarder.addAnnotations(sym.annotations.filterConserve { annot =>
1258
annot.symbol != defn.BodyAnnot
1259
&& annot.symbol != defn.TailrecAnnot
1260
+ && annot.symbol != defn.MainAnnot
1261
&& !annot.symbol.derivesFrom(defn.MacroAnnotationClass)
1262
+ && !annot.symbol.derivesFrom(defn.MainAnnotationClass)
1263
})
1264
1265
if forwarder.isType then
tests/pos/export-main.scala
@@ -0,0 +1,5 @@
1
+object Foo:
2
+ @main def baz: Int = 1
3
+
4
+object Bar:
5
+ export Foo.baz // export Foo.baz but not create an new main entry point
0 commit comments