-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: variable scoping bug with loops (#269)
- Loading branch information
Showing
13 changed files
with
169 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import "./issue42.tact"; | ||
import "./issue43.tact"; | ||
import "./issue53.tact"; | ||
import "./issue53.tact"; | ||
import "./issue117.tact"; |
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,27 @@ | ||
fun scopeUntil() { | ||
do { | ||
let a: Int = 0; | ||
} until (true); | ||
let a: String = "abc"; | ||
} | ||
|
||
fun scopeRepeat() { | ||
repeat (1) { | ||
let a: Int = 0; | ||
} | ||
let a: String = "abc"; | ||
} | ||
|
||
fun scopeWhile() { | ||
while (true) { | ||
let a: Int = 0; | ||
} | ||
let a: String = "abc"; | ||
} | ||
|
||
fun scopeIf() { | ||
if (true) { | ||
let a: Int = 0; | ||
} | ||
let a: String = "abc"; | ||
} |
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,10 @@ | ||
primitive Int; | ||
|
||
fun testFunction(): Int { | ||
let a: Int = 123; | ||
let b: Int = 456; | ||
repeat (a) { | ||
let c: Int = a + b; | ||
} | ||
return c; | ||
} |
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,10 @@ | ||
primitive Int; | ||
|
||
fun testFunction(): Int { | ||
let a: Int = 123; | ||
let b: Int = 456; | ||
repeat (a) { | ||
let c: Int = a + b; | ||
} | ||
return a + b; | ||
} |
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,10 @@ | ||
primitive Int; | ||
|
||
fun testFunction(): Int { | ||
let a: Int = 123; | ||
let b: Int = 456; | ||
repeat (a) { | ||
b = a + b; | ||
} | ||
return b; | ||
} |