|
| 1 | +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 | + |
| 5 | +import 'dart:async'; |
| 6 | + |
| 7 | +class A {} |
| 8 | + |
| 9 | +mixin M on A {} |
| 10 | + |
| 11 | +enum En { |
| 12 | + element; |
| 13 | +} |
| 14 | + |
| 15 | +extension type E1(num it) implements Object {} // Ok. |
| 16 | +extension type E2(E1 it) implements Object {} // Ok. |
| 17 | +extension type E3(String? it) implements Object {} // Error. |
| 18 | +extension type E4(E3 it) implements Object {} // Error. |
| 19 | + |
| 20 | +extension type E5(Null it) implements void {} // Error. |
| 21 | +extension type E6(Null it) implements dynamic {} // Error. |
| 22 | +extension type E7(Null it) implements double? {} // Error. |
| 23 | +extension type E8(bool it) implements FutureOr<bool> {} // Error. |
| 24 | +extension type E9<X>(X it) implements FutureOr<X> {} // Error. |
| 25 | +extension type E10(void Function(int) it) implements Function {} // Error. |
| 26 | +extension type E11(String Function() it) implements String Function() {} // Error. |
| 27 | +extension type E12((int, Object?) it) implements Record {} // Error. |
| 28 | +extension type E13((Null, num) it) implements (Null, num) {} // Error. |
| 29 | +extension type E14(Null it) implements Null {} // Error. |
| 30 | +extension type E15<X>(X it) implements Never {} // Error. |
| 31 | +extension type E16(Null it) implements Never {} // Error. |
| 32 | + |
| 33 | +extension type E17(A a) implements A {} // Ok. |
| 34 | +extension type E18(M m) implements M {} // Ok. |
| 35 | +extension type E19(En en) implements En {} // Ok. |
0 commit comments