the following code

class A{
Integer b[][];

void m(){
b;
}
}

will produce:

Field(Id(“b”)){
Type(
ClassType(
TypeName(
PackageName([Id(“java”), Id(“lang”)])
, Id(“Integer”)
)
, None()
)
)
, DeclaringClass(TypeName(PackageName([]), Id(“A”)))
}

instead of:

Field(Id(“b”)){
Type(
ArrayType(
ArrayType(
ClassType(
TypeName(
PackageName([Id(“java”), Id(“lang”)])
, Id(“Integer”)
)
, None()
)
)
)
)
, DeclaringClass(TypeName(PackageName([]), Id(“A”)))
}

I think the problem can be solve by handle that kind of variable declaration VarDec(ArrayVarDecId(Id(“b”), [Dim(), Dim()])) in “dryad/type-check/Main : dryad-tc-declare-var”.

Submitted on 27 September 2006 at 15:28

On 27 September 2006 at 22:46 Jira commented:

DRY-241, martin:

This is a bit tricky: these days the get-type method of fields is used, so the proper place to implement this is get-type.

Test I will use:

class Foo {
int[] x;
int y[];
int[] z[];

Object f(){
return x;
}

Object g(){
return y;
}

Object h(){
return z;
}
}

Log in to post comments