diff --git a/collects/scribblings/reference/class.scrbl b/collects/scribblings/reference/class.scrbl index b88dd550ef..d9aea7a821 100644 --- a/collects/scribblings/reference/class.scrbl +++ b/collects/scribblings/reference/class.scrbl @@ -1494,9 +1494,13 @@ resulting trait are the same as for @racket[trait-sum], otherwise the @defform/subs[ #:literals (field init init-field inherit inherit-field super inner override augment augride absent) -(class/c member-spec ...) +(class/c maybe-opaque member-spec ...) -([member-spec +([maybe-opaque + (code:line) + (code:line #:opaque)] + + [member-spec method-spec (field field-spec ...) (init field-spec ...) @@ -1538,6 +1542,12 @@ for writing method contracts. Methods and fields listed in an @racket[absent] clause must @emph{not} be present in the class. +A class contract can be specified to be @emph{opaque} with the @racket[#:opaque] +keyword. An opaque class contract will only accept a class that defines +exactly the methods and fields specified by the contract. A contract error +is raised if the contracted class contains any methods or fields that are +not specified. + The external contracts are as follows: @itemize[