Skip to content
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
merged 10 commits into from
Jan 11, 2019

Conversation

aparajit-pratap
Copy link
Contributor

@aparajit-pratap aparajit-pratap commented Jan 8, 2019

Purpose

Fixes #9383

JIRA:
https://jira.autodesk.com/browse/DYN-995
https://jira.autodesk.com/browse/DYN-1056

image

image

image

image

Declarations

Check these if you believe they are true

  • The code base is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning, and are documented in the API Changes document.

Reviewers

@mjkkirschner

@@ -1265,39 +1263,6 @@ public void TestDictionaryRegressMAGN619()
thisTest.Verify("r", 5);
}

[Test, Category("Failure")]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't make any sense.

@@ -18,7 +18,7 @@ public enum WarningID
Default,
AccessViolation,
AmbiguousMethodDispatch,
AurgumentIsNotExpected,
ArgumentIsNotExpected,
Copy link
Member

Choose a reason for hiding this comment

The 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?

@mjkkirschner
Copy link
Member

@aparajit-pratap looks good except I don't think we can fix the enum names now.

@aparajit-pratap
Copy link
Contributor Author

aparajit-pratap commented Jan 10, 2019

@mjkkirschner these are changes in ProtoCore. I'm pretty sure no users/clients use any public stuff from ProtoCore (other than AST's). Or are you saying this will cause binary incompatibility issues?

@mjkkirschner
Copy link
Member

mjkkirschner commented Jan 10, 2019 via email

@aparajit-pratap aparajit-pratap changed the title Fix overindexing of lists Fix over-indexing of lists and restore string indexing Jan 10, 2019
@@ -1663,6 +1663,7 @@ public IEnumerable<string> ReturnKeys
public string ObsoleteMessage { get; protected set; }
public bool IsObsolete { get { return !string.IsNullOrEmpty(ObsoleteMessage); } }
public bool IsLacingDisabled { get; protected set; }
public bool AllowArrayPromotion { get; protected set; } = true;
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

@mjkkirschner
Copy link
Member

@aparajit-pratap looks good to me - one question about imperative behavior vs associative?

@aparajit-pratap
Copy link
Contributor Author

Thanks @mjkkirschner, merging.

@aparajit-pratap aparajit-pratap merged commit e151cb9 into DynamoDS:master Jan 11, 2019
@aparajit-pratap aparajit-pratap deleted the arrayIndexing branch January 11, 2019 00:30
aparajit-pratap added a commit to aparajit-pratap/Dynamo that referenced this pull request Jan 11, 2019
* fix overindexing of lists

* add null checks

* fixes

* revert assemblysharedinfo

* fix tests

* reverting unchanged file

* turn on previously failing tests that pass after fix

* revert public to protected

* revert unchanged file

* fix warning messages
aparajit-pratap added a commit that referenced this pull request Jan 11, 2019
* fix overindexing of lists

* add null checks

* fixes

* revert assemblysharedinfo

* fix tests

* reverting unchanged file

* turn on previously failing tests that pass after fix

* revert public to protected

* revert unchanged file

* fix warning messages
using ProtoCore.Properties;
using ProtoCore.Exceptions;
using IndexOutOfRangeException = DesignScript.Builtin.IndexOutOfRangeException;
using KeyNotFoundException = DesignScript.Builtin.KeyNotFoundException;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make sure the usings are sorted?

@@ -1332,7 +1332,7 @@ void core_Dispose(ProtoCore.RuntimeCore sender)
{
CLRObjectMarshaler marshaller = null;
if (!mObjectMarshlers.TryGetValue(sender, out marshaller))
throw new KeyNotFoundException();
throw new System.Collections.Generic.KeyNotFoundException();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm This file has System.Collections.Generic using already I believe

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is to be explicit because we also have a key not found exception.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjkkirschner Then should we rename our own exception in a different task?

Copy link
Member

@mjkkirschner mjkkirschner Jan 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please a different task. ours is
DesignScript.Builtin.KeyNotFoundException
@aparajit-pratap is aliasing them above.

reddyashish pushed a commit to reddyashish/Dynamo that referenced this pull request May 21, 2019
QilongTang pushed a commit that referenced this pull request May 28, 2019
* Cherry-picking #9388 into 2.0.3

* Cherry-picking #9559 into 2.0.3

* Cherry-picking #9578 into 2.0.3

* cherry-picking #9632 into 2.0.3

* cherry-picking #9408 into 2.0.3

* cherry-picking #9441 into 2.0.3

* Adding gradient.png for the Test_PerforationsByImage test.

This was missed while cherrypicking #9441

* Removing DSCoreDataTests.cs as this was the test fixture was introduced in a different commit and is not needed here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants