diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-02 11:48:22 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-01-09 21:31:45 -0800 |
commit | 2064372659156e2637eac4d092321818a30abb41 (patch) | |
tree | baa2394fadad02a6426c076f249f6856eeadeb4c /test/files/neg/t4749.scala | |
parent | 820491ed6376e9f8f8a8102387495113dce55444 (diff) | |
download | scala-2064372659156e2637eac4d092321818a30abb41.tar.gz scala-2064372659156e2637eac4d092321818a30abb41.tar.bz2 scala-2064372659156e2637eac4d092321818a30abb41.zip |
Better error reporting regarding main methods.
Now notices most things which look like main methods and says
something useful if they aren't usable as entry points.
Closes SI-4749.
Diffstat (limited to 'test/files/neg/t4749.scala')
-rw-r--r-- | test/files/neg/t4749.scala | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/files/neg/t4749.scala b/test/files/neg/t4749.scala new file mode 100644 index 0000000000..0973c36097 --- /dev/null +++ b/test/files/neg/t4749.scala @@ -0,0 +1,44 @@ +package bippy { + object Fail1 { + def main(args: Array[String]): Any = () + } + + object Fail2 { + def main[T](args: Array[String]): T = null.asInstanceOf[T] + } + + abstract class Bippy[T] { + def main(args: Array[String]): T = null.asInstanceOf[T] + } + object Fail3 extends Bippy[Unit] { } + + + object Fail4 { + def main(args: Array[String]): Unit = () + } + trait Fail4 { } + + object Fail5 extends Fail5 { } + class Fail5 { + def main(args: Array[String]): Unit = () + } + + object Fail6 { + def main(args: Array[String]): Unit = () + } + class Fail6 { + def main = "bippy" + } + + object Win1 { + def main(args: Array[String]): Unit = () + } + object Win2 extends Bippy[Unit] { + override def main(args: Array[String]): Unit = () + } + trait WinBippy[T] { + def main(args: Array[String]): T = null.asInstanceOf[T] + } + object Win3 extends WinBippy[Unit] { } +} + |