mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
Improve: inferring the overall type from the method
This commit is contained in:
parent
cd168ef131
commit
96c5527134
6 changed files with 58 additions and 5 deletions
|
@ -10,6 +10,8 @@ Point3D|Point2D <: Norm|.
|
|||
|
||||
norm|T <: Norm| x: T = x.norm()
|
||||
|
||||
inplicit_norm x = x.norm()
|
||||
|
||||
p = Point2D.new {x = 3; y = 4}
|
||||
print! norm(p)
|
||||
assert norm(p) == 25
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue