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

clr.accepts/clr.returns error issues #1205

Closed
slozier opened this issue May 5, 2021 · 1 comment
Closed

clr.accepts/clr.returns error issues #1205

slozier opened this issue May 5, 2021 · 1 comment

Comments

@slozier
Copy link
Contributor

slozier commented May 5, 2021

The error message for clr.accepts and clr.returns does not display types properly. For example:

import clr

@clr.accepts(int)
def test(x):
    return x

test("a")

fails with

AssertionError: argument 0 has bad value (got IronPython.Runtime.Types.PythonType, expected IronPython.Runtime.Types.PythonType)

Similarly with returns:

@clr.returns(int)
def test(x):
    return x

test("a")

AssertionError: bad return value returned (expected IronPython.Runtime.Types.PythonType, got IronPython.Runtime.Types.PythonType)

Also, AssertionError is an odd choice of error. Probably a TypeError would be more appropriate?

@slozier slozier changed the title clr.accepts/clr.returnr error issues clr.accepts/clr.returns error issues May 5, 2021
@slozier
Copy link
Contributor Author

slozier commented Jun 23, 2023

Fixed by #1449

@slozier slozier closed this as completed Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant