Skip to content

Instantly share code, notes, and snippets.

@RobertBrunhage
Last active May 7, 2023 11:38
Show Gist options
  • Save RobertBrunhage/501e8c24c313fe87d4515ce1eb2df0ff to your computer and use it in GitHub Desktop.
Save RobertBrunhage/501e8c24c313fe87d4515ce1eb2df0ff to your computer and use it in GitHub Desktop.
Dart 3 examples
// ------- Different class declarations -------
base class BaseClassExample {}
mixin class MiximClassExample {}
final class FinalClassExample {}
// ------- Different class usages -------
// This doesn't work but that's expected
class Example extends BaseClassExample {}
// Why does this work?
base class Example1 extends BaseClassExample {}
final class Example2 extends BaseClassExample {}
sealed class Example3 extends BaseClassExample {}
// Why does these work?
class Example4 implements MiximClassExample {}
class Example5 extends MiximClassExample {}
// Shouldn't these failures just happen outside the current library?
class Example6 implements FinalClassExample{}
class Example7 extends FinalClassExample{}
// Why does doing this work?
base class Example8 implements FinalClassExample{}
final class Example9 extends FinalClassExample{}
sealed class Example10 extends FinalClassExample{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment