Created
January 18, 2020 21:35
-
-
Save dolpheen/730f6bf25b5621561771ee40a5313a9b to your computer and use it in GitHub Desktop.
Dart Internals - Getters Setters VM Example (compiled to dill Kernel AST)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main = main::main; | |
library from "file:///Users/vadimlukicev/dev/getters_setters/main.dart" as main { | |
class A extends core::Object { | |
field core::String* prop = null; | |
synthetic constructor •() → main::A* | |
: super core::Object::•() | |
; | |
} | |
class B extends core::Object { | |
field core::String* _prop = null; | |
synthetic constructor •() → main::B* | |
: super core::Object::•() | |
; | |
get prop() → core::String* | |
return this.{main::B::_prop}; | |
set prop(core::String* value) → void | |
return this.{main::B::_prop} = value; | |
} | |
class C extends core::Object { | |
synthetic constructor •() → main::C* | |
: super core::Object::•() | |
; | |
get prop() → core::String* | |
return "Prop from C!"; | |
} | |
static method main() → void { | |
main::A* a = new main::A::•(); | |
a.{main::A::prop} = "propA"; | |
core::print(a.{main::A::prop}); | |
main::B* b = new main::B::•(); | |
b.{main::B::prop} = "propB"; | |
core::print(b.{main::B::prop}); | |
main::C* c = new main::C::•(); | |
core::print(c.{main::C::prop}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment