Skip to content
This repository was archived by the owner on Jun 20, 2019. It is now read-only.

Generics through inheritance are *still* unresolved #103

Closed
MichaelRFairhurst opened this issue Nov 30, 2016 · 1 comment
Closed

Generics through inheritance are *still* unresolved #103

MichaelRFairhurst opened this issue Nov 30, 2016 · 1 comment

Comments

@MichaelRFairhurst
Copy link
Contributor

MichaelRFairhurst commented Nov 30, 2016

Maybe call this a low-P1. We have a codebase where this is the third most numerous false error, but at this point even the third most common error is only comes up so often.

class Generic<T> {
  T something;
}

@Component(...)
class Component extends Generic {
}

Using Component in a template yields errors

<comp [something]="5">...

Type int is not assignable to T.

T is an internal type to Generic, and has no business being used in the template typechecker. It should be resolved to bounds (in this case dynamic since there are no bounds) and inherited constraints before being typechecked.

MichaelRFairhurst added a commit to MichaelRFairhurst/angular2-dart-analyzer that referenced this issue Nov 30, 2016
Move to a class-instantiation paradigm; instantiate the type to bounds
before building the component (still using custom instantiation logic
while issue dart-archive#91 is blocked), and use that to resolve getters/setters up
the inheritance tree.

No change to the @input() and @output() workflows because those don't
involve inheritance.
MichaelRFairhurst added a commit that referenced this issue Dec 1, 2016
* Solve issue #103 generic inherited types still unresolved

Move to a class-instantiation paradigm; instantiate the type to bounds
before building the component (still using custom instantiation logic
while issue #91 is blocked), and use that to resolve getters/setters up
the inheritance tree.

No change to the @input() and @output() workflows because those don't
involve inheritance.

* no longer pass classElement everywhere
@MichaelRFairhurst
Copy link
Contributor Author

Merged PR #111

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant