cushon / issues-import

0 stars 0 forks source link

Prohibit raw types when that type is also used generically. #253

Closed cushon closed 9 years ago

cushon commented 9 years ago

Original issue created by mazurak@google.com on 2014-05-13 at 01:18 AM


This has bitten me a few times recently: I've changed a class or interface to carry type parameters, and I've forgotten to add those type parameters in a few places. Often this triggers a type error, but not always, and it's led to some weird and frustrating runtime errors, especially combined with any reflection-heavy libraries, like Guice.

I'm personally of the opinion that ANY use of a raw type could be considered an error, but I understand that sometimes we all have to work with old code. I'm willing to declare than any use of Foo and Foo<Bar> within the same file, or even the same package, has no reason to exist now that Foo<?> is an option.

cushon commented 9 years ago

Original comment posted by eaftan@google.com on 2014-08-22 at 05:43 PM


We've been thinking about these rawtypes problems, and we feel that if we as a company really want to address these problems, we should probably do something principled and come up with a coherent plan, rather than addressing subproblems individually. I filed an internal bug and CCed you.


Status: WontFix