External Issue: isSubtype() returns false when parent class is generic

17572, "AsianIntel", "isSubtype() returns false when parent class is generic", "2021-04-15T18:26:54Z"

Summary of Problem

While working on a library, I seem to have encountered an issue where the isSubtype function returns false when the parent class is generic. The expectation is it should be returning true.

Steps to Reproduce

Source Code:

class GenericParentClass {
  type t;

  proc init(type t) {
    this.t = t;
  }
}
class ChildClass: GenericParentClass {}

class ParentClass {}
class ChildClass2: ParentClass {}

writeln(isSubtype(ChildClass, GenericParentClass)); // -> returns false
writeln(isSubtype(ChildClass2, ParentClass)); // -> returns true (as expected)

Compile command:
chpl test.chpl

Execution command:
./test

Configuration Information

  • Output of chpl --version: chpl version 1.24.0
  • Output of $CHPL_HOME/util/printchplenv --anonymize:
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: gnu
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_GMP: bundled
CHPL_HWLOC: bundled
CHPL_REGEXP: re2
CHPL_LLVM: none
CHPL_AUX_FILESYS: none