cushon / issues-import

0 stars 0 forks source link

Warn on static-importing the same name from two different classes? #258

Open cushon opened 9 years ago

cushon commented 9 years ago

Original issue created by kevinb@google.com on 2014-07-21 at 07:20 PM


We just discovered that you can static-import a method of the same name from two different classes!

import static foo.Bar.what; import static baz.Qux.what;

Then when you reference what(), I'm not clear on what happens but it must have to implement overload resolution across the two sets of methods!?

This seems pretty evil and obviously can lead to confusion (I see a call to what(), I see one of the static imports, I assume I know what's what(), but I don't).

It seems certainly worth at least a warning. And the remedy I would suggest is... make them explicitly qualify both of them?

cushon commented 9 years ago

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


We agree that this seems terrible. Perhaps a warning?


Status: Accepted