| library; |
| import self as self; |
| import "dart:core" as core; |
| |
| static method getLocation(core::String name) → (core::double, core::double) { |
| if(name =={core::String::==}{(core::Object) → core::bool} "Aarhus") { |
| return (56.1629, 10.2039); |
| } |
| else { |
| return (0.0, 0.0); |
| } |
| } |
| static method main(core::List<core::String> arguments) → void { |
| final hoisted has-declared-initializer core::double lat; |
| final hoisted has-declared-initializer core::double long; |
| { |
| final synthesized(core::double, core::double) #0#0 = self::getLocation("Aarhus"); |
| lat = #0#0.$1{core::double}; |
| long = #0#0.$2{core::double}; |
| } |
| core::print("Current location: ${lat}, ${long}"); |
| self::expect(56.1629, lat); |
| self::expect(10.2039, long); |
| } |
| static method expect(dynamic expected, dynamic actual) → dynamic { |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) |
| throw "Expected ${expected}, actual ${actual}"; |
| } |
| |
| |
| Extra constant evaluation status: |
| Evaluated: RecordLiteral @ org-dartlang-testcase:///destructuring.dart:7:12 -> RecordConstant(const (56.1629, 10.2039)) |
| Evaluated: RecordLiteral @ org-dartlang-testcase:///destructuring.dart:9:12 -> RecordConstant(const (0.0, 0.0)) |
| Extra constant evaluation: evaluated: 27, effectively constant: 2 |