- Parse `# Child = > Parent` object decls (base must be a simple name after `>`; dotted bases and `# Foo = 1` are diagnostics). - Validate in load: unknown base types and cyclic inheritance (A → B → A) fail with line/col. - Method resolution walks the base chain (most specific first) on both tree and bytecode backends; `_type` stays the child name; same-name child ## overrides the parent. - Add inherit.rs, wire Program.object_bases, gold fixtures (inherit-parent-method / inherit-override + cycle/unknown-base/bad-rhs) and public 09-inherit demo pages. Docs: objects.md, markdown-mapping, roadmap, skill. Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
277 B
Markdown
23 lines
277 B
Markdown
---
|
|
title: inherit parent method
|
|
> lib/json.mq.md
|
|
---
|
|
|
|
# Greeter
|
|
|
|
## hello
|
|
+ `who`
|
|
|
|
*`msg` = "Hello, `who`!" *
|
|
**`msg`**
|
|
|
|
# Loud = > Greeter
|
|
|
|
# main
|
|
|
|
*`l` = > Loud *
|
|
*`ty` = > json.get value=`l` key=_type *
|
|
> print text=`ty`
|
|
*`m` = > `l`.hello who=world *
|
|
> print text=`m`
|