Closed Bug 1123047 Opened 9 years ago Closed 9 years ago

Improve type conversion error messages in ctypes

Categories

(Core :: js-ctypes, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 891107

People

(Reporter: arai, Unassigned)

References

Details

Derived from bug 551057 comment #0.
(since another issue is also noted in bug 551057 comment #1)

Code:
> let hypot = lib.declare("hypot", ctypes.default_abi,
>                         ctypes.double,
>                         ctypes.double, ctypes.double);
> hypot(1, "xyzzy");

Actual result:
> TypeError: expected type double, got "xyzzy"

Expected result:
> TypeError: can't pass the string "xyzzy" to argument 2 of hypot(double, double)

Requirements:
  * type of the actual value (string in this case)
  * where the type conversion happens (argument n, return value, etc)
  * function name and its type (if it happens in function call)
Blocks: 551057
Oops, bug 891107 should be same as this one.
I'll post patch there.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.