Skip to content

Commit

Permalink
un-break unit tests from error message update
Browse files Browse the repository at this point in the history
  • Loading branch information
gewang committed Nov 26, 2023
1 parent 82d0db6 commit de83a1c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/core/chuck_lang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ t_CKBOOL init_class_string( Chuck_Env * env, Chuck_Type * type )

// add contructor
func = make_new_ctor( string_ctor_str );
func->add_arg( "string", "text" );
func->add_arg( "string", "str" );
func->doc = "construct a string as a copy of another string.";
if( !type_engine_import_ctor( env, func ) ) goto error;

Expand Down
10 changes: 5 additions & 5 deletions src/core/chuck_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2417,12 +2417,12 @@ t_CKBOOL type_engine_scan2_exp_decl_create( Chuck_Env * env, a_Exp_Decl decl )
if( !isaStr )
{
EM_error2( decl->where,
"...(primitive types: 'int', 'float', 'time', 'dur', 'complex', 'vec3', etc.)" );
"...(primitive types: 'int', 'float', 'time', 'dur', 'vec3', etc.)" );
}
else
{
EM_error2( decl->where,
"...(NOTE 'string' is a special kind of Object whose operation includes elements of Object types and primitive types; e.g., instantiation and function argument-passing are similar to any other Object; however assignment '@=>' and '=>' are carried out by-value, like other primitives such as 'int', 'float', 'time', 'dur', 'vec3', etc.)" );
"...(NOTE 'string' is a special Object whose operational semantics resemble both Object types and primitive types; e.g., instantiation and function argument-passing are like any other Object; however assignment '@=>' and '=>' are carried out by-value, as with primitive types such as 'int', 'float', 'time', 'dur', 'vec3', etc.)" );
}
return FALSE;
}
Expand Down Expand Up @@ -2773,7 +2773,7 @@ t_CKBOOL type_engine_scan2_class_def( Chuck_Env * env, a_Class_Def class_def )
EM_error2( class_def->ext->extend_id->where,
"cannot extend primitive type '%s'",
t_parent->c_name() );
EM_error2( 0, "...(primitive types: 'int', 'float', 'time', 'dur', 'complex', 'vec3', etc.)" );
EM_error2( 0, "...(primitive types: 'int', 'float', 'time', 'dur', 'vec3', etc.)" );
return FALSE;
}
}
Expand Down Expand Up @@ -2962,7 +2962,7 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f )
"cannot declare references (@) of primitive type '%s'...",
f->ret_type->c_name() );
EM_error2( f->type_decl->where,
"...(primitive types: 'int', 'float', 'time', 'dur', 'complex', 'vec3')" );
"...(primitive types: 'int', 'float', 'time', 'dur', 'vec3', etc.)" );
goto error;
}

Expand Down Expand Up @@ -3020,7 +3020,7 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f )
"cannot declare references (@) of primitive type '%s'...",
arg_list->type->c_name() );
EM_error2( arg_list->type_decl->where,
"...(primitive types: 'int', 'float', 'time', 'dur', 'complex', 'vec3')" );
"...(primitive types: 'int', 'float', 'time', 'dur', 'vec3', etc.)" );
goto error;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/chuck_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3176,7 +3176,7 @@ t_CKTYPE type_engine_check_exp_unary( Chuck_Env * env, a_Exp_Unary unary )
EM_error2( unary->type->where,
"cannot use 'new' on primitive type '%s'...",
t->c_name() );
EM_error2( 0, "(primitive types: 'int', 'float', 'time', 'dur', 'complex', 'vec3', etc.)" );
EM_error2( 0, "(primitive types: 'int', 'float', 'time', 'dur', 'vec3', etc.)" );
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/06-Errors/error-extend.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error-extend.ck:1:17: error: cannot extend primitive type 'int'
[1] class I extends int
^
error-extend.ck: ...(primitive types: 'int', 'float', 'time', 'dur', etc.)
error-extend.ck: ...(primitive types: 'int', 'float', 'time', 'dur', 'vec3', etc.)
2 changes: 1 addition & 1 deletion src/test/06-Errors/error-new-prim.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error-new-prim.ck:1:5: error: cannot use 'new' on primitive type 'int'...
[1] new int;
^
error-new-prim.ck: (primitive types: 'int', 'float', 'time', 'dur', etc.)
error-new-prim.ck: (primitive types: 'int', 'float', 'time', 'dur', 'vec3', etc.)

0 comments on commit de83a1c

Please sign in to comment.