Created
December 25, 2016 17:59
-
-
Save pdtwonotes/5f3f6aed7005da913396713534315dfa to your computer and use it in GitHub Desktop.
Calling a function on an iso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
var n: USize = 0 | |
new iso create() => None | |
fun iso set_n( m: USize ) => | |
n = m | |
actor Main | |
var foo: Foo iso | |
new create( env: Env ) => | |
foo = Foo() | |
foo.set_n(3) | |
This gets error | |
Error: | |
/home/pd/Develop/PonyLang/t/t.pony:11:14: receiver type is not a subtype of target type | |
foo.set_n(3) | |
^ | |
Info: | |
/home/pd/Develop/PonyLang/t/t.pony:11:5: receiver type: Foo iso! | |
foo.set_n(3) | |
^ | |
/home/pd/Develop/PonyLang/t/t.pony:4:3: target type: Foo iso | |
fun iso set_n( m: USize ) => | |
^ | |
/home/pd/Develop/PonyLang/t/t.pony:8:12: Foo iso! is not a subtype of Foo iso: iso! is not a subtype of iso | |
var foo: Foo iso |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment