blob: 6c7f0e8d880f8d4a51ffd1ea58c1cba15fd53fe3 [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/*element: main:[null]*/
main() {
superFieldUpdate();
superSetterUpdate();
missingSuperFieldUpdate();
}
////////////////////////////////////////////////////////////////////////////////
// Update of super field.
////////////////////////////////////////////////////////////////////////////////
/*element: Super1.:[exact=Super1]*/
class Super1 {
/*element: Super1.field:Union([exact=JSUInt31], [exact=Sub1])*/
dynamic field = 42;
}
/*element: Sub1.:[exact=Sub1]*/
class Sub1 extends Super1 {
/*element: Sub1.method:[subclass=Closure]*/
method() {
var a = super.field = new Sub1();
return a. /*[exact=Sub1]*/ method;
}
}
/*element: superFieldUpdate:[null]*/
superFieldUpdate() {
new Sub1(). /*invoke: [exact=Sub1]*/ method();
}
////////////////////////////////////////////////////////////////////////////////
// Update of super setter.
////////////////////////////////////////////////////////////////////////////////
/*element: Super2.:[exact=Super2]*/
class Super2 {
set setter(/*[exact=Sub2]*/ value) {}
}
/*element: Sub2.:[exact=Sub2]*/
class Sub2 extends Super2 {
/*element: Sub2.method:[subclass=Closure]*/
method() {
var a = super.setter = new Sub2();
return a. /*[exact=Sub2]*/ method;
}
}
/*element: superSetterUpdate:[null]*/
superSetterUpdate() {
new Sub2(). /*invoke: [exact=Sub2]*/ method();
}
////////////////////////////////////////////////////////////////////////////////
// Update of missing super field.
////////////////////////////////////////////////////////////////////////////////
/*element: Super4.:[exact=Super4]*/
class Super4 {}
/*element: Sub4.:[exact=Sub4]*/
class Sub4 extends Super4 {
/*element: Sub4.method:[empty]*/
method() {
// ignore: UNDEFINED_SUPER_SETTER
var a = super.field = new Sub4();
return a. /*[empty]*/ method;
}
}
/*element: missingSuperFieldUpdate:[null]*/
missingSuperFieldUpdate() {
new Sub4(). /*invoke: [exact=Sub4]*/ method();
}