streamulus icon indicating copy to clipboard operation
streamulus copied to clipboard

Add error handling for function-call expressions

Open iritkatriel opened this issue 13 years ago • 3 comments

Check parameter count and types. Generate a friendly error message if they don't match. (Currently the error message is whatever the compiler spews out when the compilation fails).

iritkatriel avatar Jun 18 '12 13:06 iritkatriel

Checkign types is unneeded IMHO as you may want to pass an int to a strop awaiting a double and benefit from automatic conversions. Same goes for w/e user defined data type.

For checking arity, it could be done bu it's cumbersome. Also, see Phoenix rationale aotu NOT caring. If you pass more, rest is discarded automatically.

jfalcou avatar Aug 07 '12 06:08 jfalcou

Agreed. This ticket is not about restricting function expressions, but about giving nice error messages for the ones that would not compile anyway.

iritkatriel avatar Aug 07 '12 23:08 iritkatriel

The only problem is you have a strop with 3 arguments and you conenct it to somethign giving you only 2. This should effectively static_assert.

If you have a 2 args strop and get feed three, discard the third.

jfalcou avatar Aug 08 '12 06:08 jfalcou