Created with <3 with dartpad.dev.
Created
February 27, 2023 17:20
-
-
Save haberman/cf79d4cfef0ca73453228970091de8c4 to your computer and use it in GitHub Desktop.
mellow-jungle-4935
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
class Getter<T> {} | |
extension on Getter<int> { | |
int get() => 42; | |
} | |
extension on Getter<String> { | |
String get() => "the answer to life, the universe, and everything"; | |
} | |
void main() { | |
var intGetter = Getter<int>(); | |
var strGetter = Getter<String>(); | |
print(intGetter.get()); | |
print(strGetter.get()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment