| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |