@@ -1076,7 +1076,7 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
10761076 } else if (var_annotation == " str" ) {
10771077 type = ASRUtils::TYPE (ASR::make_Character_t (al, loc, 1 , -2 , nullptr ));
10781078 type = ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size ());
1079- } else if (var_annotation == " bool" ) {
1079+ } else if (var_annotation == " bool" || var_annotation == " i1 " ) {
10801080 type = ASRUtils::TYPE (ASR::make_Logical_t (al, loc, 4 ));
10811081 type = ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size ());
10821082 } else if (var_annotation == " CPtr" ) {
@@ -4446,11 +4446,11 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
44464446 if (AST ::is_a<AST ::Name_t>(*x.m_targets [0 ])) {
44474447 std::string tvar_name = AST ::down_cast<AST ::Name_t>(x.m_targets [0 ])->m_id ;
44484448 // Check if the type variable name is a reserved type keyword
4449- const char * type_list[14 ]
4449+ const char * type_list[15 ]
44504450 = { " list" , " set" , " dict" , " tuple" ,
44514451 " i8" , " i16" , " i32" , " i64" , " f32" ,
4452- " f64" , " c32" , " c64" , " str" , " bool" };
4453- for (int i = 0 ; i < 14 ; i++) {
4452+ " f64" , " c32" , " c64" , " str" , " bool" , " i1 " };
4453+ for (int i = 0 ; i < 15 ; i++) {
44544454 if (strcmp (s2c (al, tvar_name), type_list[i]) == 0 ) {
44554455 throw SemanticError (tvar_name + " is a reserved type, consider a different type variable name" ,
44564456 x.base .base .loc );
0 commit comments