Created
April 28, 2024 14:41
-
-
Save iapicca/ca267d0aa7c167c05d12e04b84a9655a to your computer and use it in GitHub Desktop.
extensio types stop being Object
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
import 'dart:ui'; | |
typedef SomethingToString<T extends Object> = void Function(T); | |
class Foo extends Object { | |
const Foo(); | |
} | |
extension type Bar(Foo foo) {} | |
class Baz { | |
const Baz(); | |
} | |
extension type MyOffset(Offset offset) {} | |
SomethingToString<Foo> get fooHello => (i) => 'hello'; | |
SomethingToString<Bar> get barHello => (i) => 'hello'; | |
SomethingToString<Baz> get bazHello => (i) => 'hello'; | |
SomethingToString<Offset> get offsetHello => (i) => 'hello'; | |
SomethingToString<MyOffset> get myOffsetHello => (i) => 'hello'; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment