Files
sdk/tests/language/abstract/syntax_error_test.dart
Robert Nystrom 1d684cdfb0 Reformat tests/language/abstract.
Change-Id: I18bbc65a798e79fb5e69a9a4134c10a9f6cdbb3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399860
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-12-11 23:31:53 -08:00

28 lines
689 B
Dart

// Copyright (c) 2012, 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";
main() {
var b = new B();
Expect.equals(42, b.foo());
}
class A {
// ^
// [cfe] The non-abstract class 'A' is missing implementations for these members:
foo();
//^^^^^^
// [analyzer] COMPILE_TIME_ERROR.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER
static bar();
// ^
// [analyzer] SYNTACTIC_ERROR.MISSING_FUNCTION_BODY
// [cfe] Expected a function body or '=>'.
}
class B extends A {
foo() => 42;
bar() => 87;
}