Skip to content

Commit

Permalink
Clarify what types can extend a trait (#1823)
Browse files Browse the repository at this point in the history
* Clarify what types can extend a trait

* Apply suggestions from code review

Co-authored-by: Mikaël Mayer <[email protected]>

Co-authored-by: Mikaël Mayer <[email protected]>
  • Loading branch information
atomb and MikaelMayer authored Feb 15, 2022
1 parent aa18280 commit 49836a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/DafnyRef/Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -2315,10 +2315,11 @@ TraitDecl =
````

A _trait_ is an abstract superclass, similar to an "interface" or
"mixin".[^fn-traits]
"mixin". A trait can be _extended_ only by another trait or
by a class (and in the latter case we say that the class _implements_
the trait). More specifically, algebraic datatypes cannot extend traits.[^fn-traits]

[^fn-traits]: Traits are new to Dafny and are likely to evolve for a
while.
[^fn-traits]: Traits are new to Dafny and are likely to evolve for a while.

The declaration of a trait is much like that of a class:
```dafny
Expand Down

0 comments on commit 49836a6

Please sign in to comment.