diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/user-guide/06-interfaces-generics.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/user-guide/06-interfaces-generics.md b/docs/user-guide/06-interfaces-generics.md index 1912fcb02..bb19fd776 100644 --- a/docs/user-guide/06-interfaces-generics.md +++ b/docs/user-guide/06-interfaces-generics.md @@ -58,6 +58,17 @@ interface IFoo struct MyType : IFoo {} ``` +A concrete type that provides its overriding implementation to an interface method requirement that has a default implementation must be explicitly marked as 'override'. For example: + +```slang +struct MyType2 : IFoo +{ + // Explicitly mark `getVal` as `override` is needed + // because `IFoo.getVal` has a body. + override int getVal() { return 1; } +} +``` + Generics --------------------- |
