mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 12:51:10 +00:00
Add type specification for array and range types
This commit is contained in:
parent
f6637f0f51
commit
f548f9e6ef
4 changed files with 58 additions and 3 deletions
|
@ -1586,6 +1586,15 @@ impl fmt::Display for ArrayTypeSpec {
|
|||
|
||||
impl_locational!(ArrayTypeSpec, ty, len);
|
||||
|
||||
impl ArrayTypeSpec {
|
||||
pub fn new(ty: TypeSpec, len: ConstExpr) -> Self {
|
||||
Self {
|
||||
ty: Box::new(ty),
|
||||
len,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// * Array: `[Int; 3]`, `[Int, Ratio, Complex]`, etc.
|
||||
/// * Dict: `[Str: Str]`, etc.
|
||||
/// * And (Intersection type): Add and Sub and Mul (== Num), etc.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue