Files
sdk/pkg/front_end/testcases/nnbd_mixed/opt_out.dart
T
Johnni Winther 05c70ab355 [cfe] Update tests after language version change
In response to #45461

Change-Id: I5bc6234cf6c6ca620e322697aeb0a0c2a04d4ffd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194066
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-04-07 09:44:07 +00:00

37 lines
680 B
Dart

// Copyright (c) 2019, 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.
// @dart=2.12
// This file contains benign use of NNBD features that shouldn't result in
// compile-time errors.
import 'opt_out_lib.dart';
class A<T> {
late int field = 42;
}
class B extends A<String?> {}
typedef F = void Function()?;
List<String?> l = [];
String? s = null;
var t = s!;
late int field = 42;
void method(void f()?, {required int a}) {}
main() {}
noErrors() {
late int local = 42;
String? s = null;
dynamic c;
c?..f;
c?[0];
}