62f84880ef
Closes #40520 Closes #40948 Closes #40425 Change-Id: I0aa3cfa51b410c90dd0bea963846eeb6b2e73efb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140540 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
41 lines
621 B
Dart
41 lines
621 B
Dart
// Copyright (c) 2020, 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.
|
|
|
|
// This test checks for compile-time errors related to definite assignment and
|
|
// completion.
|
|
|
|
int foo() {
|
|
int x;
|
|
return x;
|
|
}
|
|
|
|
int bar() => 0;
|
|
|
|
int baz(int x) {
|
|
return x;
|
|
}
|
|
|
|
int boz(int x) => x;
|
|
|
|
class Class {
|
|
final int x;
|
|
|
|
const Class(int x) : this.x = x;
|
|
|
|
int foo() {
|
|
int x;
|
|
return x;
|
|
}
|
|
|
|
int bar() => 0;
|
|
|
|
int baz(int x) {
|
|
return x;
|
|
}
|
|
|
|
int boz(int x) => x;
|
|
}
|
|
|
|
main() {}
|