Files
sdk/pkg/front_end/testcases/bug32866.dart
T
Kevin Millikin b0cbc4e9cd Fix a bug in top-level type inference dependency tracking
When there was a top-level type inference dependency from a declared
field to an overridden getter or setter, the dependency was not
recorded in the field.  This caused initializing formals to sometimes
fail to infer the field type, because they did not see that it needed
to be inferred.

Fixes https://github.com/dart-lang/sdk/issues/32866

Change-Id: If75658d087c099787f74af5f5c6db2ee6837febe
Reviewed-on: https://dart-review.googlesource.com/62800
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-06-28 11:47:24 +00:00

19 lines
504 B
Dart

// Copyright (c) 2018, 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.
// Regression test that top-level inference correctly handles dependencies from
// top-level field -> initializing formal -> field that overrides a getter.
abstract class B {
String get f;
}
class A implements B {
final f;
A(this.f);
}
var a = new A("foo");
main() => print(a);