Skip to content

dart2js: Type assertions and casts fail for Polymer code #13955

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

Closed
rakudrama opened this issue Oct 9, 2013 · 8 comments
Closed

dart2js: Type assertions and casts fail for Polymer code #13955

rakudrama opened this issue Oct 9, 2013 · 8 comments
Assignees
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js
Milestone

Comments

@rakudrama
Copy link
Member

This problem is blocking polymer integration with web components.

class Observable {}
class ObservableMixin implements Observable {}
class HtmlElement native ... {}
class PolymerElement extends HtmlElement with ObservableMixin {}

This check fails:

    p = ... // a PolymerElement
    ...
    Observable o = p;

The way to fix this is to fix Issue #9732 - all type checking code takes an interceptor with the argument, and the optimizer can specialize or remove the interceptor where appropriate.

@kasperl
Copy link

kasperl commented Oct 10, 2013

Added Triaged label.

@kasperl
Copy link

kasperl commented Oct 16, 2013

Are you looking into fixing this, Stephen?


Set owner to @rakudrama.

@rakudrama
Copy link
Member Author

r28471 is a work-around by always forcing the interceptor variant.

What really needs to happen is to pass the interceptor for the tested argument in to all the checked mode and cast helpers so that getInterceptor happens at most once.
I believe we already did this for HIs instructions.

@kasperl
Copy link

kasperl commented Oct 17, 2013

So for now, this issue isn't blocking. Lowering priority.


Removed Priority-Critical label.
Added Priority-High label.

@rakudrama
Copy link
Member Author

Kasper: This issue is blocked on Issue #9732 but that is marked Priority-Medium Milestone-Later.
Do you think someone (Johnni / Karl / Nicolas) should fix 9732 for M8 or this issue should be downgraded a little?


cc @kasperl.

@DartBot
Copy link

DartBot commented Oct 30, 2013

This comment was originally written by [email protected]


Passing getInterceptor to the helpers is an optimization we don't need to 'fix' the workaround. After talking to Johnni and Karl, we can fix the workaround by checking if a type is implemented by a native type.


Unmarked this as being blocked by #9732.

@kasperl
Copy link

kasperl commented Jun 4, 2014

Removed this from the M8 milestone.
Added this to the 1.6 milestone.

@rakudrama
Copy link
Member Author

The type assertions have been worked-around.

I don't plan to do the optimization of hoisting the getInterceptor call.
I believe the best way forward with this is to replace all types with (cached, hash-consed) instances of RuntimeType https://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/sdk/lib/_internal/lib/js_helper.dart?spec=svn30932&r=30932#­2038


Added NotPlanned label.

@rakudrama rakudrama added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js closed-not-planned Closed as we don't intend to take action on the reported issue labels Jul 9, 2014
@rakudrama rakudrama self-assigned this Jul 9, 2014
@rakudrama rakudrama added this to the 1.6 milestone Jul 9, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js
Projects
None yet
Development

No branches or pull requests

3 participants