mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-25 08:43:58 +00:00
fix deprecated example (#18721)
This commit is contained in:
@@ -1082,7 +1082,7 @@ its entirety to see some of the complexities.
|
||||
Concrete syntax:
|
||||
|
||||
.. code-block:: nim
|
||||
type Obj[T] = object {.inheritable.}
|
||||
type Obj[T] {.inheritable.} = object
|
||||
name: string
|
||||
case isFat: bool
|
||||
of true:
|
||||
@@ -1094,10 +1094,18 @@ AST:
|
||||
|
||||
.. code-block:: nim
|
||||
# ...
|
||||
nnkPragmaExpr(
|
||||
nnkIdent("Obj"),
|
||||
nnkPragma(nnkIdent("inheritable"))
|
||||
),
|
||||
nnkGenericParams(
|
||||
nnkIdentDefs(
|
||||
nnkIdent("T"),
|
||||
nnkEmpty(),
|
||||
nnkEmpty())
|
||||
),
|
||||
nnkObjectTy(
|
||||
nnkPragma(
|
||||
nnkIdent("inheritable")
|
||||
),
|
||||
nnkEmpty(),
|
||||
nnkEmpty(),
|
||||
nnkRecList( # list of object parameters
|
||||
nnkIdentDefs(
|
||||
|
||||
Reference in New Issue
Block a user