-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dart2js class check error #10383
Comments
I'm unable to repro this in either FF or Chrome, checked or unchecked. Stephen- any idea what might be causing this? cc @rakudrama. |
This comment was originally written by da...@altern.org Sorry, my simplified test case does not exhibit the same behavior. I will try to understand why. |
This comment was originally written by da...@altern.org Here is a modified test case - I just checked this returns false in Firefox when text is typed in the input. h.TextInputElement input = new h.TextInputElement(); I guess dart2js forgets the class when the context changes... |
Very interesting. Simplified repro: void main() { prints: Removed Area-HTML label. |
tl;dr: TypeMask bug? It gets stranger. JS("Element", "document.createElement(#)", tag); i.e. The inferred type of variable "input" should be subtype(Element) or subclass(Element). The closed-over test is constant-folded to false. $.main = function() { $$.main_anon = {"": "Closure;input_0", I think this is a bug with TypeMask causing wrong constant-folding of is-checks. [null|subclass=Element].intersection([subtype=TextInputElement], compiler).isEmpty = true The classes are roughly as follows, which puts InputElement in the intersection, but I failed to make a simple repro. class Element {} Set owner to @kasperl. |
Hmm. The missing piece of information here is that TextInputElement indirectly implements Element. That seems to throw off the intersection code in type mask. It certainly does look like a bug in the implementation of TypeMask.intersection. |
Added Accepted label. |
Fixed in r22412. Added Fixed label. |
This comment was originally written by da...@altern.org Not sure if it's related, but now (control is TextInputElement) is true for a CheckboxInputElement (with Dart VM) (Dart SDK 0.6.9.2-r25388) |
damieng- this is by design, a side-effect of how these types are implemented. They are all actually InputElements. |
This issue was originally filed by da...@altern.org
What steps will reproduce the problem?
Try the following code:
h.TextInputElement input = new h.TextInputElement();
h.Element control = input;
print(control is h.TextInputElement);
What is the expected output? What do you see instead?
I expect to get 'true'. With Dartium, I get 'true'. With Javascript, I get 'false'.
What version of the product are you using? On what operating system?
Dart SDK 0.5.3.0_r22223. I tried several web browsers and OS.
Please provide any additional information below.
I thought this was working before ?
The text was updated successfully, but these errors were encountered: