This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 220
[[ Bug 20931 ]] Bridge values in LCB assign-array and assign-list ops #6310
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a7125ee
[[ Bug 20931 ]] Bridge values in LCB assign-array and assign-list ops
runrevmark 9ab9b12
[[ Bug 20931 ]] Cover the various types of 'variable' symbol kind
livecodeali 2e50bc2
[[ Bug 20931 ]] Add tests for explicitly typed variadic args
livecodeali 409a628
[[ Bug 20931 ]] Add tests for array and list assign op bridging
livecodeali 545fef5
[[ Bug 20931 ]] Update LCB language reference
livecodeali d973160
[[ Bug 20931 ]] Add release note
livecodeali 615a87b
[[ Bug 20931 ]] Use correct list index
livecodeali File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,9 @@ | ||
| # LiveCode Builder Virtual Machine | ||
| ## Array and list assign ops | ||
|
|
||
| Previously there was a difference between constructing a list or array | ||
| using `push` or `put` and using list or array assigment expressions `[]` | ||
| and `{}`, namely values were converted to `optional any` only in the | ||
| latter case. For consistency, they are now converted in both cases. | ||
|
|
||
| # [20931] Values should bridge to optional any in array and list assign |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,48 @@ | ||
| module __VMTEST.assign_ops | ||
|
|
||
| use com.livecode.foreign | ||
|
|
||
| foreign handler MCValueGetTypeInfo(in pValue as Pointer) returns Pointer binds to "<builtin>" | ||
|
|
||
| foreign handler MCTypeInfoIsForeign(in pTypeInfo as Pointer) returns CBool binds to "<builtin>" | ||
|
|
||
| foreign handler MCArrayFetchValue(in pArray as Array, in pCaseSensitive as CBool, in pKey as Pointer, out rValue as Pointer) returns CBool binds to "<builtin>" | ||
|
|
||
| foreign handler MCNameCreate(in pString as String, out rName as Pointer) returns CBool binds to "<builtin>" | ||
|
|
||
| foreign handler MCProperListFetchElementAtIndex(in pList as List, in pIndex as LCUIndex) returns Pointer binds to "<builtin>" | ||
|
|
||
| unsafe handler __IsForeignValue(in pValue as Pointer) returns Boolean | ||
| return MCTypeInfoIsForeign(MCValueGetTypeInfo(pValue)) | ||
| end handler | ||
|
|
||
| public handler TestAssignArrayOpForeignBridge() | ||
| unsafe | ||
| variable tVar as CBool | ||
| put false into tVar | ||
|
|
||
| variable tKey as Pointer | ||
| MCNameCreate("key", tKey) | ||
|
|
||
| variable tValue as Pointer | ||
| MCArrayFetchValue({"key": tVar}, false, tKey, tValue) | ||
|
|
||
| test "foreign value bridged to optional any in array assign" \ | ||
| when not __IsForeignValue(tValue) | ||
| end unsafe | ||
| end handler | ||
|
|
||
| public handler TestAssignListOpForeignBridge() | ||
| unsafe | ||
| variable tVar as CBool | ||
| put false into tVar | ||
|
|
||
| variable tValue as Pointer | ||
| put MCProperListFetchElementAtIndex([tVar], 1) into tValue | ||
|
|
||
| test "foreign value bridged to optional any in list assign" \ | ||
| when not __IsForeignValue(tValue) | ||
| end unsafe | ||
| end handler | ||
|
|
||
| end module | ||
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The index to MCProperListFetchElementAtIndex should be
0no?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Thanks, fixed.