Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b98a1ee

Browse files
author
Dart CI
committed
Version 2.14.0-69.0.dev
Merge commit 'ee276843be651a82926eed4c56f6094ac4c62b3a' into 'dev'
2 parents 8c109a7 + ee27684 commit b98a1ee

File tree

2 files changed

+1
-329
lines changed

2 files changed

+1
-329
lines changed

pkg/analyzer/test/src/task/strong/checker_test.dart

Lines changed: 0 additions & 328 deletions
Original file line numberDiff line numberDiff line change
@@ -41,101 +41,6 @@ void foo(Object o) {
4141
]);
4242
}
4343

44-
test_classOverrideOfGrandInterface_interfaceOfAbstractSuperclass() async {
45-
await assertErrorsInCode('''
46-
class A {}
47-
class B {}
48-
49-
abstract class I1 {
50-
m(A a);
51-
}
52-
abstract class Base implements I1 {}
53-
54-
class T1 extends Base {
55-
m(B a) {}
56-
}
57-
''', [
58-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 119, 1),
59-
]);
60-
}
61-
62-
test_classOverrideOfGrandInterface_interfaceOfConcreteSuperclass() async {
63-
await assertErrorsInCode('''
64-
class A {}
65-
class B {}
66-
67-
abstract class I1 {
68-
m(A a);
69-
}
70-
71-
class Base implements I1 {}
72-
73-
class T1 extends Base {
74-
m(B a) {}
75-
}
76-
''', [
77-
error(
78-
CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE,
79-
62,
80-
4),
81-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 111, 1),
82-
]);
83-
}
84-
85-
test_classOverrideOfGrandInterface_interfaceOfInterfaceOfChild() async {
86-
await assertErrorsInCode('''
87-
class A {}
88-
class B {}
89-
90-
abstract class I1 {
91-
m(A a);
92-
}
93-
abstract class I2 implements I1 {}
94-
95-
class T1 implements I2 {
96-
m(B a) {}
97-
}
98-
''', [
99-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 118, 1),
100-
]);
101-
}
102-
103-
test_classOverrideOfGrandInterface_mixinOfInterfaceOfChild() async {
104-
await assertErrorsInCode('''
105-
class A {}
106-
class B {}
107-
108-
abstract class M1 {
109-
m(A a);
110-
}
111-
abstract class I2 extends Object with M1 {}
112-
113-
class T1 implements I2 {
114-
m(B a) {}
115-
}
116-
''', [
117-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 127, 1),
118-
]);
119-
}
120-
121-
test_classOverrideOfGrandInterface_superclassOfInterfaceOfChild() async {
122-
await assertErrorsInCode('''
123-
class A {}
124-
class B {}
125-
126-
abstract class I1 {
127-
m(A a);
128-
}
129-
abstract class I2 extends I1 {}
130-
131-
class T1 implements I2 {
132-
m(B a) {}
133-
}
134-
''', [
135-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 115, 1),
136-
]);
137-
}
138-
13944
test_compoundAssignment_returnsDynamic() async {
14045
await assertNoErrorsInCode(r'''
14146
class Foo {
@@ -299,18 +204,6 @@ main() {
299204
''');
300205
}
301206

302-
test_constructorInvalid() async {
303-
// Regression test for https://github.com/dart-lang/sdk/issues/26695
304-
await assertErrorsInCode('''
305-
class A {
306-
B({this.test: 1.0 }) {}
307-
final double test = 0.0;
308-
}
309-
''', [
310-
error(CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, 15, 9),
311-
]);
312-
}
313-
314207
test_constructors() async {
315208
await assertErrorsInCode('''
316209
const num z = 25;
@@ -440,65 +333,6 @@ void main() {
440333
]);
441334
}
442335

443-
test_covariantOverride() async {
444-
await assertErrorsInCode(r'''
445-
class C {
446-
num f(num x) => x;
447-
}
448-
class D extends C {
449-
int f(covariant int x) => x;
450-
}
451-
class E extends D {
452-
int f(Object x) => x;
453-
}
454-
class F extends E {
455-
int f(covariant int x) => x;
456-
}
457-
class G extends E implements D {}
458-
459-
class D_error extends C {
460-
int f(int x) => x;
461-
}
462-
class E_error extends D {
463-
int f(covariant double x) => 0;
464-
}
465-
class F_error extends E {
466-
int f(covariant double x) => 0;
467-
}
468-
class G_error extends E implements D {
469-
int f(covariant double x) => 0;
470-
}
471-
''', [
472-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 252, 1),
473-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 301, 1),
474-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 363, 1),
475-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 438, 1),
476-
]);
477-
}
478-
479-
@failingTest
480-
test_covariantOverride_fields() async {
481-
await assertNoErrorsInCode(r'''
482-
class A {
483-
get foo => '';
484-
set foo(_) {}
485-
}
486-
487-
class B extends A {
488-
covariant num foo;
489-
}
490-
class C extends A {
491-
covariant num foo;
492-
}
493-
class D extends C {
494-
int foo;
495-
}
496-
class E extends D {
497-
num foo;
498-
}
499-
''');
500-
}
501-
502336
test_covariantOverride_leastUpperBound() async {
503337
await assertNoErrorsInCode(r'''
504338
abstract class Top {}
@@ -638,168 +472,6 @@ void main() {
638472
]);
639473
}
640474

641-
test_factoryConstructorDowncast() async {
642-
await assertErrorsInCode(r'''
643-
class Animal {
644-
Animal();
645-
factory Animal.cat() => new Cat();
646-
}
647-
648-
class Cat extends Animal {}
649-
650-
void main() {
651-
Cat c = new Animal.cat();
652-
c = new Animal();
653-
}''', [
654-
error(HintCode.UNUSED_LOCAL_VARIABLE, 116, 1),
655-
error(CompileTimeErrorCode.INVALID_CAST_NEW_EXPR, 144, 12),
656-
]);
657-
}
658-
659-
test_fieldFieldOverride() async {
660-
await assertErrorsInCode('''
661-
class A {}
662-
class B extends A {}
663-
class C extends B {}
664-
665-
class Base {
666-
B f1;
667-
B f2;
668-
B f3;
669-
B f4;
670-
}
671-
672-
class Child extends Base {
673-
A f1; // invalid for getter
674-
C f2; // invalid for setter
675-
var f3;
676-
dynamic f4;
677-
}
678-
679-
class Child2 implements Base {
680-
A f1; // invalid for getter
681-
C f2; // invalid for setter
682-
var f3;
683-
dynamic f4;
684-
}
685-
''', [
686-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 133, 2),
687-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 163, 2),
688-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 209, 2),
689-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 251, 2),
690-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 281, 2),
691-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 327, 2),
692-
]);
693-
}
694-
695-
test_fieldGetterOverride() async {
696-
await assertErrorsInCode('''
697-
class A {}
698-
class B extends A {}
699-
class C extends B {}
700-
701-
abstract class Base {
702-
B f1;
703-
B f2;
704-
B f3;
705-
B f4;
706-
}
707-
708-
class Child extends Base {
709-
A get f1 => null;
710-
C get f2 => null;
711-
get f3 => null;
712-
dynamic get f4 => null;
713-
}
714-
715-
class Child2 implements Base {
716-
A get f1 => null;
717-
C get f2 => null;
718-
get f3 => null;
719-
dynamic get f4 => null;
720-
}
721-
''', [
722-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 146, 2),
723-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 210, 2),
724-
error(
725-
CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR,
726-
231,
727-
6),
728-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 264, 2),
729-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 328, 2),
730-
]);
731-
}
732-
733-
test_fieldOverride() async {
734-
await assertErrorsInCode('''
735-
typedef void ToVoid<T>(T x);
736-
class F {
737-
final ToVoid<dynamic> f = null;
738-
final ToVoid<int> g = null;
739-
}
740-
741-
class G extends F {
742-
final ToVoid<int> f = null;
743-
final ToVoid<dynamic> g = null;
744-
}
745-
746-
class H implements F {
747-
final ToVoid<int> f = null;
748-
final ToVoid<dynamic> g = null;
749-
}
750-
''', [
751-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 146, 1),
752-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 236, 1),
753-
]);
754-
}
755-
756-
test_fieldSetterOverride() async {
757-
await assertErrorsInCode('''
758-
class A {}
759-
class B extends A {}
760-
class C extends B {}
761-
762-
class Base {
763-
B f1;
764-
B f2;
765-
B f3;
766-
B f4;
767-
B f5;
768-
}
769-
770-
class Child extends Base {
771-
B get f1 => null;
772-
B get f2 => null;
773-
B get f3 => null;
774-
B get f4 => null;
775-
B get f5 => null;
776-
777-
void set f1(A value) {}
778-
void set f2(C value) {}
779-
void set f3(value) {}
780-
void set f4(dynamic value) {}
781-
set f5(B value) {}
782-
}
783-
784-
class Child2 implements Base {
785-
B get f1 => null;
786-
B get f2 => null;
787-
B get f3 => null;
788-
B get f4 => null;
789-
B get f5 => null;
790-
791-
void set f1(A value) {}
792-
void set f2(C value) {}
793-
void set f3(value) {}
794-
void set f4(dynamic value) {}
795-
set f5(B value) {}
796-
}
797-
''', [
798-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 275, 2),
799-
error(CompileTimeErrorCode.INVALID_OVERRIDE, 539, 2),
800-
]);
801-
}
802-
803475
test_functionModifiers_async() async {
804476
await assertErrorsInCode('''
805477
import 'dart:math' show Random;

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ CHANNEL dev
2727
MAJOR 2
2828
MINOR 14
2929
PATCH 0
30-
PRERELEASE 68
30+
PRERELEASE 69
3131
PRERELEASE_PATCH 0

0 commit comments

Comments
 (0)