If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Improve type conversion error messages in ctypes

RESOLVED DUPLICATE of bug 891107

Status

()

Core
js-ctypes
RESOLVED DUPLICATE of bug 891107
3 years ago
3 years ago

People

(Reporter: arai, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 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

3 years ago
Blocks: 551057
(Reporter)

Comment 1

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