Commit Graph

3 Commits

Author SHA1 Message Date
xgopilot
2d4d516687 test: update interface1370 test outputs after Named type preservation fix
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 10:56:39 +00:00
xgopilot
05da9ec252 fix: preserve Named interface type information through interface construction
This commit addresses the root cause identified in issue #1370 by preserving
Named interface type information through the interface construction phase.

**Root Cause:**
Named interfaces were prematurely unwrapped via Underlying() in the interface
construction phase (MakeInterface()/unsafeInterface()), causing the subsequent
ABI type generation to hit `case *types.Interface:` instead of
`case *types.Named:`, resulting in loss of package information.

**The Fix:**
1. Modified `unsafeInterface()` to accept a `namedIntf types.Type` parameter
2. Updated all callers to pass the Named type (tinter.raw.Type, assertedTyp.raw.Type, etc.)
3. When namedIntf is available, pass it to `abiType()` to ensure proper routing
   through the type switch to `abiNamedInterfaceOf()` which has correct package context
4. Reverted the workaround logic in `abiInterfaceOf()` that extracted pkgPath from methods

**Impact:**
- Fixes segmentation faults when calling interface private methods across packages
- Ensures runtime receives correct package path for interface metadata
- Allows private method slots in itab to be properly filled

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 10:32:20 +00:00
xgopilot
670f880c78 refactor(test): move issue #1370 geometry test to cl/_testgo/interface1370
- Move geometry package from _demo to cl/_testdata/geometry1370
- Create simplified test in cl/_testgo/interface1370 following interface test pattern
- Generate .ll file with llgen to verify interface metadata package path fix
- Remove old demo files (issue1370_geometry, issue1370_goast, issue1370_gotypes)
- Remove .tmp-comment files

The new test structure is simpler and follows the existing cl/_testgo/interface pattern,
focusing on demonstrating the interface metadata fix for private methods across packages.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-10-27 08:03:58 +00:00