mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
Impl Display for ConstSubr
This commit is contained in:
parent
f4cb9f67a5
commit
174b37d60c
4 changed files with 24 additions and 15 deletions
|
@ -1,13 +1,13 @@
|
|||
@Inheritable
|
||||
Point2D = Class {x = Int; y = Int}
|
||||
Point2D.
|
||||
new x, y = Self::__new__ {x; y}
|
||||
new x, y = Point2D::__new__ {x; y}
|
||||
norm ref self = self::x**2 + self::y**2
|
||||
|
||||
Point3D = Inherit Point2D, Additional := {z = Int}
|
||||
Point3D.
|
||||
@Override
|
||||
new x, y, z = Self::__new__ {x; y; z}
|
||||
new x, y, z = Point3D::__new__ {x; y; z}
|
||||
@Override
|
||||
norm ref self = self::x**2 + self::y**2 + self::z**2
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue