-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check if in TypeExpression before doing VariableExpression checks (#122)
* Check for being in a type expression before doing VariableExpression checks * Added tests for typecasts
- Loading branch information
1 parent
6380ed5
commit 4581ee9
Showing
4 changed files
with
53 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
sub main() | ||
takesFunction(function(input as object) as string | ||
return "Hello, " + input.name + "!" | ||
end function) | ||
end sub | ||
|
||
|
||
sub takesFunction(anonFunc as function) | ||
print anonFunc({name: "Hello, World!"}) | ||
end sub |
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,14 @@ | ||
typecast m as MyTypeCast | ||
|
||
|
||
|
||
sub main(input) | ||
print m.name | ||
print (input as myTypeCast).name | ||
print (input as dynamic).name | ||
end sub | ||
|
||
|
||
interface MyTypeCast | ||
name as string | ||
end interface |