Clean up a number of 2.19 opt outs in language tests.

This is less than half of them, will send some other chunks later.

Bug:51557
Change-Id: I4e80812a689fde99e23c34b6405aaf57cd431ce8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289261
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
This commit is contained in:
Jake Macdonald 2023-03-17 16:17:50 +00:00 committed by Commit Queue
parent e34165c543
commit 3b06df241f
83 changed files with 158 additions and 443 deletions

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
library map_test;
import "package:expect/expect.dart";
@ -858,7 +854,7 @@ class Mutable {
}
// Slow implementation of Map based on MapBase.
abstract class MapBaseOperations<K, V> {
mixin class MapBaseOperations<K, V> {
final List _keys = <K>[];
final List _values = <V>[];
int _modCount = 0;

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
import 'dart:collection';
import 'dart:convert' show json;
@ -130,7 +126,7 @@ void testNonNull(Map<Comparable?, Object?> map) {
}
// Slow implementation of Map based on MapBase.
abstract class MapBaseOperations<K, V> {
mixin class MapBaseOperations<K, V> {
final List _keys = <K>[];
final List _values = <V>[];
int _modCount = 0;

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class A {
@ -25,7 +21,7 @@ class C extends B {
int get x => super.x;
}
class GetterConcrete {
mixin class GetterConcrete {
var _foo;
get foo => _foo;

View file

@ -2,8 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -2,8 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -5,8 +5,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -5,8 +5,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -5,8 +5,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -5,8 +5,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -5,8 +5,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -2,8 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -2,8 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -2,8 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -2,8 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Implements Function which is not allowed in Dart 3.
// @dart=2.19
// Dart test program to test arithmetic operations.

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that inheriting types on overriding members work as specified.
// ignore_for_file: unused_local_variable
@ -47,7 +43,7 @@ class INumInt {
int foo(num x) => x.toInt();
}
class IIntNum {
mixin class IIntNum {
num foo(int x) => x.toInt();
}

View file

@ -2,11 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class Mixin {
mixin Mixin {
var nonFinalField;
}

View file

@ -2,11 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class Mixin {}
mixin Mixin {}
class A {
const A();

View file

@ -2,11 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class Mixin {}
mixin Mixin {}
class A {
const A(foo);

View file

@ -2,17 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that it is an error for a class with no generative constructors to
// have a final instance variable without an initializing expression, except
// if it is `abstract` or `external`. The latter also holds in a class with
// generative constructors.
// Has factory, hence no default, hence no generative constructors.
abstract class A {
abstract mixin class A {
final dynamic n;
// ^
// [analyzer] COMPILE_TIME_ERROR.FINAL_NOT_INITIALIZED

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test super constructor invocation with mixins.
// Regression test for issue dartbug.com/22604
@ -21,7 +17,7 @@ class A {
}
}
class I {}
mixin I {}
class B extends A with I {
int y;

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class A {}
@ -67,11 +63,11 @@ abstract class D<T> {
void set m1(T x);
}
class E {
mixin E {
void set m1(A x) {}
}
class F = Object with E implements D<A>;
mixin class F = Object with E implements D<A>;
class G = C with E implements D<A>;
class H extends Object with E implements D<A> {}

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import 'package:expect/expect.dart';
class Fields<T> {
@ -132,7 +128,7 @@ testFieldOfGenericFunctionType() {
cNum.g(42);
}
class Base {
mixin class Base {
int _t = 0;
add(int t) {
_t += t;

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import 'package:expect/expect.dart';
class A {}
@ -14,7 +10,7 @@ class B extends A {}
class Base<S> {}
class Mixin<T> {
mixin Mixin<T> {
void f(T arg) {}
}

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
// If a parameter is directly or indirectly a covariant override, its type in
@ -21,11 +17,11 @@ typedef void TakeOptionalObjectsAndInts([Object? a, int b, Object? c, int d]);
typedef void TakeNamedInts({int a, int b, int c, int d});
typedef void TakeNamedObjectsAndInts({Object? a, int b, Object? c, int d});
class M1 {
mixin M1 {
method(covariant int a, int b) {}
}
class M2 {
mixin M2 {
method(int a, covariant int b) {}
}
@ -87,11 +83,11 @@ class Interface2 {
void method(int a, covariant int b, int c, int d, int e) {}
}
class Mixin1 {
mixin Mixin1 {
void method(int a, int b, covariant int c, int d, int e) {}
}
class Mixin2 {
mixin Mixin2 {
void method(int a, int b, int c, covariant int d, int e) {}
}

View file

@ -5,14 +5,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
import "inheritance_constraints_lib.dart" deferred as lib;
class Foo {}
mixin class Foo {}
class Foo2 extends D {}

View file

@ -2,16 +2,12 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
library lib1;
import "mixin_shared.dart";
import "mixin_test.dart";
class Mixin {
mixin class Mixin {
foo() => "lib1.Mixin";
}

View file

@ -2,12 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
library shared;
class SharedMixin {
mixin SharedMixin {
foo() => "SharedMixin";
}

View file

@ -2,25 +2,21 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import 'package:expect/expect.dart';
import 'package:async_helper/async_helper.dart';
import "mixin_lib1.dart" deferred as lib1;
import "mixin_lib2.dart" deferred as lib2;
class NonDeferredMixin {
mixin class NonDeferredMixin {
foo() => "NonDeferredMixin";
}
class NonDeferredMixin1 {
mixin class NonDeferredMixin1 {
foo() => "NonDeferredMixin1";
}
class NonDeferredMixin2 {
mixin class NonDeferredMixin2 {
foo() => "NonDeferredMixin2";
}

View file

@ -5,10 +5,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that parameter types are checked correctly in the face of
// mixin application upon a generic constructor.
@ -18,9 +14,9 @@ class A<X> {
A(X x);
}
class B {}
mixin B {}
class C {}
mixin C {}
class D<Y> = A<Y> with B, C;

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that parameter types are checked correctly in the face of
// mixin application upon a generic constructor.
@ -15,9 +11,9 @@ class A<X> {
A(X x);
}
class B {}
mixin B {}
class C {}
mixin C {}
class D<Y> = A<Y> with B, C;

View file

@ -5,10 +5,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that parameter types are checked correctly in the face of
// mixin application upon a generic constructor.
@ -18,7 +14,7 @@ class A<X> {
A(X x);
}
class B {}
mixin B {}
class C1 = A<int> with B;
class C2 = A<String> with B;

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that parameter types are checked correctly in the face of
// mixin application upon a generic constructor.
@ -15,7 +11,7 @@ class A<X> {
A(X x);
}
class B {}
mixin B {}
class C1 = A<int> with B;
class C2 = A<String> with B;

View file

@ -5,10 +5,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that parameter types are checked correctly in the face of
// mixin application upon a generic constructor.
@ -18,7 +14,7 @@ class A<X> {
A(X x);
}
class B {}
mixin B {}
class C<Y> = A<Y> with B;

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that parameter types are checked correctly in the face of
// mixin application upon a generic constructor.
@ -15,7 +11,7 @@ class A<X> {
A(X x);
}
class B {}
mixin B {}
class C<Y> = A<Y> with B;

View file

@ -2,15 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that generic types in mixins are handled.
import 'package:expect/expect.dart';
class M<T> {
mixin M<T> {
var field = T;
}

View file

@ -2,15 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that generic types in mixins are handled.
import 'package:expect/expect.dart';
class M<T> {
mixin M<T> {
var field = new A<int>() is A<T>;
}

View file

@ -2,15 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that generic types in mixins are handled.
import 'package:expect/expect.dart';
class M<T> {
mixin M<T> {
bool field = () {
try {
throw 0;

View file

@ -2,15 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that generic types in mixins are handled.
import 'package:expect/expect.dart';
class M<T> {
mixin M<T> {
Type field = () {
return T;
}();

View file

@ -5,15 +5,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that generic types in mixins are handled.
import 'package:expect/expect.dart';
class M<T> {
mixin M<T> {
T field2 = 0 as dynamic;
}

View file

@ -2,15 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that generic types in mixins are handled.
import 'package:expect/expect.dart';
class M<T> {
mixin M<T> {
T field1 = 0;
// ^
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT

View file

@ -2,15 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that generic types in mixins are handled.
import 'package:expect/expect.dart';
class M<T> {
mixin M<T> {
var field = new A<T>();
}

View file

@ -2,17 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test that instanceof works correctly with type variables.
import "package:expect/expect.dart";
class A {}
class B<T, S> {}
mixin B<T, S> {}
class C<U, V> extends A with B<V, U> {}

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import 'package:expect/expect.dart';
typedef Convert1<O> = O Function<I>(I input);
@ -13,7 +9,7 @@ typedef Convert2<I> = O Function<O>(I input);
typedef Convert3 = O Function<I, O>(I input);
typedef Other(a, b);
class Mixin<E> {
mixin Mixin<E> {
E convert1<I>(I input) => throw "uncalled";
}

View file

@ -2,14 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Tests that malformed types used in extends, implements, and with clauses
// cause compile-time errors.
class A<T> {}
mixin class A<T> {}
class C
extends Unresolved

View file

@ -2,13 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import 'package:expect/expect.dart';
abstract class B {
mixin B {
int get x;
}

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Regression test case for DDC bug where if a getter/setter is mixed in
// without a corresponding getter/setter, DDC fails to install a the
// corresponding getter/setter that calls super.
@ -19,7 +15,7 @@ abstract class C<E> {
operator []=(int index, E value);
}
abstract class CMixin<E> implements C<E> {
mixin CMixin<E> implements C<E> {
E get first => this[0];
set first(E x) {
this[0] = x;
@ -28,7 +24,7 @@ abstract class CMixin<E> implements C<E> {
abstract class CBase<E> extends Object with CMixin<E> {}
abstract class DMixin<E> implements C<E> {
mixin DMixin<E> implements C<E> {
set first(E _) => throw new UnsupportedError('');
operator []=(int index, E value) => throw new UnsupportedError('');
}
@ -41,7 +37,7 @@ class DView<E> extends DBase<E> {
E operator [](int index) => _source.elementAt(index);
}
abstract class FMixin<E> implements C<E> {
mixin FMixin<E> implements C<E> {
E get first => throw new UnsupportedError('');
E operator [](int index) => throw new UnsupportedError('');
}

View file

@ -2,14 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import 'dart:collection';
import 'package:expect/expect.dart';
class OverrideFirstGetter {
mixin OverrideFirstGetter {
get first => 9999;
}

View file

@ -2,17 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Check mixin of black-listed types.
import 'package:expect/expect.dart';
class C {}
mixin C {}
class D {}
mixin D {}
class C1 extends Object
with String //# 01: compile-time error

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
// library abstract_expressions;
@ -29,23 +25,23 @@ abstract class AbstractNumber {
// library evaluator;
abstract class ExpressionWithEval {
abstract mixin class ExpressionWithEval {
int get eval;
}
abstract class AdditionWithEval<E extends ExpressionWithEval> {
abstract mixin class AdditionWithEval<E extends ExpressionWithEval> {
E get operand1;
E get operand2;
int get eval => operand1.eval + operand2.eval;
}
abstract class SubtractionWithEval<E extends ExpressionWithEval> {
abstract mixin class SubtractionWithEval<E extends ExpressionWithEval> {
E get operand1;
E get operand2;
int get eval => operand1.eval - operand2.eval;
}
abstract class NumberWithEval {
abstract mixin class NumberWithEval {
int get val;
int get eval => val;
}
@ -61,7 +57,7 @@ abstract class AbstractMultiplication<E> {
// import 'evaluator.dart' show ExpressionWithEval;
abstract class MultiplicationWithEval<E extends ExpressionWithEval> {
abstract mixin class MultiplicationWithEval<E extends ExpressionWithEval> {
E get operand1;
E get operand2;
int get eval => operand1.eval * operand2.eval;
@ -69,30 +65,30 @@ abstract class MultiplicationWithEval<E extends ExpressionWithEval> {
// library string_converter;
abstract class ExpressionWithStringConversion {
abstract mixin class ExpressionWithStringConversion {
String toString();
}
abstract class AdditionWithStringConversion<
abstract mixin class AdditionWithStringConversion<
E extends ExpressionWithStringConversion> {
E get operand1;
E get operand2;
String toString() => '($operand1 + $operand2))';
}
abstract class SubtractionWithStringConversion<
abstract mixin class SubtractionWithStringConversion<
E extends ExpressionWithStringConversion> {
E get operand1;
E get operand2;
String toString() => '($operand1 - $operand2)';
}
abstract class NumberWithStringConversion {
abstract mixin class NumberWithStringConversion {
int get val;
String toString() => val.toString();
}
abstract class MultiplicationWithStringConversion<
abstract mixin class MultiplicationWithStringConversion<
E extends ExpressionWithStringConversion> {
E get operand1;
E get operand2;

View file

@ -5,17 +5,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test for cyclicity check on named mixin applications.
class A<T> {}
class S {}
class M<T> {}
mixin M<T> {}
class C1 = S with M;

View file

@ -2,17 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test for cyclicity check on named mixin applications.
class A<T> {}
class S {}
class M<T> {}
mixin M<T> {}
class C1 = S with M;
class C2 = S with C2;

View file

@ -2,21 +2,17 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class S {
var foo = "S-foo";
}
class M1 {
mixin M1 {
final bar = "M1-bar";
}
class M2 {
mixin M2 {
var baz = "M2-baz";
}

View file

@ -2,17 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class S {}
class M1 {}
mixin M1 {}
class M2 {}
mixin M2 {}
class C extends S with M1 {}

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class S {
@ -13,12 +9,12 @@ class S {
baz() => "S-baz";
}
class M1 {
mixin M1 {
static m1bar() => "M1-bar";
bar() => m1bar();
}
class M2 {
mixin M2 {
bar() => "M2-bar";
baz() => "M2-baz";
fez() => "M2-fez";

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class Base {
@ -15,7 +11,7 @@ class Base {
}
}
abstract class Mixin implements Base {
abstract mixin class Mixin implements Base {
final x = "hello";
factory Mixin() => new _MixinAndBase._();
}

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Dart test program for testing throw statement
import 'package:expect/expect.dart';
@ -17,7 +13,7 @@ class S {
good_stuff() => "Glenfiddich";
class M {
mixin class M {
var m1 = good_stuff();
static good_stuff() => "Macallen";
}

View file

@ -2,21 +2,17 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class S {
var foo = "S-foo";
}
class M1 {
mixin M1 {
final bar = "M1-bar";
}
class M2 {
mixin M2 {
var baz = "M2-baz";
}

View file

@ -2,17 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
abstract class Mixin1 {
mixin Mixin1 {
var mixin1Field = 1;
}
abstract class Mixin2 {
mixin Mixin2 {
var mixin2Field = 2;
}

View file

@ -2,17 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
abstract class Mixin1 {
mixin Mixin1 {
var mixin1Field = 1;
}
abstract class Mixin2 {
mixin Mixin2 {
var mixin2Field = 2;
}

View file

@ -2,20 +2,16 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Verify that a named mixin constructor forwards to the corresponding named
// base class constructor.
import "package:expect/expect.dart";
abstract class Mixin1 {
mixin Mixin1 {
var mixin1Field = 1;
}
abstract class Mixin2 {
mixin Mixin2 {
var mixin2Field = 2;
}

View file

@ -2,14 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Verify that a forwarding constructor is generated even when there is an
// optional parameter.
abstract class Mixin {}
mixin Mixin {}
class Base {
Base(

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test for calling a method for which a forwarding super stub has been
// inserted.
@ -15,7 +11,7 @@ class Super<T> {
void method(T t) {}
}
class Mixin {
mixin Mixin {
void method(int t) {}
}

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test for assigning to a field for which a forwarding super stub has been
// inserted.
@ -15,7 +11,7 @@ class Super<T> {
T? field;
}
class Mixin {
mixin Mixin {
int? field;
}

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Test for tearing off a method for which a forwarding super stub has been
// inserted.
@ -15,7 +11,7 @@ class Super<T> {
void method(T t) {}
}
class Mixin {
mixin Mixin {
void method(int t) {}
}

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class S<T> {
@ -14,13 +10,13 @@ class S<T> {
}
}
class M<T> {
mixin M<T> {
m() {
return T;
}
}
class N<T> {
mixin N<T> {
n() {
return T;
}

View file

@ -2,16 +2,12 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Regression test case for dart2js bug where the getter for y wasn't
// properly mixed in.
import "package:expect/expect.dart";
class C {
mixin C {
int x = -1;
int get y => x;
}

View file

@ -5,11 +5,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class M0 {
mixin class M0 {
factory M0(a, b, c) => throw "uncalled";
factory M0.named() => throw "uncalled";
}

View file

@ -2,8 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// Validates mixin behavior that is only relevant pre 3.0.
// @dart=2.19
class M0 {

View file

@ -2,72 +2,74 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class M {}
class M0 extends Object with M0 { }
// ^^
mixin class M0 extends Object with M0 { }
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M0' is a supertype of itself.
// ^
// ^
// [cfe] 'Object with M0' is a supertype of itself.
// ^^
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
class M1 = Object with M1;
// ^^
// ^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
mixin class M1 = Object with M1;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M1' is a supertype of itself.
class M2 = Object with M3;
// ^^
mixin class M2 = Object with M3;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M2' is a supertype of itself.
class M3 = Object with M2;
// ^^
mixin class M3 = Object with M2;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M3' is a supertype of itself.
class M4 = Object with M5;
// ^^
mixin class M4 = Object with M5;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M4' is a supertype of itself.
class M5 = Object with M6;
// ^^
mixin class M5 = Object with M6;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M5' is a supertype of itself.
class M6 = Object with M4;
// ^^
mixin class M6 = Object with M4;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M6' is a supertype of itself.
class M7 extends Object with M8 { }
// ^^
mixin class M7 extends Object with M8 { }
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M7' is a supertype of itself.
// ^
// ^
// [cfe] 'Object with M8' is a supertype of itself.
// ^^
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
class M8 extends Object with M7 { }
// ^^
// ^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
mixin class M8 extends Object with M7 { }
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M8' is a supertype of itself.
// ^
// ^
// [cfe] 'Object with M7' is a supertype of itself.
// ^^
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
// ^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
class M9 = Object with M91;
// ^
// [cfe] 'M9' is a supertype of itself.
class M91 = Object with M92;
// ^^^
mixin class M91 = Object with M92;
// ^^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M91' is a supertype of itself.
class M92 = Object with M91;
// ^^^
mixin class M92 = Object with M91;
// ^^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M92' is a supertype of itself.

View file

@ -5,17 +5,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class S {
static foo() => 42;
}
class M {
mixin M {
static bar() => 87;
}

View file

@ -2,17 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class S {
static foo() => 42;
}
class M {
mixin M {
static bar() => 87;
}

View file

@ -5,15 +5,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class M {}
mixin M {}
class P0 {
mixin P0 {
foo() {
@ -36,7 +32,7 @@ class P0 {
}
}
class P1 {
mixin class P1 {
bar() {
return 87;
@ -56,7 +52,7 @@ class P1 {
}
}
class P2 {
mixin class P2 {
baz() {
return 99;

View file

@ -2,15 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class M {}
mixin M {}
class P0 {
mixin P0 {
foo() {
super.toString();
super.foo();
@ -51,7 +47,7 @@ class P0 {
}
}
class P1 {
mixin class P1 {
bar() {
super.toString();
return 87;
@ -71,7 +67,7 @@ class P1 {
}
}
class P2 {
mixin class P2 {
baz() {
super.toString();
return 99;
@ -80,6 +76,8 @@ class P2 {
class C = Object with M;
class D = Object with P0;
// ^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER
class E = Object with M, P1;
class F = Object with P2, M;

View file

@ -5,19 +5,15 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class S0 {}
class S1 extends Object {}
class S2 extends S0 {}
class M0 {}
mixin class M0 {}
class M1 extends Object {}
mixin class M1 extends Object {}
class M2 extends M0 {}

View file

@ -2,21 +2,20 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class S0 {}
class S1 extends Object {}
class S2 extends S0 {}
class M0 {}
mixin class M0 {}
class M1 extends Object {}
mixin class M1 extends Object {}
class M2 extends M0 {}
mixin class M2 extends M0 {}
// ^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
// [cfe] The class 'M2' can't be used as a mixin because it extends a class other than 'Object'.
class C00 = S0 with M0;
class C01 = S0 with M1;

View file

@ -2,13 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class S { }
class G<T> { }
class M { }
mixin M { }
class T0 = S with M;
abstract class T0A = S with M;

View file

@ -2,17 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
// Regression test for named mixin applications with implements clause.
class A {}
class S {}
class M {}
mixin M {}
class C = S with M implements A;

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
abstract class I0 {
@ -18,7 +14,7 @@ abstract class I1 {
abstract class I2 implements I0, I1 {}
class M {
mixin M {
foo() => 42;
bar() => 87;
}

View file

@ -2,17 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import 'package:expect/expect.dart';
abstract class A<T> {
foo(T x);
}
abstract class B<T> implements A<T> {}
mixin B<T> implements A<T> {}
class C {
foo(num x) {

View file

@ -2,13 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
import "package:expect/expect.dart";
class Mixin {
mixin Mixin {
var field;
createIt() {
if (field == null) field = 42;

View file

@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class Thing {}
class SubThing extends Thing {
@ -16,7 +12,7 @@ class A {
Thing get thing => new Thing();
}
abstract class B implements A {
mixin B implements A {
@override
SubThing get thing;
}

View file

@ -2,15 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class S0<T> {}
class S<U extends num, V extends U> extends S0<String> {}
class M<U extends num, V extends U> {}
mixin M<U extends num, V extends U> {}
class A<U extends num, V extends U> extends S with M {}

View file

@ -2,15 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class S0<T> {}
class S<T extends num> extends S0<String> {}
class M<T extends num> {}
mixin M<T extends num> {}
class A<T extends num> extends S with M {}