Skip to content

Instantly share code, notes, and snippets.

@yanok
Created December 5, 2022 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanok/1763ace42439faf7cd5da4fa8ac9dd4a to your computer and use it in GitHub Desktop.
Save yanok/1763ace42439faf7cd5da4fa8ac9dd4a to your computer and use it in GitHub Desktop.
abstract class A {
@override
bool operator ==(Object? other);
}
class B implements A {}
void test(dynamic x, dynamic y, dynamic z) {
print(x == y || x == z);
}
void main() {
var b1 = B(), b2 = B();
B? b3;
print(b1 == null);
print(b1 == b2);
print(b3 == b2);
print(b3 == null);
test(b1, b2, b3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment