mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:29:48 +00:00
9d933d1281
Tested: No new tests. Change-Id: Idf19ce8b6743b221841e6cef6b2a80e8ab37860e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354260 Auto-Submit: Lasse Nielsen <lrn@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> Reviewed-by: Nate Bosch <nbosch@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com> Commit-Queue: Lasse Nielsen <lrn@google.com>
44 lines
1.1 KiB
Dart
44 lines
1.1 KiB
Dart
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
|
|
// 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.
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
abstract class A {
|
|
(Object?, dynamic) method();
|
|
(Object?, dynamic) get getter;
|
|
void set setter((int, int) Function(Object?, dynamic) f);
|
|
}
|
|
|
|
abstract class B {
|
|
(dynamic, Object?) method();
|
|
(dynamic, Object?) get getter;
|
|
void set setter((int, int) Function(dynamic, Object?) f);
|
|
}
|
|
|
|
class C implements A, B {
|
|
(int, int) method() => (42, 87);
|
|
(int, int) get getter => (42, 87);
|
|
void set setter((int, int) Function(dynamic, dynamic) f) {}
|
|
}
|
|
|
|
extension type E(C c) implements A, B {}
|
|
|
|
void method(E e) {
|
|
var (a, b) = e.method();
|
|
Expect.equals(42, a);
|
|
Expect.equals(87, b);
|
|
var (c, d) = e.getter;
|
|
Expect.equals(42, c);
|
|
Expect.equals(87, d);
|
|
e.setter = (dynamic a, dynamic b) => (42, 87);
|
|
var f = e.method;
|
|
var (g, h) = f();
|
|
Expect.equals(42, g);
|
|
Expect.equals(87, h);
|
|
}
|
|
|
|
main() {
|
|
method(E(C()));
|
|
}
|