Chapel: Internal error when using isSubType on generic type

Created on 23 Jan 2019  路  3Comments  路  Source: chapel-lang/chapel

Summary of Problem

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:

Steps to Reproduce

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

Configuration Information

  • Output of chpl --version: chpl version 1.19.0 pre-release (e7ff5aa3c7)
Compiler Bug

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings