Open gavinking opened 8 years ago
It looks like this is happening because I have a List<JavaType<Foo>.Bar>
where, of course, Foo
is not known at runtime because JavaType
doesn't have reified type arguments.
@FroMage could you take a look at this please?
What's a tuple doing in this story then? You have a tuple of lists?
The tuple is the instance of List.
Is JavaType.Bar
static or not?
@FroMage Yes, it is.
Oh, that explains it: I recently started sticking UnknownType
s as type arguments to qualifying types of Java static
inner types.
I didn't do that before.
And I started ignoring them, but not everywhere yet.
I can't reproduce it yet, with:
value t1 = [JavaClass<String>.StaticMemberNoParam()];
for(t in t1){
print(t);
}
value t2 = [JavaClass.StaticMemberNoParam()];
for(t in t2){
print(t);
}
The other wrinkle is I was using an alias for the type JavaClass.StaticMemberNoParam
.
Oh, wait, the compiler probably optimizes iteration of tuples. Use:
List<JavaClass.StaticMemberNoParam> t1 = [JavaClass.StaticMemberNoParam()];
In fact the case I have is this:
List<JavaClass<Anything>.StaticMemberNoParam> t1 = [JavaClass<Anything>.StaticMemberNoParam()];
I don't know where precisely the UnknownType
comes from. The typechecker must throw away the type argument because the qualified type is static
.
Interestingly, this produces a typechecker error:
List<JavaClass.StaticMemberNoParam> t2 = [JavaClass.StaticMemberNoParam()];
for(t in t2){ // ERROR:could not determine type of function or value reference: 't2'
print(t);// ERROR:could not determine type of function or value reference: 't'
}
That I don't think are correct.
@FroMage yep, just noticed, see #6684.
So any luck in getting me a reproductible test?
If not, I'll move to 1.3.2.
Well, I can't seem to reproduce this anymore, so perhaps it's fixed itself. Closing.
It happened again in IntelliJ. It looks like the error is triggered during code completion, I'm not sure how to reproduce it systematically though :(