Resolve and highlighting in ambiguous single static imports fixed

This commit is contained in:
Roman Shevchenko
2011-05-31 16:07:06 +04:00
parent 47b7828d8c
commit 5a45068521
13 changed files with 329 additions and 193 deletions
@@ -1,3 +1,28 @@
import static x.Base2.f;
/*
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import x.Base1;
import static x.Base2.F;
import static x.Base2.m;
import static <error descr="Field 'IF' is ambiguous in a single static import">x.Base2.II.IF</error>;
class Usage {
void use() {
m(Base1.F); //Base1.m(int)
m(F); //Base2.m(float)
F.class.getName(); // Base2.F
m(<error descr="Reference to 'IF' is ambiguous, both 'field I1.IF' and 'field I2.IF' match">IF</error>);
}
}
@@ -1,5 +1,28 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package x;
public class Base1 {
public static void f() {}
}
public static final int F = 1;
public static void m(int i) { }
public static class F { }
public interface I1 {
int IF = 1;
}
public interface I2 {
float IF = 2.0f;
}
}
@@ -1,5 +1,23 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package x;
public class Base2 extends Base1 {
public static void f() {}
}
public static final float F = 2.0f;
public static void m(float f) { }
public static class F { }
public interface II extends I1, I2 { }
}