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

Unified Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 1140963002: Issue 23444. Use ConstructorMember(s) for super constructor fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/services/correction/fix_test.dart
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index e9e14e1327981773385d2c4d07bfadd688caffcf..1b4af7d502dab1bbf60f7cf31a1d3e78bebac9db 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -517,6 +517,25 @@ class B extends A {
assertNoFix(DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION);
}
+ void test_createConstructorSuperExplicit_typeArgument() {
+ resolveTestUnit('''
+class A<T> {
+ A(T p);
+}
+class B extends A<int> {
+ B();
+}
+''');
+ assertHasFix(DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION, '''
+class A<T> {
+ A(T p);
+}
+class B extends A<int> {
+ B() : super(0);
+}
+''');
+ }
+
void test_createConstructorSuperImplicit() {
resolveTestUnit('''
class A {
@@ -631,6 +650,24 @@ class B extends A {
assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_SUPER);
}
+ void test_createConstructorSuperImplicit_typeArgument() {
+ resolveTestUnit('''
+class C<T> {
+ final T x;
+ C(this.x);
+}
+class D extends C<int> {
+}''');
+ assertHasFix(DartFixKind.CREATE_CONSTRUCTOR_SUPER, '''
+class C<T> {
+ final T x;
+ C(this.x);
+}
+class D extends C<int> {
+ D(int x) : super(x);
+}''');
+ }
+
void test_createField_BAD_inEnum() {
resolveTestUnit('''
enum MyEnum {

Powered by Google App Engine
This is Rietveld 408576698