mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 20:14:45 +00:00
fix: dynamic type checking bugs
This commit is contained in:
parent
a6b72ea636
commit
5affa5065f
12 changed files with 91 additions and 7 deletions
|
@ -5,9 +5,9 @@ from _erg_control import then__
|
|||
class Int(int):
|
||||
def try_new(i): # -> Result[Nat]
|
||||
if isinstance(i, int):
|
||||
Int(i)
|
||||
return Int(i)
|
||||
else:
|
||||
Error("not an integer")
|
||||
return Error("not an integer")
|
||||
|
||||
def succ(self):
|
||||
return Int(self + 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue