diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-09-18 14:53:48 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-09-18 14:53:48 -0700 |
commit | b0a4d536482c6582bafb383a30f553862aceb00f (patch) | |
tree | ca860a5fd26ad363d4fa8cfb7386b4237513d658 /src | |
parent | afef5fea6e2de37344a80a01840ec3c2faef7530 (diff) | |
parent | 7e766a0e6a4cd758ff7a4300bf1064bc2745e35b (diff) | |
download | scala-b0a4d536482c6582bafb383a30f553862aceb00f.tar.gz scala-b0a4d536482c6582bafb383a30f553862aceb00f.tar.bz2 scala-b0a4d536482c6582bafb383a30f553862aceb00f.zip |
Merge pull request #1341 from rkuhn/document-App-RK
clarify caveats of App trait
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/App.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/library/scala/App.scala b/src/library/scala/App.scala index 85d2f9075e..a1e5e74e2f 100644 --- a/src/library/scala/App.scala +++ b/src/library/scala/App.scala @@ -22,6 +22,16 @@ import scala.collection.mutable.ListBuffer * * `args` returns the current command line arguments as an array. * + * ==Caveats== + * + * '''''It should be noted that this trait is implemented using the [[DelayedInit]] + * functionality, which means that fields of the object will not have been initialized + * before the main method has been executed.''''' + * + * It should also be noted that the `main` method will not normally need to be overridden: + * the purpose is to turn the whole class body into the “main method”. You should only + * chose to override it if you know what you are doing. + * * @author Martin Odersky * @version 2.1, 15/02/2011 */ |