Add tests for late and final variables without an initializer

Change-Id: I65c40b9e994e602f6133e100d0e8896cb9dce75c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101071
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/tests/language_2/nnbd/static_errors/late_final_without_initializer.dart b/tests/language_2/nnbd/static_errors/late_final_without_initializer.dart
new file mode 100644
index 0000000..a5cbe56
--- /dev/null
+++ b/tests/language_2/nnbd/static_errors/late_final_without_initializer.dart
@@ -0,0 +1,20 @@
+// 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.
+
+// SharedOptions=--enable-experiment=non-nullable
+
+// Test that it is not a compile time error to write to a `final` variable if
+// that variable is declared `late` and does not have an initializer.
+import 'package:expect/expect.dart';
+import 'dart:core';
+
+main() {
+  late final a;
+  late final b = 0;
+}
+
+class C {
+  late final a;
+  late final b = 0;
+}