fix: array type inferring

This commit is contained in:
Shunsuke Shibayama 2023-08-06 22:51:13 +09:00
parent 142db9b697
commit f4e1d494a4
15 changed files with 276 additions and 69 deletions

View file

@ -20,7 +20,7 @@ use erg_parser::ast::{
};
use erg_parser::token::{Token, TokenKind, DOT};
use crate::ty::constructors::{array_t, dict_t, set_t, tuple_t};
use crate::ty::constructors::{dict_t, set_t, tuple_t};
use crate::ty::typaram::TyParam;
use crate::ty::value::{GenTypeObj, ValueObj};
use crate::ty::{Field, HasType, Type, VisibilityModifier};
@ -774,8 +774,7 @@ impl_locational!(NormalArray, l_sqbr, elems, r_sqbr);
impl_t!(NormalArray);
impl NormalArray {
pub fn new(l_sqbr: Token, r_sqbr: Token, elem_t: Type, elems: Args) -> Self {
let t = array_t(elem_t, TyParam::value(elems.len()));
pub fn new(l_sqbr: Token, r_sqbr: Token, t: Type, elems: Args) -> Self {
Self {
l_sqbr,
r_sqbr,