-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extend dependency check to sporked function calls
- Loading branch information
Showing
6 changed files
with
139 additions
and
41 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
File renamed without changes.
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,22 @@ | ||
// error checking: as of 1.5.4.0 dependency tracking | ||
// for context-top-level variable where sporked functions | ||
// are now verified same as non-sporked function calls | ||
// | ||
// previously, if sporking, then no dependency check and it's up to | ||
// programmer to ensure behavior is as intended | ||
|
||
// spork a function (that depends on foo) | ||
spork ~ printArray(); | ||
|
||
// initialize foo | ||
5 => int foo; | ||
|
||
// function that needs array | ||
fun void printArray() | ||
{ | ||
// need 'foo' initialized here | ||
if( foo == 5 ) <<< "success" >>>; | ||
} | ||
|
||
// give the sporked shred a chance to run | ||
me.yield(); |
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 @@ | ||
error-depend-spork.ck:9:9: error: sporking 'printArray()' at this point potentially skips initialization of a needed variable: | ||
[9] spork ~ printArray(); | ||
^ | ||
error-depend-spork.ck:12:10: error: ...(note: this skipped variable initialization is needed by 'fun void printArray()') | ||
[12] 5 => int foo; | ||
^ | ||
error-depend-spork.ck:18:9: error: ...(note: this is where the variable is used within 'fun void printArray()' or its subsidiaries) | ||
[18] if( foo == 5 ) <<< "success" >>>; | ||
^ | ||
error-depend-spork.ck: ...(hint: try calling 'printArray()' after the variable initialization) |