Skip to content

v2.5.0 - Wasm: custom instance getters

Choose a tag to compare

@gmpassos gmpassos released this 18 Jul 07:22
· 145 commits to master since this release
93f7d0e

Wasm: custom instance getters

The on-the-fly WebAssembly compiler now supports user-declared instance getters (int get x { ... }).

  • A getter is synthesized as a zero-argument instance method, so an access via a receiver (c.x) lowers to a 0-arg method call — reusing the whole instance-method path (argument marshalling, return conversion) and the extends-chain resolution.
  • Inherited and overridden getters therefore resolve exactly like methods.
  • Covers int/double/bool/String getters, a computed-expression getter body, and a getter used inside an expression (read once or twice).

Bare getter access inside a method body (x resolving to this.x, no receiver) and setters remain follow-ups — bare access is not resolved by the interpreter yet either.

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