mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:47:13 +00:00
7d6cd21706
See https://github.com/dart-lang/sdk/issues/32613 and https://github.com/dart-lang/sdk/issues/33235#issue-326617285 Bug: #32613, #33235, #33237 Change-Id: I0d1432185b6811137e31135ac2c7f58c4de2de6c Reviewed-on: https://dart-review.googlesource.com/64500 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Erik Ernst <eernst@google.com>
35 lines
696 B
Dart
35 lines
696 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.
|
|
|
|
// A constructor can't be static.
|
|
class A {
|
|
static //# 00: compile-time error
|
|
A();
|
|
}
|
|
|
|
// A factory constructor can't be static.
|
|
class B {
|
|
static //# 01: syntax error
|
|
factory B() { return null; }
|
|
}
|
|
|
|
// A named constructor can have the same name as a setter.
|
|
class E {
|
|
set setter(value) {} //# 05: ok
|
|
E.setter();
|
|
}
|
|
|
|
// A constructor can't be static.
|
|
class F {
|
|
static //# 07: compile-time error
|
|
F(){}
|
|
}
|
|
|
|
main() {
|
|
new A();
|
|
new B();
|
|
new E.setter();
|
|
new F();
|
|
}
|