core: Generalize ExprKind::Slice
and Constant::Ellipsis
.
#486
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#486
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In
Inferencer
andCodeGenerator
, many implementations directly pattern match on expressions to check if they areExprKind::Slice
/Constant::Ellipsis
to do work.However,
ExprKind::Slice
/Constant::Ellipsis
themselves could have well-defined types.At the moment,
nac3core
has hiccups in certain areas:Unifier.is_concrete
does not have a defined way to detect...
, and the type concreteness check underInferencer::check_expr
right now does a direct pattern match on the expression itself to look out forConstant::Ellipsis
. This makes expressions likemy_ndarray[1, ..., 2::]
impossible without forcing the...
in the middle to have a bogus concrete type (like type()
).There is no way to do things like:
Consider adding builtin types
slice
(+ aslice
LLVM struct type) andellipsis
, so implementations can check on typechecker types and fix the issues above/allow for future expansions. This may also drastically beautify some implementations inCodeGenerator
andInferencer
.Though this is not a priority now.
core: don't treat `ExprKind::Slice` and `Constant::Ellipsis` exprs/values specially.to core: Generalize `ExprKind::Slice` and `Constant::Ellipsis`.