Files
sdk/pkg/kernel/testcases/input/uninitialized_fields.dart
T
Asger Feldthaus becc43a03c [kernel] Add null initializers to fields that have no initializer.
That is, if a field has no declaration-site initializer and at least
one constructor in the class does not initialize it, then we add an
explicit null initializer for it.

BUG=
R=ahe@google.com

Review URL: https://chromereviews.googleplex.com/527827014 .

Committed: https://github.com/dart-lang/kernel/commit/63c241ee69fb41710b66df106626461539ce0187
2016-10-18 12:55:10 +02:00

28 lines
594 B
Dart

// Copyright (c) 2016, 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.
class Uninitialized {
int x;
}
class PartiallyInitialized {
int x;
PartiallyInitialized(this.x);
PartiallyInitialized.noInitializer();
}
class Initialized {
int x;
Initialized(this.x);
}
class Forwarding {
int x;
Forwarding.initialize(this.x);
Forwarding(int arg) : this.initialize(arg);
}
int uninitializedTopLevel;
int initializedTopLevel = 4;
main() {
}