Files
sdk/pkg/front_end/testcases/inference/instance_creation_downwards.dart
T
Paul Berry 4eee6cb5ea Fix constructor invocation type inference.
Three problems are fixed:

- I forgot to pass the `downwards` flag when doing downwards inference.

- I forgot to initialize the `formalTypes` and `actualTypes` arrays.

- I wasn't tracking whether constructor type arguments were implicit
  or explicit, so constructor type inference wasn't actually
  happening.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2864853002 .
2017-05-08 14:41:56 -07:00

18 lines
426 B
Dart

// Copyright (c) 2017, 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.
/*@testedFeatures=inference*/
library test;
class A<T> {
A(B<List<T>> b);
}
class B<T> {}
main() {
var /*@type=A<dynamic>*/ x =
new /*@typeArgs=dynamic*/ A(new /*@typeArgs=List<dynamic>*/ B());
}