blob: f3464155fb0b6d874b3f34984cd6e1d3a3affc21 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:21:11: Error: The type 'num' of the getter 'A.property3' is not a subtype of the type 'int' of the setter 'A.property3'.
// num get property3; // error
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:22:12: Context: This is the declaration of the setter 'A.property3'.
// void set property3(int i);
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:36:18: Error: The type 'num' of the getter 'A.property9' is not a subtype of the type 'int' of the setter 'A.property9'.
// static num get property9 => 0; // error
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:37:19: Context: This is the declaration of the setter 'A.property9'.
// static void set property9(int value) {}
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:61:12: Error: The type 'num' of the inherited getter 'B1.property3' is not a subtype of the type 'int' of the setter 'B2.property3'.
// void set property3(int i); // error
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:45:11: Context: This is the declaration of the getter 'B1.property3'.
// num get property3;
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:67:12: Error: The type 'num' of the inherited field 'B1.property6' is not a subtype of the type 'int' of the setter 'B2.property6'.
// void set property6(int i); // error
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:51:13: Context: This is the declaration of the field 'B1.property6'.
// final num property6;
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:89:11: Error: The type 'num' of the getter 'C2.property3' is not a subtype of the type 'int' of the inherited setter 'C1.property3'.
// num get property3; // error
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:75:12: Context: This is the declaration of the setter 'C1.property3'.
// void set property3(int i);
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:97:11: Error: The return type of the method 'C2.property6' is 'num', which does not match the return type, 'int', of the overridden method, 'C1.property6'.
// Change to a subtype of 'int'.
// num get property6; // error
// ^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:81:7: Context: This is the overridden method ('property6').
// int property6 = 0;
// ^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:97:11: Error: The type 'num' of the getter 'C2.property6' is not a subtype of the type 'int' of the inherited setter 'C1.property6'.
// num get property6; // error
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:81:7: Context: This is the declaration of the setter 'C1.property6'.
// int property6 = 0;
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:116:16: Error: The type 'num' of the inherited getter 'D1.property3' is not a subtype of the type 'int' of the inherited setter 'D2.property3'.
// abstract class D3 implements D1, D2 /* error on property3 */ {}
// ^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:105:11: Context: This is the declaration of the getter 'D1.property3'.
// num get property3;
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:113:12: Context: This is the declaration of the setter 'D2.property3'.
// void set property3(int i);
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:118:16: Error: The type 'num' of the inherited getter 'D1.property3' is not a subtype of the type 'int' of the inherited setter 'D2.property3'.
// abstract class D4 implements D3 /* no need for error on property3 */ {}
// ^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:105:11: Context: This is the declaration of the getter 'D1.property3'.
// num get property3;
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:113:12: Context: This is the declaration of the setter 'D2.property3'.
// void set property3(int i);
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:11:9: Error: The type 'num' of the getter 'property3' is not a subtype of the type 'int' of the setter 'property3'.
// num get property3 => 0; // error
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:12:10: Context: This is the declaration of the setter 'property3'.
// void set property3(int value) {}
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:127:11: Error: The type 'num' of the getter 'property3' is not a subtype of the type 'int' of the setter 'property3'.
// num get property3 => 0; // error
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:128:12: Context: This is the declaration of the setter 'property3'.
// void set property3(int i) {}
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:136:9: Error: The type 'T' of the getter 'property6' is not a subtype of the type 'S' of the setter 'property6'.
// T get property6 => 0; // error
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:137:12: Context: This is the declaration of the setter 'property6'.
// void set property6(S i) {}
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:145:18: Error: The type 'num' of the getter 'property9' is not a subtype of the type 'int' of the setter 'property9'.
// static num get property9 => 0; // error
// ^^^^^^^^^
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:146:19: Context: This is the declaration of the setter 'property9'.
// static void set property9(int value) {}
// ^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:130:22: Error: A value of type 'int' can't be returned from a function with return type 'S'.
// S get property4 => 0; // ok
// ^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:133:22: Error: A value of type 'int' can't be returned from a function with return type 'S'.
// S get property5 => 0; // ok
// ^
//
// pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:136:22: Error: A value of type 'int' can't be returned from a function with return type 'T'.
// T get property6 => 0; // error
// ^
//
import self as self;
import "dart:core" as core;
abstract class A extends core::Object {
field core::int property4 = 0;
field core::int property5 = 0;
covariant field core::num property6 = 0;
synthetic constructor •() self::A
: super core::Object::•()
;
abstract get property1() core::int;
abstract set property1(core::int i) void;
abstract get property2() core::int;
abstract set property2(core::int i) void;
abstract get property3() core::num;
abstract set property3(core::int i) void;
static get property7() core::int
return 0;
static set property7(core::int value) void {}
static get property8() core::int
return 0;
static set property8(core::num value) void {}
static get property9() core::num
return 0;
static set property9(core::int value) void {}
}
abstract class B1 extends core::Object {
final field core::int property4;
final field core::int property5;
final field core::num property6;
constructor •(core::int property4, core::int property5, core::num property6) self::B1
: self::B1::property4 = property4, self::B1::property5 = property5, self::B1::property6 = property6, super core::Object::•()
;
abstract get property1() core::int;
abstract get property2() core::int;
abstract get property3() core::num;
}
abstract class B2 extends core::Object implements self::B1 {
synthetic constructor •() self::B2
: super core::Object::•()
;
abstract set property1(core::int i) void;
abstract set property2(core::num i) void;
abstract set property3(core::int i) void;
abstract set property4(core::int i) void;
abstract set property5(core::num i) void;
abstract set property6(core::int i) void;
}
abstract class C1 extends core::Object {
field core::int property4 = 0;
field core::num property5 = 0;
field core::int property6 = 0;
synthetic constructor •() self::C1
: super core::Object::•()
;
abstract set property1(core::int i) void;
abstract set property2(core::num i) void;
abstract set property3(core::int i) void;
}
abstract class C2 extends core::Object implements self::C1 {
synthetic constructor •() self::C2
: super core::Object::•()
;
abstract get property1() core::int;
abstract get property2() core::int;
abstract get property3() core::num;
abstract get property4() core::int;
abstract get property5() core::int;
abstract get property6() core::num;
}
abstract class D1 extends core::Object {
synthetic constructor •() self::D1
: super core::Object::•()
;
abstract get property1() core::int;
abstract get property2() core::int;
abstract get property3() core::num;
}
abstract class D2 extends core::Object {
synthetic constructor •() self::D2
: super core::Object::•()
;
abstract set property1(core::int i) void;
abstract set property2(core::num i) void;
abstract set property3(core::int i) void;
}
abstract class D3 extends core::Object implements self::D1, self::D2 {
synthetic constructor •() self::D3
: super core::Object::•()
;
}
abstract class D4 extends core::Object implements self::D3 {
synthetic constructor •() self::D4
: super core::Object::•()
;
}
extension Extension<T extends core::Object? = dynamic, S extends T% = dynamic> on core::int {
get property1 = self::Extension|get#property1;
get property2 = self::Extension|get#property2;
get property3 = self::Extension|get#property3;
get property4 = self::Extension|get#property4;
get property5 = self::Extension|get#property5;
get property6 = self::Extension|get#property6;
static get property7 = get self::Extension|property7;
static get property8 = get self::Extension|property8;
static get property9 = get self::Extension|property9;
set property1 = self::Extension|set#property1;
set property2 = self::Extension|set#property2;
set property3 = self::Extension|set#property3;
set property4 = self::Extension|set#property4;
set property5 = self::Extension|set#property5;
set property6 = self::Extension|set#property6;
static set property7 = set self::Extension|property7;
static set property8 = set self::Extension|property8;
static set property9 = set self::Extension|property9;
}
static get property1() core::int
return 0;
static set property1(core::int value) void {}
static get property2() core::int
return 0;
static set property2(core::num value) void {}
static get property3() core::num
return 0;
static set property3(core::int value) void {}
static method Extension|get#property1<T extends core::Object? = dynamic, S extends self::Extension|get#property1::T% = dynamic>(final core::int #this) → core::int
return 0;
static method Extension|set#property1<T extends core::Object? = dynamic, S extends self::Extension|set#property1::T% = dynamic>(final core::int #this, core::int i) → void {}
static method Extension|get#property2<T extends core::Object? = dynamic, S extends self::Extension|get#property2::T% = dynamic>(final core::int #this) → core::int
return 0;
static method Extension|set#property2<T extends core::Object? = dynamic, S extends self::Extension|set#property2::T% = dynamic>(final core::int #this, core::num i) → void {}
static method Extension|get#property3<T extends core::Object? = dynamic, S extends self::Extension|get#property3::T% = dynamic>(final core::int #this) → core::num
return 0;
static method Extension|set#property3<T extends core::Object? = dynamic, S extends self::Extension|set#property3::T% = dynamic>(final core::int #this, core::int i) → void {}
static method Extension|get#property4<T extends core::Object? = dynamic, S extends self::Extension|get#property4::T% = dynamic>(final core::int #this) → self::Extension|get#property4::S%
return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:130:22: Error: A value of type 'int' can't be returned from a function with return type 'S'.
S get property4 => 0; // ok
^" in 0 as{TypeError,ForNonNullableByDefault} <BottomType>;
static method Extension|set#property4<T extends core::Object? = dynamic, S extends self::Extension|set#property4::T% = dynamic>(final core::int #this, self::Extension|set#property4::S% i) → void {}
static method Extension|get#property5<T extends core::Object? = dynamic, S extends self::Extension|get#property5::T% = dynamic>(final core::int #this) → self::Extension|get#property5::S%
return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:133:22: Error: A value of type 'int' can't be returned from a function with return type 'S'.
S get property5 => 0; // ok
^" in 0 as{TypeError,ForNonNullableByDefault} <BottomType>;
static method Extension|set#property5<T extends core::Object? = dynamic, S extends self::Extension|set#property5::T% = dynamic>(final core::int #this, self::Extension|set#property5::T% i) → void {}
static method Extension|get#property6<T extends core::Object? = dynamic, S extends self::Extension|get#property6::T% = dynamic>(final core::int #this) → self::Extension|get#property6::T%
return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/getter_vs_setter_type.dart:136:22: Error: A value of type 'int' can't be returned from a function with return type 'T'.
T get property6 => 0; // error
^" in 0 as{TypeError,ForNonNullableByDefault} <BottomType>;
static method Extension|set#property6<T extends core::Object? = dynamic, S extends self::Extension|set#property6::T% = dynamic>(final core::int #this, self::Extension|set#property6::S% i) → void {}
static get Extension|property7() → core::int
return 0;
static set Extension|property7(core::int value) → void {}
static get Extension|property8() → core::int
return 0;
static set Extension|property8(core::num value) → void {}
static get Extension|property9() → core::num
return 0;
static set Extension|property9(core::int value) → void {}
static method main() → dynamic {}