mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
WIP: trait implementation
This commit is contained in:
parent
3b7eebe041
commit
abb6bcd320
7 changed files with 23 additions and 10 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 p in Norm
|
||||
assert norm(p) == 25
|
||||
assert norm(Point3D.new {x = 3; y = 4; z = 5}) == 50
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue