The documentation of isSubType
claims that it should work when sub
is an instantiation of a generic type super
. However, the following example results in an internal error:
Source Code:
class Generic {
var x;
}
var inst = new owned Generic(10);
writeln(isSubType(inst.type, Generic));
Interestingly, the new isSubType
operators added in https://github.com/chapel-lang/chapel/pull/10865 do work still. This is a work-around for anyone else running into this for now:
class Generic {
var x;
}
var inst = new owned Generic(10);
writeln(inst.type < Generic); // true
Error message:
foo.chpl:6: internal error: the type of the actual argument 'Generic' is generic [resolution/callInfo.cpp:124]
Compile command:
chpl --devel genericType.chpl
chpl --version
: chpl version 1.19.0 pre-release (e7ff5aa3c7)
Sounds like it's probably the same source error as #11410. Hopefully the case that does work can help narrow that down, that's weird
@lydia-duncan - Thanks, I forgot to cross-reference that issue. I agree they are likely caused by the same problem.
I'm not sure when this was fixed but it seems to work now. I'll add a test for it in PR #13447 which resolves also #12130.