-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 698b544 into dev
- Loading branch information
Showing
22 changed files
with
1,155 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,7 @@ besides | |
beta | ||
bigger | ||
bitmask | ||
bivariant | ||
bkonyi | ||
bla | ||
blah | ||
|
36 changes: 36 additions & 0 deletions
36
pkg/front_end/testcases/inline_class/extension_types/non_covariant_type_parameter.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// 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. | ||
|
||
typedef Contravariant<T> = void Function(T); | ||
typedef Invariant<T> = void Function<S extends T>(); | ||
typedef Covariant<T> = T Function(); | ||
typedef Bivariant<T> = T Function(T); | ||
|
||
extension type ET_Contravariant<T>(void Function(T) f) /* Error */ {} | ||
|
||
extension type ET_Invariant<T>(void Function<S extends T>() f) /* Error */ {} | ||
|
||
extension type ET_Covariant<T>(T Function() f) /* Ok */ {} | ||
|
||
extension type ET_Bivariant<T>(T Function(T) f) /* Error */ {} | ||
|
||
extension type ET_ContravariantAlias<T>(Contravariant<T> f) /* Error */ {} | ||
|
||
extension type ET_InvariantAlias<T>(Invariant<T> f) /* Error */ {} | ||
|
||
extension type ET_CovariantAlias<T>(Covariant<T> f) /* Ok */ {} | ||
|
||
extension type ET_BivariantAlias<T>(Bivariant<T> f) /* Error */ {} | ||
|
||
extension type ET_ContravariantAlias1<T> | ||
(Contravariant<T> Function() f) /* Error */ {} | ||
|
||
extension type ET_ContravariantAlias2<T> | ||
(void Function(Covariant<T>) f) /* Error */ {} | ||
|
||
extension type ET_CovariantAlias1<T> | ||
(Covariant<T> Function() f) /* Ok */ {} | ||
|
||
extension type ET_CovariantAlias2<T> | ||
(void Function(Contravariant<T>) f) /* Ok */ {} |
Oops, something went wrong.