mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
fix #27643, failed to virtualize fields if an abstract one is mixed in
R=vsm@google.com Review URL: https://codereview.chromium.org/2441693003 .
This commit is contained in:
parent
3c44a09882
commit
95ef8bb59a
|
@ -30,10 +30,6 @@ PropertyOverrideResult checkForPropertyOverride(
|
||||||
var setter = superprop.setter;
|
var setter = superprop.setter;
|
||||||
bool hasSetter = setter != null && !setter.isAbstract;
|
bool hasSetter = setter != null && !setter.isAbstract;
|
||||||
if (hasSetter) foundSetter = true;
|
if (hasSetter) foundSetter = true;
|
||||||
|
|
||||||
// Stop if this is an abstract getter/setter
|
|
||||||
// TODO(jmesserly): why were we doing this?
|
|
||||||
if (!hasGetter && !hasSetter) break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PropertyOverrideResult(foundGetter, foundSetter);
|
return new PropertyOverrideResult(foundGetter, foundSetter);
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
// Copyright (c) 2016, 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.
|
||||||
|
|
||||||
|
import 'package:expect/expect.dart';
|
||||||
|
|
||||||
|
abstract class B {
|
||||||
|
int get x;
|
||||||
|
}
|
||||||
|
|
||||||
|
class C {
|
||||||
|
int get x => 42;
|
||||||
|
}
|
||||||
|
|
||||||
|
class D extends C with B {
|
||||||
|
final int x;
|
||||||
|
|
||||||
|
D(this.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class C2 {
|
||||||
|
int get x => 42;
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class B2 extends C2 {
|
||||||
|
int get x;
|
||||||
|
}
|
||||||
|
|
||||||
|
class D2 extends B2 {
|
||||||
|
final int x;
|
||||||
|
|
||||||
|
D2(this.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
var d = new D(17);
|
||||||
|
Expect.equals(d.x, 17);
|
||||||
|
|
||||||
|
var d2 = new D2(17);
|
||||||
|
Expect.equals(d.x, 17);
|
||||||
|
}
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright (c) 2016, 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.
|
||||||
|
|
||||||
import 'dart:math' hide Rectangle;
|
import 'dart:math' hide Rectangle;
|
||||||
import 'dart:math' as math show Point, Rectangle, MutableRectangle;
|
import 'dart:math' as math show Point, Rectangle, MutableRectangle;
|
||||||
import 'package:expect/expect.dart' show Expect;
|
import 'package:expect/expect.dart' show Expect;
|
||||||
|
|
Loading…
Reference in a new issue