Java: IntelliJ idea generated code incorrectly prefixing all Class designations with their Package name -
i have package 'world', containing class 'world' , class 'tile'. class world contains array of tiles. when use idea's generate constructor function, produces constructor this:
world(int width, int height, world.tile[][] terrain) { this.width = width; this.height = height; this.terrain = terrain; }
it highlights "tile" red , says can't find symbol. when remove "world." works expected.
what've screwed here? i'm running new installation of idea , i've never had issue before, don't think changed should causing this. apologies if has been asked before tried searching every permutation of words think of!
world class before constructor added:
package world; public final class world { private final int width; private final int height; private final tile[][] terrain; }
obicere's comment:
the world class shadowing world package. standard, why use lowercase packages , upper-camel-cased class names.
package names can shadow class names--use lowercase package names!
Comments
Post a Comment