Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

DDC+-dev.3.0: '_Future' is not a subtype of ... #913

Closed
matanlurey opened this issue Feb 22, 2018 · 3 comments
Closed

DDC+-dev.3.0: '_Future' is not a subtype of ... #913

matanlurey opened this issue Feb 22, 2018 · 3 comments

Comments

@matanlurey
Copy link
Contributor

matanlurey commented Feb 22, 2018

'_Future' is not a subtype of type 'Future<ComponentRef<TestWithNullComponent>>'

This is blocking DDC-dev.30, and Dart2.

Code:

https://github.com/dart-lang/angular/blob/f55fea736cb25040be640e75541acfbcd34e0329/angular/lib/src/core/linker/component_factory.dart#L62-L93

Notably, we can't just unsafeCast ComponentRef<dynamic>:

https://github.com/dart-lang/angular/blob/f55fea736cb25040be640e75541acfbcd34e0329/angular/lib/src/core/linker/component_factory.dart#L88-L91

... because it is an an AppView<dynamic>, not an AppView<T>.

This violates our contract. We have a couple of options:

  • Always return a ComponentRef<dynamic>: We lose auto-complete/type-safety.
  • Add a .cast<E> method to ComponentRef and use it = extra work per load.
  • Try and get the _View{Name}Host to return <T> not <dynamic>.

The last one is the "right" thing to do, but likely not easy.

@matanlurey
Copy link
Contributor Author

@matanlurey matanlurey changed the title ComponentFactory<T>.create does not return ComponentRef<T> DDC+-dev.3.0: '_Future' is not a subtype of ... Feb 22, 2018
@matanlurey
Copy link
Contributor Author

OK, looks easier than expected to fix.

Looks like something related with type inference in DDC. I'll file a bug.

@matanlurey matanlurey self-assigned this Feb 22, 2018
@matanlurey
Copy link
Contributor Author

Nope, we just had a return type of dynamic instead of R. Fixing...

alorenzen pushed a commit that referenced this issue Feb 23, 2018
…ease(s).

Filed/updated a number of cleanup/refactor bugs while doing this:
* #908
* #916
* #915
* #844
* #914
* dart-lang/sdk#32284

Closes #913.

PiperOrigin-RevId: 186683475
alorenzen pushed a commit that referenced this issue Feb 24, 2018
…ease(s).

Filed/updated a number of cleanup/refactor bugs while doing this:
* #908
* #916
* #915
* #844
* #914
* dart-lang/sdk#32284

Closes #913.

PiperOrigin-RevId: 186683475
alorenzen pushed a commit that referenced this issue Feb 24, 2018
…ease(s).

Filed/updated a number of cleanup/refactor bugs while doing this:
* #908
* #916
* #915
* #844
* #914
* dart-lang/sdk#32284

Closes #913.

PiperOrigin-RevId: 186683475
alorenzen pushed a commit that referenced this issue Feb 24, 2018
…ease(s).

Filed/updated a number of cleanup/refactor bugs while doing this:
* #908
* #916
* #915
* #844
* #914
* dart-lang/sdk#32284

Closes #913.

PiperOrigin-RevId: 186683475
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant