Files
scriptc/tests
Chris Tate 3bbb88c43c Construct through arrays of class values that mix a class and its subclasses
`const kinds = [Dog, Cat, Animal]; new kinds[0]()` now works as in Node:

- TypeScript: the checker types the element as the common base
  (`typeof Animal`), and an element read keeps the `undefined` an index
  past the end reads. The construction now narrows the class value out of
  that union, and an index past the end throws Node's TypeError
  ("kinds[5] is not a constructor"). Before, it refused with SC2001.
- JavaScript: such a literal is a checked-dynamic array stored in a slot
  of the base's class values, and the check accepted only the base's own
  class value, so storing it threw "expected class constructor".
  A class value of a subclass now checks into its base class's slot, as a
  subclass instance already checks into a base-class instance slot.
  Classes without subclasses keep the exact check.
2026-10-22 16:51:25 -05:00
..
…
2026-10-20 17:56:44 -05:00