forked from tact-lang/tact
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: chaining for mutable extension functions (tact-lang#384)
Whenever FunC needs an L-value we provide it by creating a temporary binding the form of a function parameter
- Loading branch information
Showing
8 changed files
with
170 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
extends mutates fun multiply(self: Int, x: Int): Int { | ||
self *= x; | ||
return self; | ||
} | ||
|
||
contract Issue211 { | ||
init() {} | ||
receive() {} | ||
|
||
get fun test1(): Int { | ||
let x: Int = beginCell().storeUint(0, 1).endCell().beginParse().loadUint(1); | ||
return x; | ||
} | ||
|
||
get fun test2(): Int { | ||
let y: Cell = beginCell().storeUint(0, 1).endCell(); | ||
let x: Slice = beginCell().storeUint(y.beginParse().loadUint(1), 1).endCell().beginParse(); | ||
return x.loadUint(1); | ||
} | ||
|
||
get fun test3(): Int { | ||
let x: Int = 3; | ||
x.multiply(2); | ||
return x; | ||
} | ||
|
||
get fun test4(): Int { | ||
let x: Int = 3; | ||
return x.multiply(2).multiply(4); | ||
} | ||
|
||
get fun test5(): Int { | ||
return "abc".asSlice().loadUint(8); | ||
} | ||
|
||
get fun test6() { | ||
emptySlice().loadRef(); | ||
} | ||
|
||
get fun test7(): Int { | ||
return beginCell().storeInt(42, 7).asSlice().loadInt(7); | ||
} | ||
} |