Commit 1b67471
committed
fix: resolve extern type methods by stripping $ prefix in impl registration
When register_impl_blocks processes `impl Tensor { def sum(self) ... }`,
the for_type is resolved to Type::Extern { name: "$Tensor" } (with $
prefix from runtime_prefix). But the TypeDefinition in the registry is
stored under the bare name "Tensor". The lookup for "$Tensor" failed,
so methods were never added to the type, causing "Method 'sum' not found"
errors that skipped the entire main function.
Fix: strip the $ prefix when looking up extern types in the registry.
This allows all 94 Tensor methods to be properly registered, enabling
method calls like a.sum() and a.mean() to resolve correctly.
hello_simple.zynml now runs end-to-end with correct output.1 parent 46c9bcd commit 1b67471
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
302 | 304 | | |
| 305 | + | |
303 | 306 | | |
304 | 307 | | |
305 | 308 | | |
306 | | - | |
307 | | - | |
308 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
309 | 312 | | |
310 | | - | |
| 313 | + | |
311 | 314 | | |
312 | 315 | | |
313 | 316 | | |
| |||
0 commit comments