| library; |
| import self as self; |
| import "dart:core" as core; |
| |
| class A1 extends core::Object /*hasConstConstructor*/ { |
| final field core::int foo; |
| const constructor •(core::int foo) → self::A1 |
| : self::A1::foo = foo, super core::Object::•() |
| ; |
| static factory redir(self::A1 it) → self::A1 /* redirection-target: self::E1|constructor#redir */ |
| return self::E1|constructor#redir(it); |
| } |
| class A2 extends core::Object /*hasConstConstructor*/ { |
| final field core::int foo; |
| const constructor •(core::int foo) → self::A2 |
| : self::A2::foo = foo, super core::Object::•() |
| ; |
| static factory redir(core::bool b) → self::A2 /* redirection-target: self::E2|constructor#pick */ |
| return self::E2|constructor#pick(b); |
| } |
| class B2 extends self::A2 /*hasConstConstructor*/ { |
| static const field self::B2 element = #C2; |
| const constructor •(core::int foo) → self::B2 |
| : super self::A2::•(foo) |
| ; |
| } |
| class C2 extends self::A2 /*hasConstConstructor*/ { |
| static const field self::C2 element = #C3; |
| const constructor •(core::int foo) → self::C2 |
| : super self::A2::•(foo) |
| ; |
| } |
| extension type E1(self::A1 it) implements self::A1 { |
| abstract extension-type-member representation-field get it() → self::A1; |
| constructor • = self::E1|constructor#; |
| constructor tearoff • = self::E1|constructor#_#new#tearOff; |
| static redirecting-factory redir = self::E1|constructor#redir; |
| static redirecting-factory tearoff redir = self::E1|constructor#_#redir#tearOff; |
| } |
| extension type E2(self::A2 it) implements self::A2 { |
| abstract extension-type-member representation-field get it() → self::A2; |
| constructor • = self::E2|constructor#; |
| constructor tearoff • = self::E2|constructor#_#new#tearOff; |
| constructor pick = self::E2|constructor#pick; |
| constructor tearoff pick = self::E2|constructor#_#pick#tearOff; |
| } |
| static extension-type-member method E1|constructor#(self::A1 it) → self::E1 /* erasure=self::A1 */ { |
| lowered final self::E1 /* erasure=self::A1 */ #this = it; |
| return #this; |
| } |
| static extension-type-member method E1|constructor#_#new#tearOff(self::A1 it) → self::E1 /* erasure=self::A1 */ |
| return self::E1|constructor#(it); |
| static extension-type-member method E1|constructor#redir(self::A1 it) → self::E1 /* erasure=self::A1 */ /* redirection-target: self::E1|constructor# */ |
| return self::E1|constructor#(it); |
| static extension-type-member method E1|constructor#_#redir#tearOff(self::A1 it) → self::E1 /* erasure=self::A1 */ |
| return self::E1|constructor#(it); |
| static method test1() → dynamic { |
| self::expectIdentical(#C4, #C4); |
| } |
| static extension-type-member method E2|constructor#(self::A2 it) → self::E2 /* erasure=self::A2 */ { |
| lowered final self::E2 /* erasure=self::A2 */ #this = it; |
| return #this; |
| } |
| static extension-type-member method E2|constructor#_#new#tearOff(self::A2 it) → self::E2 /* erasure=self::A2 */ |
| return self::E2|constructor#(it); |
| static extension-type-member method E2|constructor#pick(core::bool b) → self::E2 /* erasure=self::A2 */ { |
| lowered final self::E2 /* erasure=self::A2 */ #this; |
| #this = self::E2|constructor#(b ?{self::A2} #C2 : #C3); |
| return #this; |
| } |
| static extension-type-member method E2|constructor#_#pick#tearOff(core::bool b) → self::E2 /* erasure=self::A2 */ |
| return self::E2|constructor#pick(b); |
| static method test2() → dynamic { |
| self::expectIdentical(#C2, #C2); |
| self::expectIdentical(#C3, #C3); |
| } |
| static method expectIdentical(dynamic expected, dynamic actual) → dynamic { |
| if(!core::identical(expected, actual)) { |
| throw "Expected '${expected}', actual '${actual}'."; |
| } |
| } |
| static method main() → dynamic { |
| self::test1(); |
| self::test2(); |
| } |
| |
| constants { |
| #C1 = 0 |
| #C2 = self::B2 {foo:#C1} |
| #C3 = self::C2 {foo:#C1} |
| #C4 = self::A1 {foo:#C1} |
| } |
| |
| |
| Constructor coverage from constants: |
| org-dartlang-testcase:///redirecting_factory_from_class.dart: |
| - B2. (from org-dartlang-testcase:///redirecting_factory_from_class.dart:28:9) |
| - A2. (from org-dartlang-testcase:///redirecting_factory_from_class.dart:22:9) |
| - Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart) |
| - C2. (from org-dartlang-testcase:///redirecting_factory_from_class.dart:33:9) |
| - A1. (from org-dartlang-testcase:///redirecting_factory_from_class.dart:7:9) |