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

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

Issue 1835313002: Fix AST summarization when there are explicit calls to super constructors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/src/dart/scanner/reader.dart'; 10 import 'package:analyzer/src/dart/scanner/reader.dart';
(...skipping 4032 matching lines...) Expand 10 before | Expand all | Expand 10 after
4043 ''' 4043 '''
4044 enum E { v } 4044 enum E { v }
4045 class C extends E { 4045 class C extends E {
4046 const C(); 4046 const C();
4047 } 4047 }
4048 ''', 4048 ''',
4049 allowErrors: true); 4049 allowErrors: true);
4050 checkConstCycle('C', hasCycle: false); 4050 checkConstCycle('C', hasCycle: false);
4051 } 4051 }
4052 4052
4053 test_constructorCycle_viaSupertype_explicit() {
4054 serializeLibraryText('''
4055 class C {
4056 final x;
4057 const C() : x = const D();
4058 const C.named() : x = const D.named();
4059 }
4060 class D extends C {
4061 const D() : super();
4062 const D.named() : super.named();
4063 }
4064 ''');
4065 checkConstCycle('C');
4066 checkConstCycle('C', name: 'named');
4067 checkConstCycle('D');
4068 checkConstCycle('D', name: 'named');
4069 }
4070
4071 test_constructorCycle_viaSupertype_explicit_undefined() {
4072 // It's not valid Dart but we need to make sure it doesn't crash
4073 // summary generation.
4074 serializeLibraryText(
4075 '''
4076 class C {
4077 final x;
4078 const C() : x = const D();
4079 }
4080 class D extends C {
4081 const D() : super.named();
4082 }
4083 ''',
4084 allowErrors: true);
4085 checkConstCycle('C', hasCycle: false);
4086 checkConstCycle('D', hasCycle: false);
4087 }
4088
4053 test_constructorCycle_viaSupertype_withDefaultTypeArgument() { 4089 test_constructorCycle_viaSupertype_withDefaultTypeArgument() {
4054 serializeLibraryText(''' 4090 serializeLibraryText('''
4055 class C<T> { 4091 class C<T> {
4056 final x; 4092 final x;
4057 const C() : x = const D(); 4093 const C() : x = const D();
4058 } 4094 }
4059 class D extends C { 4095 class D extends C {
4060 const D(); 4096 const D();
4061 } 4097 }
4062 '''); 4098 ''');
(...skipping 3738 matching lines...) Expand 10 before | Expand all | Expand 10 after
7801 class _PrefixExpectation { 7837 class _PrefixExpectation {
7802 final ReferenceKind kind; 7838 final ReferenceKind kind;
7803 final String name; 7839 final String name;
7804 final String absoluteUri; 7840 final String absoluteUri;
7805 final String relativeUri; 7841 final String relativeUri;
7806 final int numTypeParameters; 7842 final int numTypeParameters;
7807 7843
7808 _PrefixExpectation(this.kind, this.name, 7844 _PrefixExpectation(this.kind, this.name,
7809 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); 7845 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0});
7810 } 7846 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698