Skip to content

Commit 925dcfc

Browse files
authored
fix(instanceof): a monomorphized generic class is an instance of its generic origin (#7575) (#7631)
The issue's diagnosis was wrong and so was the brief: not native-base wiring, not the CLASS_PROTOTYPE_OBJECTS split, not Map/Set. new MyMap<string,number>() constructs MyMap$str_num with its own class id while instanceof MyMap resolves the generic's id, which is in no parent chain. Proven by bisect: class GenPlain<T> {} with no Map and no base fails identically, while non-generic Bee extends A extends Map works. Adds Class::specialized_from -> js_register_class_generic_origin -> one shared depth-bounded class_chain_reaches (replacing two hand-rolled copies, one uncapped) that follows the origin edge as well as extends -- deliberately not a parent edge, since CLASS_REGISTRY's chain also resolves super(), static lookup and vtable dispatch. Covers the Array sibling too; #7541's note was stale.
1 parent bce1045 commit 925dcfc

53 files changed

Lines changed: 601 additions & 118 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
88

99
Perry is a native TypeScript compiler written in Rust that compiles TypeScript source code directly to native executables. It uses SWC for TypeScript parsing and LLVM for code generation.
1010

11-
**Current Version:** 0.5.1358
11+
**Current Version:** 0.5.1359
1212

1313

1414
## TypeScript Parity Status

0 commit comments

Comments
 (0)