Skip to content

v2.2.0 - class inheritance + nested index access

Choose a tag to compare

@gmpassos gmpassos released this 18 Jul 06:00
· 151 commits to master since this release
d90228a

Class inheritance (extends) is now functional

extends was parsed but had no runtime effect. Now:

  • Inherited methods resolve through the superclass chain (bare and receiver calls); a subclass override still wins.
  • Inherited fields are initialized onto instances (superclass-first), read/write from a subclass.
  • Inherited getters and inherited static fields (Sub.staticField).
  • super: super.method() (overridden parent, resolved relative to the class where the call is written → correct for multi-level), super.getter, and super.field (read/write).
  • The Java (extends), C# (: Base) and JavaScript (extends) grammars now record the superclass they were dropping, so inheritance works across those languages (and TypeScript / Python) too. Kotlin's class B : A() base clause is not parsed yet; constructor : super(v) initializer lists are not parsed yet (set inherited fields from the constructor body or this.param).

Nested / chained index access (m[0][1])

Indexing into a nested collection now works for reads and writes: m[0][1], m['a']['b'], m['a'][0], deeper chains, and compound assignment (m[1][0] += 5). Previously only a single [...] on a bare variable was supported (unchanged). Parsed from Dart source today; the shared interpreter and code generator are language-agnostic.

Full changelog: https://github.com/ApolloVM/apollovm_dart/blob/v2.2.0/CHANGELOG.md