Actually, my plans were to report the actual position for argument, or
even its name.

This code:

asm jmp: gen failedLabel.  <----- change to: gen failWithCode:
NBPrimErrBadArgument .

will be replaces with something like:

gen failWithMessage: self coercionErrorMessage

And produced coercionErrorMessage can be quite descriptive, like..

if you having function

void foo (int x)

and you call it with wrong type (say float)

it could say:

"Coercion failed: a callout argument #1 should be an Integer"

.. or something like that.

This will require adding the 'position' ivar to NBExternalType class,
so then it can produce such descriptive error messages.

Or, well...
since we don't know what is the purpose of this.. generator should
decide by itself..

So, i would add a new protocol to generator, like:

gen failCoercionFor: self
( where self is an instance of NBExternalType)
then external type don't needs to know its own position (generator
knows it already).

-- 
Best regards,
Igor Stasenko.

Reply via email to