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

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

Issue 2668493002: Issue 28547. Fix for summarizing code with invalid type parameter reference. (Closed)
Patch Set: Created 3 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 analyzer.test.src.summary.summary_common; 5 library analyzer.test.src.summary.summary_common;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/dart/ast/ast.dart'; 8 import 'package:analyzer/dart/ast/ast.dart';
9 import 'package:analyzer/error/listener.dart'; 9 import 'package:analyzer/error/listener.dart';
10 import 'package:analyzer/src/dart/scanner/reader.dart'; 10 import 'package:analyzer/src/dart/scanner/reader.dart';
(...skipping 9870 matching lines...) Expand 10 before | Expand all | Expand 10 after
9881 checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map', 9881 checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map',
9882 numTypeParameters: 2, numTypeArguments: 2); 9882 numTypeParameters: 2, numTypeArguments: 2);
9883 checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'dart:core', 'int'); 9883 checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'dart:core', 'int');
9884 checkTypeRef(typeRef.typeArguments[1], 'dart:core', 'dart:core', 'Object'); 9884 checkTypeRef(typeRef.typeArguments[1], 'dart:core', 'dart:core', 'Object');
9885 } 9885 }
9886 9886
9887 test_type_dynamic() { 9887 test_type_dynamic() {
9888 checkDynamicTypeRef(serializeTypeText('dynamic')); 9888 checkDynamicTypeRef(serializeTypeText('dynamic'));
9889 } 9889 }
9890 9890
9891 test_type_invalid_typeParameter_asPrefix() {
9892 UnlinkedClass c = serializeClassText('''
9893 class C<T> {
9894 m(T.K p) {}
9895 }
9896 ''');
9897 UnlinkedExecutable m = c.executables[0];
9898 expect(m.name, 'm');
9899 checkTypeRef(m.parameters[0].type, null, null, 'dynamic');
9900 }
9901
9891 test_type_param_codeRange() { 9902 test_type_param_codeRange() {
9892 if (!includeInformative) return; 9903 if (!includeInformative) return;
9893 UnlinkedClass cls = 9904 UnlinkedClass cls =
9894 serializeClassText('class A {} class C<T extends A> {}'); 9905 serializeClassText('class A {} class C<T extends A> {}');
9895 UnlinkedTypeParam typeParameter = cls.typeParameters[0]; 9906 UnlinkedTypeParam typeParameter = cls.typeParameters[0];
9896 _assertCodeRange(typeParameter.codeRange, 19, 11); 9907 _assertCodeRange(typeParameter.codeRange, 19, 11);
9897 } 9908 }
9898 9909
9899 test_type_param_not_shadowed_by_constructor() { 9910 test_type_param_not_shadowed_by_constructor() {
9900 UnlinkedClass cls = 9911 UnlinkedClass cls =
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
10673 class _PrefixExpectation { 10684 class _PrefixExpectation {
10674 final ReferenceKind kind; 10685 final ReferenceKind kind;
10675 final String name; 10686 final String name;
10676 final String absoluteUri; 10687 final String absoluteUri;
10677 final String relativeUri; 10688 final String relativeUri;
10678 final int numTypeParameters; 10689 final int numTypeParameters;
10679 10690
10680 _PrefixExpectation(this.kind, this.name, 10691 _PrefixExpectation(this.kind, this.name,
10681 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); 10692 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0});
10682 } 10693 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698