-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for conflicts between a static setter and a constructor or stat…
…ic method. Bug: #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>
- Loading branch information
Showing
6 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// 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() {} |