Improve type conversion error messages in ctypes

RESOLVED DUPLICATE of bug 891107

Status

()

RESOLVED DUPLICATE of bug 891107
4 years ago
4 years ago

People

(Reporter: arai, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
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)
(Reporter)

Updated

4 years ago
Blocks: 551057
(Reporter)

Comment 1

4 years ago
Oops, bug 891107 should be same as this one.
I'll post patch there.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 891107
You need to log in before you can comment on or make changes to this bug.