mirror of
https://github.com/erg-lang/erg.git
synced 2025-12-23 05:36:48 +00:00
Update trait.er
This commit is contained in:
parent
ad57864b6e
commit
64497663cd
1 changed files with 1 additions and 1 deletions
|
|
@ -11,6 +11,6 @@ Point3D|Point2D <: Norm|.
|
|||
norm|T <: Norm| x: T = x.norm()
|
||||
|
||||
p = Point2D.new {x = 3; y = 4}
|
||||
# assert p in Norm
|
||||
assert norm(p) == 25
|
||||
assert norm(Point3D.new {x = 3; y = 4; z = 5}) == 50
|
||||
# assert norm(1) # this should be an error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue