| library /*isNonNullableByDefault*/; |
| import self as self; |
| import "dart:core" as core; |
| import "package:expect/expect.dart" as exp; |
| |
| import "package:expect/expect.dart"; |
| |
| class MessageType extends core::Object /*hasConstConstructor*/ { |
| static const field self::MessageType print = #C2; |
| static const field self::MessageType skip = #C4; |
| final field core::String name; |
| const constructor _(core::String name) → self::MessageType |
| : self::MessageType::name = name, super core::Object::•() |
| ; |
| static factory parse(core::String name) → self::MessageType { |
| if(name =={core::String::==}{(core::Object) → core::bool} "print") { |
| return #C2; |
| } |
| return #C4; |
| } |
| } |
| static const field self::MessageType printConst = #C2; |
| static method main() → void { |
| exp::Expect::equals(#C2, #C2); |
| } |
| |
| constants { |
| #C1 = "print" |
| #C2 = self::MessageType {name:#C1} |
| #C3 = "skip" |
| #C4 = self::MessageType {name:#C3} |
| } |
| |
| |
| Constructor coverage from constants: |
| org-dartlang-testcase:///const_functions_const_factory.dart: |
| - MessageType._ (from org-dartlang-testcase:///const_functions_const_factory.dart:25:9) |
| - Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9) |