Skip to content

Commit

Permalink
Fix regress_29025_test
Browse files Browse the repository at this point in the history
This test doesn't do what it once did since callable classes are no
longer function subtypes. Still, we can preserve some of the behavior.

Change-Id: I92f503bfbbe81685cf79a3bb9b6d85b6859d3c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116141
Auto-Submit: Mayank Patke <fishythefish@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
  • Loading branch information
fishythefish authored and commit-bot@chromium.org committed Sep 9, 2019
1 parent ecb9a11 commit 909e251
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions tests/language_2/regress_29025_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@
// 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.

typedef T F<T>(T t);
abstract class F<T> {
T foo(T t);
}

class B<T extends F<T>> {}

class C<T extends F<C<T>>> {}

class D extends B<D> {
class D extends B<D> implements F<D> {
D foo(D x) => x;
D call(D x) => x;
D bar(D x) => x;
}

class E extends C<E> {
class E extends C<E> implements F<C<E>> {
C<E> foo(C<E> x) => x;
C<E> call(C<E> x) => x;
C<E> bar(C<E> x) => x;
}

main() {
F<D> fd = new D();
var d = fd(fd);
D fd = D();
var d = fd.foo(fd);
print(d);
F<E> fe = new E();
var e = fe(fe);
E fe = E();
var e = fe.foo(fe);
print(e);
}

0 comments on commit 909e251

Please sign in to comment.