Last active
February 18, 2019 14:21
-
-
Save lukepighetti/b4f766621b01ffa5270e5de93ef592b5 to your computer and use it in GitHub Desktop.
Mixin error
This file contains hidden or 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 Cook = Person with AwesomeCookingSkills; | |
class Person { | |
final String name; | |
Person(this.name); | |
} | |
mixin AwesomeCookingSkills on Person { | |
String get bestDish => "$name makes the best chocolate."; | |
} | |
main() { | |
final miyoyo = Cook("Miyoyo"); | |
/// Error: The superclass, 'Person', has no unnamed constructor that takes no arguments. | |
print(miyoyo.bestDish); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment