Files
sdk/tests/language_2/static_setter_conflicts_test.dart
T
Aske Simon Christensen 90e27b19ea Check for conflicts between a static setter and a constructor or static method.
Bug: https://github.com/dart-lang/sdk/issues/33237
Change-Id: I44c69f32039de9b024c942706e96bf1998217350
Reviewed-on: https://dart-review.googlesource.com/60583
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-06-28 11:47:33 +00:00

27 lines
847 B
Dart

// Copyright (c) 2018, 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.
class C {
static set foo(int x) {}
int foo(int x) => x; //# 01: compile-time error
static int foo(int x) => x; //# 02: compile-time error
int foo = 3; //# 03: compile-time error
final int foo = 4; //# 04: compile-time error
static int foo = 5; //# 05: compile-time error
static final int foo = 6; //# 06: ok
int get foo => 7; //# 07: compile-time error
static int get foo => 8; //# 08: ok
set foo(int x) {} //# 09: compile-time error
static set foo(int x) {} //# 10: compile-time error
C.foo(int x) {} //# 11: compile-time error
factory C.foo(int x) => null; //# 12: compile-time error
}
main() {}