Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 1694763003: Test and fix resynthesis of nested generic functions. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove workarounds now that #25769 is fixed Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.src.serialization.elements_test; 5 library test.src.serialization.elements_test;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 2976 matching lines...) Expand 10 before | Expand all | Expand 10 after
2987 test_method_type_parameter_in_generic_class() { 2987 test_method_type_parameter_in_generic_class() {
2988 resetWithOptions(new AnalysisOptionsImpl()..enableGenericMethods = true); 2988 resetWithOptions(new AnalysisOptionsImpl()..enableGenericMethods = true);
2989 checkLibrary('class C<T, U> { V f<V, W>(T t, U u, W w) => null; }'); 2989 checkLibrary('class C<T, U> { V f<V, W>(T t, U u, W w) => null; }');
2990 } 2990 }
2991 2991
2992 test_method_type_parameter_with_function_typed_parameter() { 2992 test_method_type_parameter_with_function_typed_parameter() {
2993 resetWithOptions(new AnalysisOptionsImpl()..enableGenericMethods = true); 2993 resetWithOptions(new AnalysisOptionsImpl()..enableGenericMethods = true);
2994 checkLibrary('class C { void f<T, U>(T x(U u)) {} }'); 2994 checkLibrary('class C { void f<T, U>(T x(U u)) {} }');
2995 } 2995 }
2996 2996
2997 test_nested_generic_functions_in_generic_class_with_function_typed_params() {
2998 checkLibrary('''
2999 class C<T, U> {
3000 void g<V, W>() {
3001 void h<X, Y>(void p(T t, U u, V v, W w, X x, Y y)) {
3002 }
3003 }
3004 }
3005 ''');
3006 }
3007
3008 test_nested_generic_functions_in_generic_class_with_local_variables() {
3009 checkLibrary('''
3010 class C<T, U> {
3011 void g<V, W>() {
3012 void h<X, Y>() {
3013 T t;
3014 U u;
3015 V v;
3016 W w;
3017 X x;
3018 Y y;
3019 }
3020 }
3021 }
3022 ''');
3023 }
3024
3025 test_nested_generic_functions_with_function_typed_param() {
3026 checkLibrary('''
3027 void f<T, U>() {
3028 void g<V, W>() {
3029 void h<X, Y>(void p(T t, U u, V v, W w, X x, Y y)) {
3030 }
3031 }
3032 }
3033 ''');
3034 }
3035
3036 test_nested_generic_functions_with_local_variables() {
3037 checkLibrary('''
3038 void f<T, U>() {
3039 void g<V, W>() {
3040 void h<X, Y>() {
3041 T t;
3042 U u;
3043 V v;
3044 W w;
3045 X x;
3046 Y y;
3047 }
3048 }
3049 }
3050 ''');
3051 }
3052
2997 test_operator() { 3053 test_operator() {
2998 checkLibrary('class C { C operator+(C other) => null; }'); 3054 checkLibrary('class C { C operator+(C other) => null; }');
2999 } 3055 }
3000 3056
3001 test_operator_equal() { 3057 test_operator_equal() {
3002 checkLibrary('class C { bool operator==(Object other) => false; }'); 3058 checkLibrary('class C { bool operator==(Object other) => false; }');
3003 } 3059 }
3004 3060
3005 test_operator_external() { 3061 test_operator_external() {
3006 checkLibrary('class C { external C operator+(C other); }'); 3062 checkLibrary('class C { external C operator+(C other); }');
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
3417 fail('Unexpectedly tried to get unlinked summary for $uri'); 3473 fail('Unexpectedly tried to get unlinked summary for $uri');
3418 } 3474 }
3419 return serializedUnit; 3475 return serializedUnit;
3420 } 3476 }
3421 3477
3422 @override 3478 @override
3423 bool hasLibrarySummary(String uri) { 3479 bool hasLibrarySummary(String uri) {
3424 return true; 3480 return true;
3425 } 3481 }
3426 } 3482 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698