typecheck: validate CALL object method args
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
CLASS Player
|
||||
HAS score NUMBER
|
||||
|
||||
TEACH add points
|
||||
CHECK TYPE points IS NUMBER
|
||||
SET score score + points
|
||||
END
|
||||
END
|
||||
|
||||
NEW Player player
|
||||
CALL player.add WITH "five"
|
||||
@@ -0,0 +1,11 @@
|
||||
CLASS Player
|
||||
HAS score NUMBER
|
||||
|
||||
TEACH add points
|
||||
CHECK TYPE points IS NUMBER
|
||||
SET score score + points
|
||||
END
|
||||
END
|
||||
|
||||
NEW Player player
|
||||
CALL player.add WITH 5
|
||||
Reference in New Issue
Block a user