Files
sdk/pkg/front_end/testcases/inference/recursive_generic_function.dart
T
Paul Berry 1891084dec Generate fresh type parameters prior to inferring an invocation.
This is necessary to avoid confusion when a generic function or method
recursively calls itself.

Fixes #31759.

Change-Id: I4e3be2093e9d6b81f084250435ea7493ca6b2464
Reviewed-on: https://dart-review.googlesource.com/36363
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-24 19:41:58 +00:00

17 lines
626 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.
/*@testedFeatures=inference*/
library test;
void _mergeSort<T>(
T Function(T) list, int compare(T a, T b), T Function(T) target) {
/*@typeArgs=_mergeSort::T*/ _mergeSort(list, compare, target);
/*@typeArgs=_mergeSort::T*/ _mergeSort(list, compare, list);
/*@typeArgs=_mergeSort::T*/ _mergeSort(target, compare, target);
/*@typeArgs=_mergeSort::T*/ _mergeSort(target, compare, list);
}
main() {}