Bug. The following code doesn't compile if the type alias ta
is used, but does compile if you hard-code ta
into the class. C
stores G(D)
objects so it isn't quite recursive with D
.
Source Code:
// I was using LinkedList, but any generic will do.
class G { type t; }
type ta = G(D);
class C {
var x: ta; // error: unable to resolve type
/* var x: G(D); // Ok. */
}
class D {
var y: C;
}
proc main() {
var c = new owned C();
}
chpl version 1.19.0
Huh... Do any of our initializer or resolution gurus know why this would be different than a top-level variable (which works)? @benharsh, @lydia-duncan, @mppf?
I coulda sworn I'd written a test specifically to lock in that it worked, but I'm not finding it quickly. Seems likely to be related to having to resolve what ta
is, and maybe information about the type didn't get propagated correctly during normalize
I think it has something to do with the somewhat cyclic nature of the classes. If I change D.y
to be of type int
, it compiles.
Most helpful comment
I think it has something to do with the somewhat cyclic nature of the classes. If I change
D.y
to be of typeint
, it compiles.