2011-10-05 06:22:36 +00:00
|
|
|
// Copyright (c) 2011, 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.
|
|
|
|
// Dart test error for overriding getter with method.
|
|
|
|
|
|
|
|
class A {
|
2017-04-17 21:52:57 +00:00
|
|
|
get foo {
|
|
|
|
return 123;
|
|
|
|
}
|
2011-10-05 06:22:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class B extends A {
|
2017-04-17 21:52:57 +00:00
|
|
|
foo() {} // method cannot override getter.
|
2011-10-05 06:22:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class OverrideFieldMethod2NegativeTest {
|
|
|
|
static testMain() {
|
2011-11-02 00:23:03 +00:00
|
|
|
new B().foo();
|
2011-10-05 06:22:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
main() {
|
|
|
|
OverrideFieldMethod2NegativeTest.testMain();
|
|
|
|
}
|