You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.
The following IronPython tries to create an instance of Foo, using the keyword argument syntax to set its properties:
foo=Foo(
MyBool=1, # correct, passing int instead of BoolMyInt="Oops"# incorrect, passing string instead of int
)
The first assignment is correct: we're passing an int, which can be converted to a bool. The second assignment is incorrect: we're passing a string instead of an int.
That second assignment results in a BaseException with the following message:
expected bool, got int
However, that message describes the first (legal) assignment, while it should be describing the second (illegal) assignment.
It seems to me that the code generating the message just describes the first assignment whose type isn't a perfect match rather than the assignment that actually failed.
Consider the following C# class:
The following IronPython tries to create an instance of
Foo
, using the keyword argument syntax to set its properties:The first assignment is correct: we're passing an int, which can be converted to a bool. The second assignment is incorrect: we're passing a string instead of an int.
That second assignment results in a BaseException with the following message:
However, that message describes the first (legal) assignment, while it should be describing the second (illegal) assignment.
It seems to me that the code generating the message just describes the first assignment whose type isn't a perfect match rather than the assignment that actually failed.
@paweljasinski: I see that you're currently re-writing the error reporting logic: paweljasinski/IronLanguages@5aacd8d. Will that fix this issue, too?
The text was updated successfully, but these errors were encountered: