Files
sdk/pkg/front_end/testcases/nnbd/issue43689.dart
T
Johnni Winther db98b69aea [cfe] Handle duplicate late fields
Flow analysis was failing on our encoding of duplicate late variables.
We add an invalid expression as the initializer on duplicate variables
and flow analysis was seeing this as if the late variable had (declared)
initializer. Changed to use the `hasDeclaredInitializer` flag on
VariableDeclarationImpl to bypass flow analysis in the synthesized
initializer.

Closes #43689

Change-Id: I483caa3bbc3347eb547826e9615a40fe62b586d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167741
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-15 13:16:06 +00:00

16 lines
336 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.
late final int y;
late final int? y;
test() {
late final int x;
late final int? x;
int z;
int? z;
}
main() {}