Skip to content

Commit b0a4d53

Browse files
committed
Merge pull request scala#1341 from rkuhn/document-App-RK
clarify caveats of App trait
2 parents afef5fe + 7e766a0 commit b0a4d53

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/library/scala/App.scala

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ import scala.collection.mutable.ListBuffer
2222
*
2323
* `args` returns the current command line arguments as an array.
2424
*
25+
* ==Caveats==
26+
*
27+
* '''''It should be noted that this trait is implemented using the [[DelayedInit]]
28+
* functionality, which means that fields of the object will not have been initialized
29+
* before the main method has been executed.'''''
30+
*
31+
* It should also be noted that the `main` method will not normally need to be overridden:
32+
* the purpose is to turn the whole class body into the “main method”. You should only
33+
* chose to override it if you know what you are doing.
34+
*
2535
* @author Martin Odersky
2636
* @version 2.1, 15/02/2011
2737
*/

0 commit comments

Comments
 (0)