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

Fixes for several tests in test_bool #261

Merged
merged 2 commits into from
Mar 2, 2017
Merged

Fixes for several tests in test_bool #261

merged 2 commits into from
Mar 2, 2017

Conversation

slide
Copy link
Contributor

@slide slide commented Mar 2, 2017

No description provided.

Ast.IfThen(Ast.LessThan(res, Ast.Constant(0)),
Ast.Throw(
Ast.Call(
typeof(PythonOps).GetMethod("ValueError"),
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should really be throwing errors like that in the IL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have to the way this is implemented. It doesn't use the normal len call, so it has to be thrown in here.

@@ -839,7 +845,7 @@ public static partial class PythonOps {
}

if (res < 0) {
throw PythonOps.ValueError("__len__ should return >= 0, got {0}", res);
throw PythonOps.ValueError("__len__ should return >= 0");
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing the parentheses __len__()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch

@@ -470,6 +470,9 @@ public static partial class PythonOps {
}

public static object Is(object x, object y) {
if(x is bool && y is bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about reusing IronLanguages/main#1332 instead of having something different? Unless this fixes something else...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's a way better idea. I'll revert what I have for that and merge.

@slide slide merged commit a790849 into IronLanguages:master Mar 2, 2017
@slide slide deleted the test_bool_fixes branch March 2, 2017 17:23
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.

None yet

2 participants