9ca19cac6f
Function type parameters in occurring in constants were using an offset based on the context in which the constant first occurred. This meant that function type parameters occurring in a generic context would have a different offset that those occurring in a non-generic context. The loading of .dill in ast_from_binary would read all constants outside the context and would therefore get the indices wrong on generic function types. This CL changes the encoding of these type parameters to always use a fresh context. Closes #45415 TEST=pkg/front_end/testcases/generic_metadata/from_dill/main.dart Change-Id: Ifdaedb4581f1e022c908fc58a58ceac3d7b0900e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193481 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
27 lines
653 B
Dart
27 lines
653 B
Dart
// Copyright (c) 2021, 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.
|
|
|
|
import 'main_lib.dart';
|
|
|
|
main() {
|
|
C1 c1 = C1();
|
|
C1 c2 = C1<T Function<T>(T)>();
|
|
|
|
C2 c3 = C2();
|
|
C2 c4 = C2<void Function<int>()>();
|
|
|
|
C3 c5 = C3();
|
|
C3 c6 = C3<T Function<T>()>();
|
|
|
|
C4 c7 = C4();
|
|
C4 c8 = C4<void Function<T>(T)>();
|
|
|
|
C5 c9 = C5();
|
|
C5 c10 = C5<T Function<T extends S Function<S>(S)>(T)>();
|
|
|
|
C6 c11 = C6();
|
|
C6 c12 = C6<
|
|
T Function<T, S>(T, S, V Function<V extends S, U>(T, U, V, Map<S, U>))>();
|
|
}
|