From cb4aa78ae6d687fc13a1a46e936937d3a54fdeb8 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Mon, 2 Dec 2024 20:32:23 -0300 Subject: [PATCH] doc(mixins): Add override annotation on some code examples (#6240) include some override annotations for code examples that are not explicitly assigned. --- Co-authored-by: Marya <111139605+MaryaBelanger@users.noreply.github.com> --- src/content/language/mixins.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/content/language/mixins.md b/src/content/language/mixins.md index 662194df82..6c6308c95c 100644 --- a/src/content/language/mixins.md +++ b/src/content/language/mixins.md @@ -87,6 +87,8 @@ mixin Musician { } class Virtuoso with Musician { + + @override void playInstrument(String instrumentName) { // Subclass must define. print('Plays the $instrumentName beautifully'); } @@ -104,7 +106,10 @@ of a mixin, by calling getters which are defined as abstract on the mixin: mixin NameIdentity { String get name; + @override int get hashCode => name.hashCode; + + @override bool operator ==(other) => other is NameIdentity && name == other.name; } @@ -135,6 +140,8 @@ mixin Guitarist implements Tuner { } class PunkRocker with Guitarist { + + @override void tuneInstrument() { print("Don't bother, being out of tune is punk rock."); }