Closed
Bug 511778
Opened 16 years ago
Closed 15 years ago
class Object { static function init () ... } is too visible
Categories
(Tamarin Graveyard :: Virtual Machine, defect)
Tamarin Graveyard
Virtual Machine
Tracking
(Not tracked)
VERIFIED
FIXED
Future
People
(Reporter: jodyer, Assigned: lhansen)
References
Details
(Whiteboard: Has patch)
Attachments
(1 file)
624 bytes,
patch
|
jodyer
:
review+
|
Details | Diff | Splinter Review |
it is visible to code in all classes defined in the unnamed package, and so either shadows outer bindings named 'init' or masks mis-spellings of 'init'.
An obvious solution is to put 'init' into a hidden namespace, but there are probably others that should be considered (like restructuring the code to avoid the need for a static method for initialization).
Jd
Assignee | ||
Updated•16 years ago
|
Target Milestone: --- → Future
Comment 1•15 years ago
|
||
This has a bit of impact on Flash Builder users -- whenever they bring up code hints for "this" for any class, they will see init() as one of the possible completions, even if the class doesn't have an init() function; this is potentially a little confusing.
Comment 2•15 years ago
|
||
Krzysztof was bitten by this on Friday. He had some code that looked something like this (this is from memory):
// init.as
package {
public namespace init = "http://example.com";
}
// MyClass.as
package {
public class MyClass {
use namespace init;
....
public function foo():void {
foo.init::bar = 3;
}
}
}
He kept getting strange compile-time error messages; when I took a look, I remembered this bug, and told him to rename his namespace "init" to something else, and that fixed it.
Assignee | ||
Comment 4•15 years ago
|
||
Simplest test case - this should print 'undefined':
package {
print(Object.init);
}
Assignee | ||
Comment 5•15 years ago
|
||
Not for review yet, but once bug #559994 lands this will be roughly the right fix for the present bug.
Assignee | ||
Updated•15 years ago
|
Status: NEW → ASSIGNED
Whiteboard: Has patch
Assignee | ||
Updated•15 years ago
|
Attachment #440031 -
Flags: review?(jodyer)
Attachment #440031 -
Flags: review?(jodyer) → review+
Assignee | ||
Comment 6•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•