| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:27:3: Error: Only static fields can be declared as const. |
| // Try using 'final' instead of 'const', or adding the keyword 'static'. |
| // const bool initialized = |
| // ^^^^^ |
| // |
| // pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:22:25: Error: 'lib' can't be used in a constant expression because it's marked as 'deferred' which means it isn't available until loaded. |
| // Try moving the constant from the deferred library, or removing 'deferred' from the import. |
| // |
| // const fromDeferredLib = lib.x; |
| // ^^^ |
| // |
| // pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:14:30: Warning: Operand of null-aware operation '??' has type 'bool' which excludes null. |
| // const bool nullAwareOnNull = barFromEnvOrNull ?? true; |
| // ^ |
| // |
| // pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:100:34: Error: The argument type 'A' can't be assigned to the parameter type 'T'. |
| // - 'A' is from 'pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart'. |
| // const Class.method(T t) : this(-t); |
| // ^ |
| // |
| // pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:123:27: Error: The parameter 'named' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'. |
| // Try adding either an explicit non-'null' default value or the 'required' modifier. |
| // int procedure(int i, {int named}) => i; |
| // ^^^^^ |
| // |
| // pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:31:9: Error: Constructor is marked 'const' so all fields must be final. |
| // const Foo(this.value, |
| // ^ |
| // pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:27:14: Context: Field isn't final, but constructor is 'const'. |
| // const bool initialized = |
| // ^ |
| // |
| // pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:22:29: Error: Constant evaluation error: |
| // const fromDeferredLib = lib.x; |
| // ^ |
| // pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:22:29: Context: 'lib' can't be used in a constant expression because it's marked as 'deferred' which means it isn't available until loaded. |
| // Try moving the constant from the deferred library, or removing 'deferred' from the import. |
| // |
| // const fromDeferredLib = lib.x; |
| // ^ |
| // pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:22:7: Context: While analyzing: |
| // const fromDeferredLib = lib.x; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| import "dart:_internal" as _in; |
| |
| import "org-dartlang-testcase:///various_lib.dart" deferred as lib; |
| |
| typedef F = (core::int, {named: core::int}) → core::int; |
| class Foo<E extends core::Object? = dynamic> extends core::Object /*hasConstConstructor*/ { |
| final field core::bool saved; |
| final field core::bool saved2; |
| field core::bool initialized = #C4; |
| final field self::Foo::E% value; |
| const constructor •(self::Foo::E% value, {core::bool saved2 = #C5, core::bool x = #C6}) → self::Foo<self::Foo::E%> |
| : self::Foo::value = value, self::Foo::saved2 = saved2, self::Foo::saved = x, super core::Object::•() |
| ; |
| } |
| class A extends core::Object /*hasConstConstructor*/ { |
| const constructor •() → self::A |
| : super core::Object::•() |
| ; |
| operator unary-() → self::A |
| return this; |
| } |
| class B extends core::Object implements self::A /*hasConstConstructor*/ { |
| const constructor •() → self::B |
| : super core::Object::•() |
| ; |
| operator unary-() → self::B |
| return this; |
| } |
| class C extends core::Object implements self::A /*hasConstConstructor*/ { |
| const constructor •() → self::C |
| : super core::Object::•() |
| ; |
| operator unary-() → self::C |
| return this; |
| } |
| class Class<T extends self::A> extends core::Object /*hasConstConstructor*/ { |
| const constructor •(self::Class::T t) → self::Class<self::Class::T> |
| : super core::Object::•() |
| ; |
| const constructor redirect(dynamic t) → self::Class<self::Class::T> |
| : this self::Class::•(t as{TypeError,ForDynamic,ForNonNullableByDefault} self::Class::T) |
| ; |
| const constructor method(self::Class::T t) → self::Class<self::Class::T> |
| : this self::Class::•(invalid-expression "pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:100:34: Error: The argument type 'A' can't be assigned to the parameter type 'T'. |
| - 'A' is from 'pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart'. |
| const Class.method(T t) : this(-t); |
| ^" in t.{self::A::unary-}(){() → self::A} as{TypeError,ForNonNullableByDefault} Never) |
| ; |
| } |
| class Subclass<T extends self::A> extends self::Class<self::Subclass::T> /*hasConstConstructor*/ { |
| const constructor •(dynamic t) → self::Subclass<self::Subclass::T> |
| : super self::Class::•(t as{TypeError,ForDynamic,ForNonNullableByDefault} self::Subclass::T) |
| ; |
| } |
| class ConstClassWithF extends core::Object /*hasConstConstructor*/ { |
| final field (core::int, {named: core::int}) → core::int foo; |
| const constructor •((core::int, {named: core::int}) → core::int foo) → self::ConstClassWithF |
| : self::ConstClassWithF::foo = foo, super core::Object::•() |
| ; |
| } |
| static const field core::bool barFromEnv = #C3; |
| static const field core::bool hasBarEnv = #C7; |
| static const field core::bool? barFromEnvOrNull0 = #C11; |
| static const field core::bool barFromEnvOrNull = #C13; |
| static const field core::bool notBarFromEnvOrNull = #C14; |
| static const field core::bool conditionalOnNull = #C16; |
| static const field core::bool nullAwareOnNull = #C18; |
| static const field core::bool andOnNull = #C19; |
| static const field core::bool andOnNull2 = #C13; |
| static const field core::bool orOnNull = #C20; |
| static const field core::bool orOnNull2 = #C21; |
| static const field core::bool orOnNull3 = #C9; |
| static const field core::bool orOnNull4 = #C13; |
| static const field core::int fromDeferredLib = invalid-expression "'lib' can't be used in a constant expression because it's marked as 'deferred' which means it isn't available until loaded."; |
| static const field self::Foo<core::int> x = #C23; |
| static const field core::bool? y = #C9; |
| static const field core::bool z = #C15; |
| static const field core::Object maybeInt = #C25; |
| static const field core::bool isItInt = #C27; |
| static const field core::Object maybeInt2 = #C9; |
| static const field core::bool isItInt2 = #C15; |
| static const field core::int? maybeInt3 = #C10; |
| static const field core::bool isItInt3 = #C15; |
| static const field dynamic listOfNull = #C28; |
| static const field core::bool isListOfNull = #C9; |
| static const field dynamic listOfInt = #C29; |
| static const field core::bool isListOfInt = #C9; |
| static const field core::bool isList = #C9; |
| static const field dynamic setOfInt = #C30; |
| static const field core::bool isSetOfInt = #C9; |
| static const field dynamic mapOfInt = #C31; |
| static const field core::bool isMapOfInt = #C9; |
| static const field dynamic listOfListOfInt = #C32; |
| static const field core::bool isListOfListOfInt = #C9; |
| static const field dynamic setOfSetOfInt = #C33; |
| static const field core::bool isSetOfSetOfInt = #C9; |
| static const field dynamic mapOfMapOfInt1 = #C34; |
| static const field dynamic mapOfMapOfInt2 = #C35; |
| static const field core::bool isMapOfMapOfInt1 = #C9; |
| static const field core::bool isMapOfMapOfInt2 = #C9; |
| static const field core::Symbol symbolWithUnevaluatedParameter = #C37; |
| static const field core::Symbol symbolWithInvalidName = #C38; |
| static const field self::Class<self::B>? c0 = #C44; |
| static const field self::Class<self::A>? c1 = invalid-expression "pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:100:34: Error: The argument type 'A' can't be assigned to the parameter type 'T'. |
| - 'A' is from 'pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart'. |
| const Class.method(T t) : this(-t); |
| ^"; |
| static const field self::Subclass<self::B>? c2 = #C49; |
| static const field self::Class<self::A>? c3 = #C53; |
| static const field self::Class<self::B>? c4 = #C58; |
| static const field self::Subclass<self::A>? c5 = #C63; |
| static const field self::Subclass<self::B>? c6 = #C68; |
| static const field core::Type f = #C69; |
| static field self::ConstClassWithF constClassWithF1 = #C71; |
| static const field self::ConstClassWithF constClassWithF2 = #C71; |
| static const field core::bool unevaluatedBool = #C72; |
| static const field core::bool notUnevaluatedBool = #C73; |
| static const field core::bool? unevaluatedBoolOrNull = #C75; |
| static const field core::bool unevaluatedBoolNotNull = #C76; |
| static method procedure(core::int i, {core::int named = #C10}) → core::int |
| return i; |
| static method main() → dynamic { |
| core::print(#C44); |
| core::print(invalid-expression "pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:100:34: Error: The argument type 'A' can't be assigned to the parameter type 'T'. |
| - 'A' is from 'pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart'. |
| const Class.method(T t) : this(-t); |
| ^"); |
| core::print(#C49); |
| core::print(#C53); |
| core::print(#C58); |
| core::print(#C63); |
| core::print(#C68); |
| core::print(#C23); |
| core::print(#C23.{self::Foo::saved}{core::bool}); |
| core::print(#C23.{self::Foo::value}{core::int}); |
| } |
| |
| library /*isNonNullableByDefault*/; |
| import self as self2; |
| import "dart:core" as core; |
| |
| static const field core::int x = #C22; |
| |
| constants { |
| #C1 = "foo" |
| #C2 = "bar" |
| #C3 = eval const core::bool::fromEnvironment(#C2) |
| #C4 = eval const core::bool::fromEnvironment(#C1, defaultValue: #C3) |
| #C5 = eval const core::bool::fromEnvironment(#C1, defaultValue: #C3) |
| #C6 = eval const core::bool::fromEnvironment(#C1, defaultValue: #C3) |
| #C7 = eval const core::bool::hasEnvironment(#C2) |
| #C8 = eval const core::bool::fromEnvironment(#C2) |
| #C9 = true |
| #C10 = null |
| #C11 = eval #C8 ?{core::bool?} #C9 : #C10 |
| #C12 = eval #C11! |
| #C13 = eval const core::bool::fromEnvironment(#C2, defaultValue: #C12) |
| #C14 = eval !#C13 |
| #C15 = false |
| #C16 = eval #C13 ?{core::bool} #C9 : #C15 |
| #C17 = eval #C13 == null |
| #C18 = eval #C17 ?{core::bool} #C9 : #C13 |
| #C19 = eval #C13 && #C9 |
| #C20 = eval #C13 || #C9 |
| #C21 = eval #C13 || #C15 |
| #C22 = 42 |
| #C23 = eval self::Foo<core::int*>{saved:#C6, saved2:#C5, initialized:#C4, value:#C22} |
| #C24 = eval const core::bool::fromEnvironment(#C1) |
| #C25 = eval #C24 ?{core::Object} #C22 : #C9 |
| #C26 = eval #C25 is{ForNonNullableByDefault} core::int |
| #C27 = eval #C26 ?{core::bool} #C9 : #C15 |
| #C28 = <Null>[#C10] |
| #C29 = <core::int*>[#C22] |
| #C30 = <core::int*>{#C22} |
| #C31 = <core::int*, core::int*>{#C22:#C22) |
| #C32 = <core::List<core::int*>*>[#C29] |
| #C33 = <core::Set<core::int*>*>{#C30} |
| #C34 = <core::Map<core::int*, core::int*>*, core::int*>{#C31:#C22) |
| #C35 = <core::int*, core::Map<core::int*, core::int*>*>{#C22:#C31) |
| #C36 = eval const core::String::fromEnvironment(#C1) |
| #C37 = eval const _in::Symbol::•(#C36) |
| #C38 = #42 |
| #C39 = "x" |
| #C40 = eval const core::bool::fromEnvironment(#C39) |
| #C41 = eval self::C{} |
| #C42 = eval #C41 as{ForNonNullableByDefault} self::B* |
| #C43 = eval self::Class<self::B*>{#C42} |
| #C44 = eval #C40 ?{self::Class<self::B>?} #C10 : #C43 |
| #C45 = eval const core::bool::fromEnvironment(#C39) |
| #C46 = eval self::C{} |
| #C47 = eval #C46 as{ForNonNullableByDefault} self::B* |
| #C48 = eval self::Subclass<self::B*>{#C47} |
| #C49 = eval #C45 ?{self::Subclass<self::B>?} #C10 : #C48 |
| #C50 = eval const core::bool::fromEnvironment(#C39) |
| #C51 = eval self::A{} |
| #C52 = eval self::Class<self::A*>{#C51} |
| #C53 = eval #C50 ?{self::Class<self::A>?} #C10 : #C52 |
| #C54 = eval const core::bool::fromEnvironment(#C39) |
| #C55 = eval self::B{} |
| #C56 = eval #C55 as{ForNonNullableByDefault} self::B* |
| #C57 = eval self::Class<self::B*>{#C56} |
| #C58 = eval #C54 ?{self::Class<self::B>?} #C10 : #C57 |
| #C59 = eval const core::bool::fromEnvironment(#C39) |
| #C60 = eval self::A{} |
| #C61 = eval #C60 as{ForNonNullableByDefault} self::A* |
| #C62 = eval self::Subclass<self::A*>{#C61} |
| #C63 = eval #C59 ?{self::Subclass<self::A>?} #C10 : #C62 |
| #C64 = eval const core::bool::fromEnvironment(#C39) |
| #C65 = eval self::B{} |
| #C66 = eval #C65 as{ForNonNullableByDefault} self::B* |
| #C67 = eval self::Subclass<self::B*>{#C66} |
| #C68 = eval #C64 ?{self::Subclass<self::B>?} #C10 : #C67 |
| #C69 = TypeLiteralConstant((core::int*, {named: core::int*}) →* core::int*) |
| #C70 = static-tearoff self::procedure |
| #C71 = self::ConstClassWithF {foo:#C70} |
| #C72 = eval const core::bool::fromEnvironment(#C1) |
| #C73 = eval !#C72 |
| #C74 = eval const core::bool::fromEnvironment(#C2) |
| #C75 = eval #C74 ?{core::bool?} #C72 : #C10 |
| #C76 = eval #C75! |
| } |
| |
| Extra constant evaluation status: |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:32:27 -> BoolConstant(false) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:33:21 -> BoolConstant(false) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:28:13 -> BoolConstant(false) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:137:9 -> InstanceConstant(const Class<A*>{}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:138:9 -> InstanceConstant(const Class<B*>{}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:139:9 -> InstanceConstant(const Subclass<A*>{}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:140:9 -> InstanceConstant(const Subclass<B*>{}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:141:9 -> InstanceConstant(const Foo<int*>{Foo.saved: false, Foo.saved2: false, Foo.initialized: false, Foo.value: 42}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:142:9 -> InstanceConstant(const Foo<int*>{Foo.saved: false, Foo.saved2: false, Foo.initialized: false, Foo.value: 42}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:143:9 -> InstanceConstant(const Foo<int*>{Foo.saved: false, Foo.saved2: false, Foo.initialized: false, Foo.value: 42}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:7:31 -> BoolConstant(false) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:8:30 -> BoolConstant(false) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:9:67 -> NullConstant(null) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:37:17 -> InstanceConstant(const Foo<int*>{Foo.saved: false, Foo.saved2: false, Foo.initialized: false, Foo.value: 42}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:42:46 -> BoolConstant(true) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:43:38 -> BoolConstant(false) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:76:11 -> SymbolConstant(#) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:110:38 -> InstanceConstant(const Class<A*>{}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:111:38 -> InstanceConstant(const Class<B*>{}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:112:38 -> InstanceConstant(const Subclass<A*>{}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:113:38 -> InstanceConstant(const Subclass<B*>{}) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:127:35 -> BoolConstant(false) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:128:33 -> BoolConstant(true) |
| Evaluated with empty environment: ConstantExpression @ org-dartlang-testcase:///various.dart:130:33 -> NullConstant(null) |
| Extra constant evaluation: evaluated: 62, effectively constant: 24 |
| |
| |
| Constructor coverage from constants: |
| org-dartlang-testcase:///various.dart: |
| - C. (from org-dartlang-testcase:///various.dart:92:9) |
| - Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9) |
| - Class.redirect (from org-dartlang-testcase:///various.dart:99:9) |
| - Class. (from org-dartlang-testcase:///various.dart:98:9) |
| - A. (from org-dartlang-testcase:///various.dart:80:9) |
| - Class.method (from org-dartlang-testcase:///various.dart:100:9) |
| - Subclass. (from org-dartlang-testcase:///various.dart:104:9) |
| - B. (from org-dartlang-testcase:///various.dart:86:9) |
| - Foo. (from org-dartlang-testcase:///various.dart:31:9) |
| - ConstClassWithF. (from org-dartlang-testcase:///various.dart:120:9) |