nhaarman / acorn

Mastering Android navigation :chipmunk:
https://nhaarman.github.io/acorn
Apache License 2.0
181 stars 7 forks source link

Lint checks for ViewProvidingScene #92

Open nhaarman opened 5 years ago

nhaarman commented 5 years ago

See https://github.com/nhaarman/Acorn-dev/pull/91#discussion_r236040859:

This could use a lint check: createViewController returns a ViewController instance, but a compile time check for V is not possible, see https://stackoverflow.com/questions/43790137/why-cant-type-parameter-in-kotlin-have-any-other-bounds-if-its-bounded-by-anot

The lint check could check Scenes implementing ViewControllerFactory and check whether the return type of createViewController also adheres to the Scene's Container type.

Also, a Lint check checking whether ViewProvidingScene is only used with Scenes can be created (https://github.com/nhaarman/Acorn-dev/pull/91#discussion_r236069477).