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
Track dart:* origin of names in order to resolve conflicts #17634
Comments
Florian has been working on this today (and can repro locally). Set owner to @fsc8000. |
There are two conflicting "Animation" classes in the system coming from different places: One from angular.animate, the other from dart.dom.html. Two issues here: The VM does not report the name conflict, the other issue is where the other Animation class from dart:html comes from. |
The following "fix" made the problem disappear: I don't know yet where the dart.dom.html.Animation comes from. diff --git a/test/_specs.dart b/test/_specs.dart --- a/test/_specs.dart Removed Area-VM label. |
fwiw Animation comes from ./third_party/WebKit/Source/core/animation/Animation.idl. This interface appeared after we rolled Dartium forward to M34, it was not there before. |
Yes, that type was added in M34. I thought type from user libs took precedence exactly for this reason. I.e., from the spec: "If a name N is referenced by a library L and N would be introduced into the top level scope of L by an import from a library whose URI begins with dart: and an import from a library whose URI does not begin with dart:: This suggests that the explicit hide Florian added should be unnecessary. cc @blois. |
Regarding comment #5: |
The problem is "an import from a library whose URI begins with dart:" In this case dart:html is being exported, so the import that contains Animation is not a dart: import. To guard against breaking changes here the logic would have to be that types originating from dart SDK libraries are shadowed rather than types introduced via dart: imports. |
Kasper, to be clear what you want is that a name which originates in dart:* libraries, however circuitous, is hidden automatically behind the users back in case of conflicts. Is that correct? cc @mhausner. |
The intent is that we can add things to a dart:* library without causing a conflict with something from a user library. To achieve this we need to make sure it works through arbitrary re-exports, so your interpretation of what the spec requires (aka what I want) is correct. |
This issue was originally filed by Misko.H...@gmail.com
See exception here: https://travis-ci.org/angular/angular.dart/jobs/21104418#L719
Caught type 'CssAnimation' is not a subtype of type 'Animation' of 'animation'.
The code which caused the issue is:
https://github.com/angular/angular.dart/blob/master/test/animate/css_animate_spec.dart#L114
play(Animation animation) {
animations.add(animation);
}
The error says that play method is being called with CssAnimation and we expect Animation Instead.
CssAnimation is declared at: https://github.com/angular/angular.dart/blob/master/lib/animate/css_animation.dart#L9
class CssAnimation extends LoopedAnimation {
...
}
LoopedAnimation is declared at: https://github.com/angular/angular.dart/blob/master/lib/animate/animations.dart#L9
abstract class LoopedAnimation implements Animation {
...
}
Therefor CssAnimation does implement Animation and should therefore pass the type check.
This is a regression since the test fails on version 1.3.0-dev.4.1 but passes on 1.2.0
The text was updated successfully, but these errors were encountered: