You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens if a scala trait that doesn't extend a vanilla class declares a method with the same name as something in a vanilla class, then a class mixes this trait with that class, for example:
trait A {
def getWorldObj: World
}
class B extends TileEntity with A
object C {
def foo(p: A) = p.getWorldObj
def bar(p: B) = p.getWorldObj
}
This compiles and works correctly in an unobfuscated environment.
After reobfuscation C.bar gets changed to the obfuscated name as expected
Same thing can also happen in java (though i guess it's less common to do something like that without mixins)
public interface A {
World getWorldObj();
}
public class B extends TileEntity implements A {
}
public class C {
static World foo(A p) {
return p.getWorldObj();
}
static World foo(B p) {
return p.getWorldObj();
}
}
Gives exactly the same result.
I'm not even sure how this can be fixed, creating a synthetic bridge method during reobfuscation? Would that be possible or even be a good idea?
The text was updated successfully, but these errors were encountered:
This happens if a scala trait that doesn't extend a vanilla class declares a method with the same name as something in a vanilla class, then a class mixes this trait with that class, for example:
This compiles and works correctly in an unobfuscated environment.
After reobfuscation C.bar gets changed to the obfuscated name as expected
But the interface and C.foo still refers to the unobfuscated name
And a call to C.foo will crash with
I made a minimal project to demonstrate the issue - it will crash in PreInit when running in an obfuscated environment.
Same thing can also happen in java (though i guess it's less common to do something like that without mixins)
Gives exactly the same result.
I'm not even sure how this can be fixed, creating a synthetic bridge method during reobfuscation? Would that be possible or even be a good idea?
The text was updated successfully, but these errors were encountered: