-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix over-indexing of lists and restore string indexing #9388
Merged
aparajit-pratap
merged 10 commits into
DynamoDS:master
from
aparajit-pratap:arrayIndexing
Jan 11, 2019
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
948ebc7
fix overindexing of lists
aparajit-pratap 6d0e51f
add null checks
aparajit-pratap cfbbcc6
fixes
aparajit-pratap 11be265
revert assemblysharedinfo
aparajit-pratap 51b7898
fix tests
aparajit-pratap 8ff5436
reverting unchanged file
aparajit-pratap 28d6b18
turn on previously failing tests that pass after fix
aparajit-pratap 69bb364
revert public to protected
aparajit-pratap 27123f2
revert unchanged file
aparajit-pratap a41412c
fix warning messages
aparajit-pratap 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 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 |
---|---|---|
|
@@ -18,7 +18,7 @@ public enum WarningID | |
Default, | ||
AccessViolation, | ||
AmbiguousMethodDispatch, | ||
AurgumentIsNotExpected, | ||
ArgumentIsNotExpected, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aparajit-pratap I don't think we can change these now, they are public. 😢 maybe just add a todo? |
||
CallingConstructorOnInstance, | ||
ConversionNotPossible, | ||
DereferencingNonPointer, | ||
|
@@ -29,7 +29,7 @@ public enum WarningID | |
CyclicDependency, | ||
MethodResolutionFailure, | ||
OverIndexing, | ||
TypeConvertionCauseInfoLoss, | ||
TypeConversionCauseInfoLoss, | ||
TypeMismatch, | ||
ReplicationWarning, | ||
InvalidIndexing, | ||
|
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 |
---|---|---|
|
@@ -653,11 +653,9 @@ def foo() | |
thisTest.Verify("y", 2); | ||
} | ||
|
||
[Test, Category("Failure")] | ||
[Test] | ||
public void TestArrayOverIndexing01() | ||
{ | ||
// TODO pratapa: Zero sub-indexing of array now works due to array promotion | ||
// after introducing Builtin.Get.ValueAtIndex for indexing operator | ||
string code = @" | ||
[Imperative] | ||
{ | ||
|
@@ -668,7 +666,7 @@ public void TestArrayOverIndexing01() | |
} | ||
"; | ||
thisTest.RunScriptSource(code); | ||
TestFrameWork.VerifyRuntimeWarning(ProtoCore.Runtime.WarningID.OverIndexing); | ||
TestFrameWork.VerifyRuntimeWarning(ProtoCore.Runtime.WarningID.MethodResolutionFailure); | ||
} | ||
|
||
[Test] | ||
|
@@ -1265,39 +1263,6 @@ public void TestDictionaryRegressMAGN619() | |
thisTest.Verify("r", 5); | ||
} | ||
|
||
[Test, Category("Failure")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test doesn't make any sense. |
||
public void TestDictionary25() | ||
{ | ||
// TODO pratapa: Crash typing this code in CBN post Dictionary changes | ||
string code = @" | ||
a = []; | ||
x = ""key""; | ||
a[x] = 42; | ||
|
||
y = ""key""; | ||
a[y] = 24; | ||
|
||
z = ""key""; | ||
a[z] = 12; | ||
|
||
r1 = a[x]; | ||
r2 = a[y]; | ||
r3 = a[z]; | ||
r4 = a[""key""]; | ||
|
||
a[""key""] = 1; | ||
r5 = a[""key""]; | ||
r6 = a[x]; | ||
r7 = a[y]; | ||
r8 = a[z]; | ||
"; | ||
thisTest.RunScriptSource(code); | ||
thisTest.Verify("r5", 1); | ||
thisTest.Verify("r6", 1); | ||
thisTest.Verify("r7", 1); | ||
thisTest.Verify("r8", 1); | ||
} | ||
|
||
[Test] | ||
public void TestArrayCopyAssignment01() | ||
{ | ||
|
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
Oops, something went wrong.
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.
@aparajit-pratap should this also be added to the imperative AST methodAttributes class - does that exist?
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.
Strictly speaking this class doesn't have anything to do with Associative AST's and should not be in this file but that's a consideration for another day.
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.
😆