You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.
If you use @deferred in a certain way (details pending), the following is emitted:
import'1539_nested_template_test.dart' deferred as deflib0;
classViewNestedTemplateTest0extendsAppView<deflib0.NestedTemplateTest> { ... }
That is illegal in Dart, resulting in:
[error] The deferred type 'deflib0.NestedTemplateTest' can't be used in a declaration, cast or type test
This is based, I believe, on trying to re-use existing import statements. We should not be treating deferred libraries as something usable for types. This might be trivial to fix, it might not, but it makes the usability of @deferred fairly brittle :(
The text was updated successfully, but these errors were encountered:
matanlurey
changed the title
View compiler references deferred libraries (illegally)
Better errors when mixing deferred/non-deferred components
Aug 9, 2018
matanlurey
changed the title
Better errors when mixing deferred/non-deferred components
Better errors when mixing deferred/non components
Aug 9, 2018
... components coming from the same library (i.e. import).
Mostly involved simplifying/refactoring the bit of `DartEmitter` that created a mapping of import prefixes to use. The old method tried to use one mapping for both deferred and non-deferred libraries; my new approach uses (the already created) separate mappings.
I put a bit of refactoring in to make the method(s) more understandable in the future, and a simple change to "path_util.dart" to compensate for how deferred modules are stored (importing themselves is possible).
Closes#1558.
Closes#1559.
PiperOrigin-RevId: 208234448
Ran into this while debugging #1539.
If you use
@deferred
in a certain way (details pending), the following is emitted:That is illegal in Dart, resulting in:
This is based, I believe, on trying to re-use existing import statements. We should not be treating deferred libraries as something usable for types. This might be trivial to fix, it might not, but it makes the usability of
@deferred
fairly brittle :(The text was updated successfully, but these errors were encountered: