Collide traits only on same level

This commit is contained in:
Jindra Petřík
2016-09-17 14:56:09 +02:00
parent 8a0223a02a
commit 9bb7c01bc8
2 changed files with 2 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ public class ConstVarNameMultinameUsage extends ConstVarMultinameUsage implement
public boolean collides(MultinameUsage other) {
if ((other instanceof ConstVarNameMultinameUsage) || (other instanceof MethodNameMultinameUsage)) {
TraitMultinameUsage otherTrait = (TraitMultinameUsage) other;
if (otherTrait.classIndex == classIndex && otherTrait.traitsType == traitsType) {
if (otherTrait.classIndex == classIndex && otherTrait.traitsType == traitsType && otherTrait.parentTraitIndex == parentTraitIndex) {
if (other.sameMultinameName(this)) {
return true;
}

View File

@@ -38,7 +38,7 @@ public class MethodNameMultinameUsage extends MethodMultinameUsage implements De
public boolean collides(MultinameUsage other) {
if ((other instanceof MethodNameMultinameUsage) || (other instanceof ConstVarNameMultinameUsage)) {
TraitMultinameUsage otherTrait = (TraitMultinameUsage) other;
if (otherTrait.classIndex == classIndex && otherTrait.traitsType == traitsType) {
if (otherTrait.classIndex == classIndex && otherTrait.traitsType == traitsType && otherTrait.parentTraitIndex == parentTraitIndex) {
if (other.sameMultinameName(this)) {
return true;
}