• Joined on 2024-06-03
lyken created pull request M-Labs/nac3#440 2024-06-27 17:06:35 +08:00
core: Fix crashes on invalid subscripting & iterating over non-iterables.
lyken created branch fix-panic-432 in M-Labs/nac3 2024-06-27 17:02:48 +08:00
lyken pushed to fix-panic-432 at M-Labs/nac3 2024-06-27 17:02:48 +08:00
2acf9b88e9 core: fix crash on iterating over non-iterables
d06c13f936 core: fix crash on invalid subscripting
Compare 2 commits »
lyken commented on pull request M-Labs/nac3#439 2024-06-27 16:04:19 +08:00
core: improve binop and cmpop error messages

Revised

lyken pushed to improve-error-432 at M-Labs/nac3 2024-06-27 16:04:14 +08:00
c57e0936d5 core: improve binop and cmpop error messages
a610b4a057 core: refactor typecheck/magic_methods.rs operators & add op symbol name
Compare 2 commits »
lyken commented on pull request M-Labs/nac3#439 2024-06-27 15:23:16 +08:00
core: improve binop and cmpop error messages

I'd prefer it to be called invalid operand type(s) float and int32 for operator +

The current error message follows Python's:

TypeError: unsupported operand type(s) for +: 'float' and…
lyken commented on pull request M-Labs/nac3#439 2024-06-27 15:13:20 +08:00
core: improve binop and cmpop error messages

Also I don't think From trait is meant to be used like that - it's purpose is for type conversions. Perhaps I will create a trait HasOpInfo.

lyken commented on pull request M-Labs/nac3#439 2024-06-27 15:10:20 +08:00
core: improve binop and cmpop error messages

CallInfo was intended to be general for any kind of function call. But to be honest I cannot think of anything other than normal function calls and operator calls (including is and is not

lyken commented on pull request M-Labs/nac3#439 2024-06-27 15:08:37 +08:00
core: improve binop and cmpop error messages

It is possible for Cmpop and Unaryop, but not for Operator (binary operator) since it takes an extra argument, although I could create:

struct BinaryOp {
  base_op: Operator,
 
lyken closed issue M-Labs/nac3#427 2024-06-27 15:01:33 +08:00
Allow numpy factories to take in shape parameter as tuple
lyken pushed to improve-error-432 at M-Labs/nac3 2024-06-27 15:00:58 +08:00
d0ea69b7ae core: improve comments in CallInfo
lyken pushed to improve-error-432 at M-Labs/nac3 2024-06-27 14:55:51 +08:00
3087f77ed8 core: improve binop and cmpop error messages
f478ddb70a core: refactor typecheck/magic_methods.rs operators & add op symbol name
9808923258 core: improve comments in type_inferencer/mod.rs
5b11a1dbdd core: support tuple and int32 input for np_empty, np_ones, and more
Compare 4 commits »
lyken pushed to ndfactory-tuple at M-Labs/nac3 2024-06-27 14:47:09 +08:00
9808923258 core: improve comments in type_inferencer/mod.rs
lyken closed issue M-Labs/nac3#435 2024-06-27 14:33:46 +08:00
unify_call() has imprecise error report.
lyken commented on pull request M-Labs/nac3#434 2024-06-27 14:32:11 +08:00
core: support tuple and int32 input for np_empty, np_ones, and more

Further revision and squashed history.

lyken pushed to ndfactory-tuple at M-Labs/nac3 2024-06-27 14:31:05 +08:00
5b11a1dbdd core: support tuple and int32 input for np_empty, np_ones, and more
b21df53e0d core: fix comment typo in unify_call()
0ec967a468 core: improve function call errors
ca8459dc7b standalone: prettify TopLevelComposer error reporting
Compare 4 commits »
lyken commented on pull request M-Labs/nac3#434 2024-06-27 14:29:07 +08:00
core: support tuple and int32 input for np_empty, np_ones, and more

For now I would replace the message to be Expected list literal, tuple, or int32 for argument {arg_num} of {id} at {location}. Input argument is of type list but not written as a list literal.

lyken commented on pull request M-Labs/nac3#434 2024-06-27 14:26:30 +08:00
core: support tuple and int32 input for np_empty, np_ones, and more

I am not entirely sure what "compile-time constants" means exactly. I guess that means a "static"-ishly defined value. shape need not to be a compile-time constant for tuple and int32 in my…

lyken commented on pull request M-Labs/nac3#434 2024-06-27 14:14:41 +08:00
core: support tuple and int32 input for np_empty, np_ones, and more

I am not entirely sure what "compile-time constants" means exactly. I guess that means a "static"-ishly defined value. shape need not to be a compile-time constant for tuple and int32 in my…

lyken commented on pull request M-Labs/nac3#439 2024-06-27 14:09:15 +08:00
core: improve binop and cmpop error messages

Force-pushed to rebase onto master since M-Labs/nac3#437 has been merged.