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.
1 parent 5cdf2d6 commit f108c9fCopy full SHA for f108c9f
tests/neg/main-functions2.scala
@@ -0,0 +1,11 @@
1
+object Test2 {
2
+ @main val x = 2 // error: @main annotation cannot be applied to value x
3
+}
4
+
5
+class Foo {
6
+ @main def f = () // error: method f cannot be a @main method since it cannot be accessed statically
7
8
9
+@main def g(x: Int*)(y: Int*) = () // error: varargs parameter of @main method must come last
10
11
+@main def h[T: util.FromString](x: T) = () // error: @main method cannot have type parameters
0 commit comments