Again updated note on constructors.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3933 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-03-09 22:23:07 +00:00
parent 2f2ffdabbe
commit 13c0830908
+7 -2
View File
@@ -214,13 +214,18 @@ ActionScript
(like myArray.length) may actually be executing arbitrary code, possibly (like myArray.length) may actually be executing arbitrary code, possibly
creating many objects, each time. creating many objects, each time.
- Classes without a constructor cannot be instantiated. This is a runtime - <strike>Classes without a constructor cannot be instantiated. This is a
error (grraah!). There is a compiler option "-compiler.warn-no-constructor" runtime error (grraah!).</strike>
There is a compiler option "-compiler.warn-no-constructor"
but it generates a flotilla of warnings from standard classes in the flash but it generates a flotilla of warnings from standard classes in the flash
library, so it's slightly useless. library, so it's slightly useless.
***Update: What the heck. I noticed today that DSet has no constructor ***Update: What the heck. I noticed today that DSet has no constructor
and I've never had any trouble instantiating those. Why would not having and I've never had any trouble instantiating those. Why would not having
a constructor be an error for some classes and not others? Grraahh! a constructor be an error for some classes and not others? Grraahh!
***Update: The language spec says that a default (no arg) constructor
is created implicitely if one is not defined. Probably when I got
the error that a class had no constructor it was some sort of compiler
bug.
- Static initializers can be emulated: - Static initializers can be emulated:
public class A public class A