Adds smaller code samples from Chapters 1-3 to the tester.
This commit is contained in:
parent
8081a9b3d0
commit
9e86237855
11 changed files with 642 additions and 1 deletions
16
tests/niminaction/Chapter2/no_def_eq.nim
Normal file
16
tests/niminaction/Chapter2/no_def_eq.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
discard """
|
||||
line: 16
|
||||
errormsg: "type mismatch"
|
||||
"""
|
||||
|
||||
type
|
||||
Dog = object
|
||||
name: string
|
||||
|
||||
Cat = object
|
||||
name: string
|
||||
|
||||
let dog: Dog = Dog(name: "Fluffy")
|
||||
let cat: Cat = Cat(name: "Fluffy")
|
||||
|
||||
echo(dog == cat)
|
||||
Loading…
Add table
Add a link
Reference in a new issue