diff --git a/daslib/perf_lint.das b/daslib/perf_lint.das index 774658eea1..a534b632af 100644 --- a/daslib/perf_lint.das +++ b/daslib/perf_lint.das @@ -10,7 +10,7 @@ module perf_lint shared private //! //! Detects common performance anti-patterns in daslang code at compile time. //! When this module is required, a lint pass runs after compilation and reports -//! warnings as ``CompilationError::performance_lint`` (error code 40217). +//! warnings as ``CompilationError::runtime_macro_performance`` (error code 31208). //! //! Rules: //! PERF001 — string += in loop (O(n²)) diff --git a/daslib/style_lint.das b/daslib/style_lint.das index fec0493632..4b5ed096d0 100644 --- a/daslib/style_lint.das +++ b/daslib/style_lint.das @@ -10,7 +10,7 @@ module style_lint shared private //! //! Detects non-idiomatic patterns in daslang code at compile time. //! When this module is required, a lint pass runs after compilation and reports -//! warnings as ``CompilationError::style_lint`` (error code 40218). +//! warnings as ``CompilationError::runtime_macro_style`` (error code 31209). //! //! Rules: //! STYLE001 — unnecessary <| pipe before block argument diff --git a/doc/internal/error_audit.csv b/doc/internal/error_audit.csv new file mode 100644 index 0000000000..251adcc822 --- /dev/null +++ b/doc/internal/error_audit.csv @@ -0,0 +1,1117 @@ +file,line,current_cerr,message_template,context_function,classification,tag_composition,proposed_enum_name,wording_change +src/ast/ast_infer_type.cpp,79,invalid_type,alias loop detected: '',InferTypes::visitAlias,primary,recursion | type_alias,recursion_type_alias, +src/ast/ast_infer_type.cpp,85,invalid_type,internal compiler error: can't be inferred: '',InferTypes::visitAlias,internal,internal | type_alias,internal_type_alias, +src/ast/ast_infer_type.cpp,91,invalid_type,can't be inferred: '',InferTypes::visitAlias,follow_on,not_resolved_yet | type_alias,not_resolved_yet_type_alias, +src/ast/ast_infer_type.cpp,155,,enumeration value '' can't be inferred yet,InferTypes::visitEnumerationValue,follow_on,not_resolved_yet | enumerator,not_resolved_yet_enumerator,current cerr unspecified - should be not_resolved_yet_enumerator +src/ast/ast_infer_type.cpp,167,,enumeration value '' can't be inferred yet,InferTypes::visitEnumerationValue,follow_on,not_resolved_yet | enumerator,not_resolved_yet_enumerator,current cerr unspecified - should be not_resolved_yet_enumerator +src/ast/ast_infer_type.cpp,170,invalid_enumeration,enumeration value '' has to be signed or unsigned integer of any size,InferTypes::visitEnumerationValue,primary,invalid | enumerator | type,invalid_enumerator_type, +src/ast/ast_infer_type.cpp,177,invalid_enumeration,enumeration value '' must be integer constant,InferTypes::visitEnumerationValue,primary,invalid | enumerator,invalid_enumerator, +src/ast/ast_infer_type.cpp,218,cant_infer_missing_initializer,"structure field type can't be inferred, it needs an initializer",InferTypes::preVisitStructureField,primary,missing | structure | field,missing_structure_field, +src/ast/ast_infer_type.cpp,255,,not fully resolved yet,InferTypes::visitStructureField,follow_on,not_resolved_yet | structure | field,not_resolved_yet_structure_field,current cerr unspecified - should be not_resolved_yet_structure_field; vague: clarify what is not resolved +src/ast/ast_infer_type.cpp,265,invalid_structure_field_type,undefined structure field type '',InferTypes::visitStructureField,primary,lookup | structure | field | type,lookup_structure_field_type, +src/ast/ast_infer_type.cpp,272,invalid_structure_field_type,"structure field initialization type can't be inferred, = ",InferTypes::visitStructureField,primary,invalid | structure | field | type,invalid_structure_field_type, +src/ast/ast_infer_type.cpp,286,invalid_structure_field_type,structure field type can't be declared void,InferTypes::visitStructureField,primary,invalid | structure | field | type | void,invalid_structure_field_type_void, +src/ast/ast_infer_type.cpp,289,invalid_structure_field_type,structure field type can't be declared a reference,InferTypes::visitStructureField,primary,invalid | structure | field | type | ref,invalid_structure_field_type_ref, +src/ast/ast_infer_type.cpp,295,unsafe,Uninitialized field is unsafe,InferTypes::visitStructureField,primary,unsafe | structure | field,unsafe_structure_field, +src/ast/ast_infer_type.cpp,305,invalid_initialization_type,field can't be copied,InferTypes::visitStructureField,primary,cant | structure | field,cant_copy_structure_field, +src/ast/ast_infer_type.cpp,312,invalid_initialization_type,field can't be initialized at all,InferTypes::visitStructureField,wording_fix,invalid | structure | field,invalid_structure_field_init,"typo: missing space, 'can't' -> ' can't'" +src/ast/ast_infer_type.cpp,315,cant_move,can't move from a constant value ,InferTypes::visitStructureField,primary,cant | structure | field,cant_move_structure_field, +src/ast/ast_infer_type.cpp,360,invalid_type,type creates circular dependency,InferTypes::visit(Structure*),primary,recursion | structure,recursion_structure, +src/ast/ast_infer_type.cpp,370,unsafe,Uninitialized variable is unsafe,InferTypes::preVisitGlobalLet,primary,unsafe | global,unsafe_global, +src/ast/ast_infer_type.cpp,375,no_global_variables,global variables are disabled by option no_global_variables_at_all,InferTypes::preVisitGlobalLet,primary,invalid | global | options,invalid_global_options, +src/ast/ast_infer_type.cpp,379,cant_infer_missing_initializer,"global variable type can't be inferred, it needs an initializer",InferTypes::preVisitGlobalLet,primary,missing | global,missing_global_init, +src/ast/ast_infer_type.cpp,387,invalid_type,undefined global variable type ,InferTypes::preVisitGlobalLet,primary,lookup | global | type,lookup_global_type, +src/ast/ast_infer_type.cpp,403,cant_infer_mismatching_restrictions,"global variable '' initialization type can't be inferred, = ",InferTypes::visitGlobalLetInit,primary,invalid | global | type,invalid_global_init_type, +src/ast/ast_infer_type.cpp,420,invalid_initialization_type,"global variable '' initialization type mismatch, const matters = ",InferTypes::visitGlobalLetInit,primary,invalid | global | type,invalid_global_init_type, +src/ast/ast_infer_type.cpp,423,invalid_initialization_type,global variable '' can't be initialized at all,InferTypes::visitGlobalLetInit,primary,invalid | global | type,invalid_global_init_type, +src/ast/ast_infer_type.cpp,426,cant_move,global variable '' can't init (move) from a constant value,InferTypes::visitGlobalLetInit,primary,cant | global,cant_move_global, +src/ast/ast_infer_type.cpp,429,cant_copy,global variable '' can't be copied,InferTypes::visitGlobalLetInit,primary,cant | global,cant_copy_global, +src/ast/ast_infer_type.cpp,436,cant_move,global variable '' can't be moved,InferTypes::visitGlobalLetInit,primary,cant | global,cant_move_global, +src/ast/ast_infer_type.cpp,467,no_init,[init] is disabled in the options or CodeOfPolicies,InferTypes::visitGlobalLetInit,primary,invalid | global | options,invalid_global_init_options, +src/ast/ast_infer_type.cpp,480,invalid_variable_type,global variable can't be declared a reference,InferTypes::visitGlobalLet,primary,invalid | global | type | ref,invalid_global_type_ref, +src/ast/ast_infer_type.cpp,483,invalid_variable_type,global variable can't be declared void,InferTypes::visitGlobalLet,primary,invalid | global | type | void,invalid_global_type_void, +src/ast/ast_infer_type.cpp,486,invalid_variable_type,can't have a global variable of type ,InferTypes::visitGlobalLet,primary,invalid | global | type,invalid_global_type, +src/ast/ast_infer_type.cpp,489,invalid_variable_type,shared global variable must be constant,InferTypes::visitGlobalLet,primary,invalid | global,invalid_global_shared, +src/ast/ast_infer_type.cpp,492,invalid_variable_type,shared global variable must be initialized,InferTypes::visitGlobalLet,primary,missing | global,missing_global_shared_init, +src/ast/ast_infer_type.cpp,496,invalid_variable_type,"this variable type can't be shared, ",InferTypes::visitGlobalLet,primary,invalid | global | type,invalid_global_type_shared, +src/ast/ast_infer_type.cpp,501,unsafe,can only have global pointers to classes ,InferTypes::visitGlobalLet,primary,unsafe | global,unsafe_global_pointer, +src/ast/ast_infer_type.cpp,505,invalid_variable_type,global variable of type needs to be initialized,InferTypes::visitGlobalLet,primary,missing | global,missing_global_init, +src/ast/ast_infer_type.cpp,543,too_many_arguments,"function has too many arguments, max allowed is DAS_MAX_FUNCTION_ARGUMENTS",InferTypes::preVisit(Function*),primary,exceeds | function | argument,exceeds_function_argument, +src/ast/ast_infer_type.cpp,547,no_init,[init] is disabled in the options or CodeOfPolicies,InferTypes::preVisit(Function*),primary,invalid | function | options,invalid_function_options, +src/ast/ast_infer_type.cpp,558,type_not_found,undefined function argument type ,InferTypes::preVisitArgument,primary,lookup | function | argument | type,lookup_function_argument_type, +src/ast/ast_infer_type.cpp,563,invalid_type,function argument type can't be declared void,InferTypes::preVisitArgument,primary,invalid | function | argument | type | void,invalid_function_argument_type_void, +src/ast/ast_infer_type.cpp,570,cant_infer_generic,function already exists in non-ref form,InferTypes::preVisitArgument,recategorize,already_declared | function,already_declared_function,recategorize: cant_infer_generic - actually a name collision; should be already_declared_function +src/ast/ast_infer_type.cpp,585,cant_infer_generic,"generic argument type can't be inferred, = ",InferTypes::visitArgumentInit,primary,invalid | function | argument | type,invalid_function_argument_type, +src/ast/ast_infer_type.cpp,596,invalid_type,function argument default value type mismatch '' vs '',InferTypes::visitArgumentInit,primary,invalid | function | argument | type,invalid_function_argument_type, +src/ast/ast_infer_type.cpp,600,invalid_type,"function argument default value type mismatch '' vs '', reference matters",InferTypes::visitArgumentInit,primary,invalid | function | argument | type | ref,invalid_function_argument_type_ref, +src/ast/ast_infer_type.cpp,607,cant_infer_generic,unresolved generics are not supported,InferTypes::visitArgument,primary,not_resolved_yet | function,not_resolved_yet_function, +src/ast/ast_infer_type.cpp,620,expecting_return_value,function does not return a value,InferTypes::visit(Function*),primary,missing | function | result,missing_function_result, +src/ast/ast_infer_type.cpp,633,type_not_found,undefined function result type '',InferTypes::visit(Function*),primary,lookup | function | result | type,lookup_function_result_type, +src/ast/ast_infer_type.cpp,639,invalid_return_type,not a valid function return type '',InferTypes::visit(Function*),primary,invalid | function | result | type,invalid_function_result_type, +src/ast/ast_infer_type.cpp,658,invalid_return_type,this type can't be copied or moved. not a valid function return type,InferTypes::visit(Function*),primary,invalid | function | result | type,invalid_function_result_type, +src/ast/ast_infer_type.cpp,677,unspecified,fully inferred function has changed,InferTypes::visit(Function*),internal,internal | function,internal_function_changed,current cerr unspecified - should be internal_function_changed +src/ast/ast_infer_type.cpp,783,invalid_enumeration,enumeration value not inferred yet ,InferTypes::visit(ExprConst*),follow_on,not_resolved_yet | enumerator,not_resolved_yet_enumerator, +src/ast/ast_infer_type.cpp,843,type_not_found,goto label type can't be inferred,InferTypes::visit(ExprGoto*),follow_on,not_resolved_yet | label | type,not_resolved_yet_label_type, +src/ast/ast_infer_type.cpp,848,invalid_label,"label type has to be int, not ",InferTypes::visit(ExprGoto*),primary,invalid | label | type,invalid_label_type, +src/ast/ast_infer_type.cpp,871,invalid_label,can't find label ,InferTypes::visit(ExprReader*),primary,lookup | label,lookup_label, +src/ast/ast_infer_type.cpp,885,unsupported_read_macro,unsupported read macro ,InferTypes::visit(ExprReader*),primary,invalid | macro,invalid_macro_read, +src/ast/ast_infer_type.cpp,893,invalid_label,duplicate label ,InferTypes::preVisit(ExprLabel*),primary,already_declared | label,already_declared_label, +src/ast/ast_infer_type.cpp,936,invalid_type,can only dereference a reference,InferTypes::visit(ExprRef2Value*),recategorize,cant | expression,cant_dereference_value,recategorize: invalid_type - actually a deref fault; should be cant_dereference +src/ast/ast_infer_type.cpp,940,invalid_type,"can only dereference value types, not a ",InferTypes::visit(ExprRef2Value*),recategorize,cant | expression,cant_dereference_value,recategorize: invalid_type - should be cant_dereference +src/ast/ast_infer_type.cpp,961,type_not_found,undefined address expression type ,InferTypes::visit(ExprAddr*),primary,lookup | function | type,lookup_function_address_type, +src/ast/ast_infer_type.cpp,967,type_not_found,function of undefined type ,InferTypes::visit(ExprAddr*),primary,lookup | function | type,lookup_function_type, +src/ast/ast_infer_type.cpp,977,type_not_found,function of non-function type ,InferTypes::visit(ExprAddr*),recategorize,invalid | function | type,invalid_function_type,recategorize: type_not_found - actually wrong-type fault; should be invalid_function_type +src/ast/ast_infer_type.cpp,997,function_not_found,can't take address of a template function ,InferTypes::visit(ExprAddr*),recategorize,cant | function,cant_address_template_function,recategorize: function_not_found - actually a forbidden-op; should be cant_address_template_function +src/ast/ast_infer_type.cpp,1007,function_not_found,function not found ,InferTypes::visit(ExprAddr*),primary,lookup | function,lookup_function, +src/ast/ast_infer_type.cpp,1012,function_not_found,function not found ,InferTypes::visit(ExprAddr*),mid_inference,lookup | function,lookup_function, +src/ast/ast_infer_type.cpp,1036,type_not_found,can't get address of builtin function ,InferTypes::visit(ExprAddr*),recategorize,cant | function,cant_address_builtin_function,recategorize: type_not_found - actually forbidden; should be cant_address_builtin_function +src/ast/ast_infer_type.cpp,1054,type_not_found,dereference type can't be inferred,InferTypes::visit(ExprPtr2Ref*),follow_on,not_resolved_yet | expression | type,not_resolved_yet_dereference_type, +src/ast/ast_infer_type.cpp,1059,cant_dereference,can only dereference a pointer,InferTypes::visit(ExprPtr2Ref*),primary,cant | expression,cant_dereference, +src/ast/ast_infer_type.cpp,1062,cant_dereference,can only dereference a pointer to something,InferTypes::visit(ExprPtr2Ref*),primary,cant | expression,cant_dereference_void_ptr, +src/ast/ast_infer_type.cpp,1078,cant_dereference,can only make a pointer of a reference,InferTypes::visit(ExprRef2Ptr*),primary,cant | expression,cant_take_pointer_of_value, +src/ast/ast_infer_type.cpp,1099,unsafe,address of reference requires unsafe,InferTypes::visit(ExprRef2Ptr*),primary,unsafe | expression,unsafe_address_of_reference, +src/ast/ast_infer_type.cpp,1153,type_not_found,null coalescing type can't be inferred,InferTypes::visit(ExprNullCoalescing*),follow_on,not_resolved_yet | expression | type,not_resolved_yet_null_coalescing_type, +src/ast/ast_infer_type.cpp,1159,cant_dereference,can only dereference a pointer,InferTypes::visit(ExprNullCoalescing*),primary,cant | expression,cant_dereference, +src/ast/ast_infer_type.cpp,1162,cant_dereference,can only dereference a pointer to something,InferTypes::visit(ExprNullCoalescing*),primary,cant | expression,cant_dereference_void_ptr, +src/ast/ast_infer_type.cpp,1165,cant_dereference,default value type mismatch in vs ,InferTypes::visit(ExprNullCoalescing*),recategorize,invalid | expression | type,invalid_null_coalescing_type,recategorize: cant_dereference - actually type-mismatch; should be invalid_null_coalescing_type +src/ast/ast_infer_type.cpp,1168,cant_dereference,"default value type mismatch, constant matters in vs ",InferTypes::visit(ExprNullCoalescing*),recategorize,invalid | expression | type,invalid_null_coalescing_type,recategorize: cant_dereference - actually type-mismatch +src/ast/ast_infer_type.cpp,1192,invalid_argument_count,"static_assert(expr) or static_assert(expr,string)",InferTypes::visit(ExprStaticAssert*),primary,invalid | argument,invalid_static_assert_argument_count, +src/ast/ast_infer_type.cpp,1199,type_not_found,static_assert argument type can't be inferred,InferTypes::visit(ExprStaticAssert*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_argument_type, +src/ast/ast_infer_type.cpp,1204,invalid_argument_type,static assert condition must be boolean,InferTypes::visit(ExprStaticAssert*),primary,invalid | argument | type,invalid_static_assert_condition_type, +src/ast/ast_infer_type.cpp,1207,invalid_argument_type,static assert comment must be string constant,InferTypes::visit(ExprStaticAssert*),primary,invalid | argument | type,invalid_static_assert_comment_type, +src/ast/ast_infer_type.cpp,1233,concept_failed,,InferTypes::visit(ExprStaticAssert*),mid_inference,runtime | macro,concept_failed, +src/ast/ast_infer_type.cpp,1239,static_assert_failed,,InferTypes::visit(ExprStaticAssert*),mid_inference,runtime | macro,static_assert_failed, +src/ast/ast_infer_type.cpp,1260,invalid_argument_count,"assert(expr) or assert(expr,string)",InferTypes::visit(ExprAssert*),primary,invalid | argument,invalid_assert_argument_count, +src/ast/ast_infer_type.cpp,1267,type_not_found,assert argument type can't be inferred,InferTypes::visit(ExprAssert*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_argument_type, +src/ast/ast_infer_type.cpp,1272,invalid_argument_type,assert condition must be boolean,InferTypes::visit(ExprAssert*),primary,invalid | argument | type,invalid_assert_condition_type, +src/ast/ast_infer_type.cpp,1275,invalid_argument_type,assert comment must be string constant,InferTypes::visit(ExprAssert*),primary,invalid | argument | type,invalid_assert_comment_type, +src/ast/ast_infer_type.cpp,1283,invalid_argument_count,quote(expr) only. can only return one expression tree,InferTypes::visit(ExprQuote*),primary,invalid | argument,invalid_quote_argument_count, +src/ast/ast_infer_type.cpp,1306,invalid_argument_count,"debug(expr) or debug(expr,string)",InferTypes::visit(ExprDebug*),primary,invalid | argument,invalid_debug_argument_count, +src/ast/ast_infer_type.cpp,1312,invalid_argument_type,debug comment must be string constant,InferTypes::visit(ExprDebug*),primary,invalid | argument | type,invalid_debug_comment_type, +src/ast/ast_infer_type.cpp,1325,invalid_argument_count,memzero(ref expr),InferTypes::visit(ExprMemZero*),primary,invalid | argument,invalid_memzero_argument_count, +src/ast/ast_infer_type.cpp,1332,invalid_argument_type,memzero argument must be reference,InferTypes::visit(ExprMemZero*),primary,invalid | argument | type | ref,invalid_memzero_argument_type_ref, +src/ast/ast_infer_type.cpp,1335,invalid_argument_type,memzero argument can't be constant,InferTypes::visit(ExprMemZero*),primary,invalid | argument | type,invalid_memzero_argument_const, +src/ast/ast_infer_type.cpp,1357,function_not_found,ambiguous call macro ,InferTypes::visit(ExprInvoke*),primary,ambiguous | macro,ambiguous_call_macro, +src/ast/ast_infer_type.cpp,1433,function_not_found,too many candidates for super call ,InferTypes::visit(ExprInvoke*),mid_inference,ambiguous | function,ambiguous_super_call, +src/ast/ast_infer_type.cpp,1440,function_not_found,call to super in is not allowed,InferTypes::visit(ExprInvoke*),primary,lookup | function,lookup_super_method, +src/ast/ast_infer_type.cpp,1444,function_not_found,call to super in is not allowed,InferTypes::visit(ExprInvoke*),primary,invalid | function,invalid_super_call_no_base, +src/ast/ast_infer_type.cpp,1450,function_not_found,"can't infer method call, field type is not inferred yet",InferTypes::visit(ExprInvoke*),follow_on,not_resolved_yet | function,not_resolved_yet_method_call, +src/ast/ast_infer_type.cpp,1580,invalid_argument_count,recursive call in argument initializer,InferTypes::visit(ExprInvoke*),primary,recursion | function | argument,recursion_function_argument, +src/ast/ast_infer_type.cpp,1601,invalid_argument_count,'' is not fully resolved yet,InferTypes::visit(ExprInvoke*),follow_on,not_resolved_yet | function,not_resolved_yet_function, +src/ast/ast_infer_type.cpp,1605,invalid_argument_count,expecting class_ptr or cast class_ptr,InferTypes::visit(ExprInvoke*),primary,invalid | argument | type,invalid_invoke_argument_type, +src/ast/ast_infer_type.cpp,1617,invalid_argument_count,'->.' expecting function,InferTypes::visit(ExprInvoke*),primary,invalid | function | type,invalid_invoke_target_type, +src/ast/ast_infer_type.cpp,1620,invalid_argument_count,'->.' expecting function,InferTypes::visit(ExprInvoke*),wording_fix,invalid | function | type,invalid_invoke_target_type,duplicate error call - line 1617 already emitted same error; remove duplicate +src/ast/ast_infer_type.cpp,1624,invalid_argument_count,'->.' not found,InferTypes::visit(ExprInvoke*),primary,lookup | function,lookup_method, +src/ast/ast_infer_type.cpp,1628,invalid_argument_count,expecting class->method,InferTypes::visit(ExprInvoke*),primary,invalid | expression,invalid_invoke_method_syntax, +src/ast/ast_infer_type.cpp,1632,invalid_argument_count,class type is not inferred yet,InferTypes::visit(ExprInvoke*),follow_on,not_resolved_yet | type,not_resolved_yet_class_type, +src/ast/ast_infer_type.cpp,1636,invalid_argument_count,expecting class.method in the method invoke,InferTypes::visit(ExprInvoke*),primary,invalid | expression,invalid_invoke_method_syntax, +src/ast/ast_infer_type.cpp,1640,invalid_argument_count,"expecting arguments, got ",InferTypes::visit(ExprInvoke*),primary,invalid | argument,invalid_invoke_argument_count, +src/ast/ast_infer_type.cpp,1659,invalid_argument_count,expecting invoke(block_or_function_or_lambda) or invoke(...),InferTypes::visit(ExprInvoke*),primary,invalid | argument,invalid_invoke_argument_count, +src/ast/ast_infer_type.cpp,1667,invalid_argument_type,invoke argument type can't be inferred,InferTypes::visit(ExprInvoke*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_invoke_argument_type, +src/ast/ast_infer_type.cpp,1672,invalid_argument_type,invoke argument not fully inferred ,InferTypes::visit(ExprInvoke*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_invoke_argument_type, +src/ast/ast_infer_type.cpp,1687,invalid_argument_type,"expecting block, or function, or lambda, or string, not a ",InferTypes::visit(ExprInvoke*),primary,invalid | argument | type,invalid_invoke_target_type, +src/ast/ast_infer_type.cpp,1692,invalid_argument_count,"invalid number of arguments, expecting ",InferTypes::visit(ExprInvoke*),primary,invalid | argument,invalid_invoke_argument_count, +src/ast/ast_infer_type.cpp,1702,invalid_argument_type,invoke argument type can't be inferred,InferTypes::visit(ExprInvoke*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_invoke_argument_type, +src/ast/ast_infer_type.cpp,1709,invalid_argument_type,incompatible argument ,InferTypes::visit(ExprInvoke*),primary,invalid | argument | type,invalid_invoke_argument_type, +src/ast/ast_infer_type.cpp,1752,invalid_argument_count,"insert(table,key)",InferTypes::visit(ExprSetInsert*),primary,invalid | argument,invalid_insert_argument_count, +src/ast/ast_infer_type.cpp,1761,type_not_found,argument type can't be inferred,InferTypes::visit(ExprSetInsert*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_argument_type, +src/ast/ast_infer_type.cpp,1767,invalid_argument_type,"key must be of the same type as table",InferTypes::visit(ExprSetInsert*),primary,invalid | argument | type | table,invalid_table_key_type, +src/ast/ast_infer_type.cpp,1771,invalid_argument_type,first argument must be fully qualified table,InferTypes::visit(ExprSetInsert*),primary,invalid | argument | type | table,invalid_table_argument_type, +src/ast/ast_infer_type.cpp,1784,invalid_argument_count,"eraseKey(table,key)",InferTypes::visit(ExprErase*),primary,invalid | argument,invalid_erase_argument_count, +src/ast/ast_infer_type.cpp,1793,type_not_found,argument type can't be inferred,InferTypes::visit(ExprErase*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_argument_type, +src/ast/ast_infer_type.cpp,1799,invalid_argument_type,"key must be of the same type as table",InferTypes::visit(ExprErase*),primary,invalid | argument | type | table,invalid_table_key_type, +src/ast/ast_infer_type.cpp,1803,invalid_argument_type,first argument must be fully qualified table,InferTypes::visit(ExprErase*),primary,invalid | argument | type | table,invalid_table_argument_type, +src/ast/ast_infer_type.cpp,1816,invalid_argument_count,"findKey(table,key)",InferTypes::visit(ExprFind*),primary,invalid | argument,invalid_find_argument_count, +src/ast/ast_infer_type.cpp,1825,type_not_found,argument type can't be inferred,InferTypes::visit(ExprFind*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_argument_type, +src/ast/ast_infer_type.cpp,1831,invalid_argument_type,"key must be of the same type as table",InferTypes::visit(ExprFind*),primary,invalid | argument | type | table,invalid_table_key_type, +src/ast/ast_infer_type.cpp,1836,invalid_argument_type,first argument must be fully qualified table,InferTypes::visit(ExprFind*),primary,invalid | argument | type | table,invalid_table_argument_type, +src/ast/ast_infer_type.cpp,1850,invalid_argument_count,"keyExists(table,key)",InferTypes::visit(ExprKeyExists*),primary,invalid | argument,invalid_key_exists_argument_count, +src/ast/ast_infer_type.cpp,1859,type_not_found,argument type can't be inferred,InferTypes::visit(ExprKeyExists*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_argument_type, +src/ast/ast_infer_type.cpp,1865,invalid_argument_type,"key must be of the same type as table",InferTypes::visit(ExprKeyExists*),primary,invalid | argument | type | table,invalid_table_key_type, +src/ast/ast_infer_type.cpp,1869,invalid_argument_type,first argument must be fully qualified table,InferTypes::visit(ExprKeyExists*),primary,invalid | argument | type | table,invalid_table_argument_type, +src/ast/ast_infer_type.cpp,1884,type_not_found,is expression type can't be inferred,InferTypes::visit(ExprIs*),follow_on,not_resolved_yet | expression | type,not_resolved_yet_is_expression_type, +src/ast/ast_infer_type.cpp,1896,type_not_found,is can't be inferred,InferTypes::visit(ExprIs*),follow_on,not_resolved_yet | expression | type,not_resolved_yet_is_expression_type, +src/ast/ast_infer_type.cpp,1907,type_not_found,undefined is expression type ,InferTypes::visit(ExprIs*),primary,lookup | expression | type,lookup_is_expression_type, +src/ast/ast_infer_type.cpp,1913,typeinfo_auto,is ... auto is undefined,InferTypes::visit(ExprIs*),primary,invalid | expression | type | auto,invalid_is_expression_auto, +src/ast/ast_infer_type.cpp,1918,type_not_found,is can't be fully inferred,InferTypes::visit(ExprIs*),follow_on,not_resolved_yet | expression | type,not_resolved_yet_is_expression_type, +src/ast/ast_infer_type.cpp,1942,type_not_found,undefined type<>,InferTypes::visit(ExprTypeDecl*),primary,lookup | type,lookup_type, +src/ast/ast_infer_type.cpp,1948,type_not_found,type<> can't be fully inferred,InferTypes::visit(ExprTypeDecl*),follow_on,not_resolved_yet | type,not_resolved_yet_type, +src/ast/ast_infer_type.cpp,1976,type_not_found,typeinfo() can't be inferred,InferTypes::visit(ExprTypeInfo*),follow_on,not_resolved_yet | macro | type,not_resolved_yet_typeinfo, +src/ast/ast_infer_type.cpp,1989,type_not_found,undefined typeinfo type expression type ,InferTypes::visit(ExprTypeInfo*),primary,lookup | macro | type,lookup_typeinfo_type, +src/ast/ast_infer_type.cpp,1995,typeinfo_auto,typeinfo(... auto) is undefined,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type | auto,invalid_typeinfo_auto, +src/ast/ast_infer_type.cpp,2000,type_not_found,typeinfo() can't be fully inferred,InferTypes::visit(ExprTypeInfo*),follow_on,not_resolved_yet | macro | type,not_resolved_yet_typeinfo, +src/ast/ast_infer_type.cpp,2011,invalid_type,typeinfo(sizeof ) is not fully inferred yet,InferTypes::visit(ExprTypeInfo*),follow_on,not_resolved_yet | macro | type,not_resolved_yet_typeinfo_sizeof, +src/ast/ast_infer_type.cpp,2016,invalid_type,typeinfo(sizeof ) is too big,InferTypes::visit(ExprTypeInfo*),primary,exceeds | macro | type,exceeds_typeinfo_sizeof, +src/ast/ast_infer_type.cpp,2026,invalid_type,typeinfo(alignof ) is not fully inferred yet,InferTypes::visit(ExprTypeInfo*),follow_on,not_resolved_yet | macro | type,not_resolved_yet_typeinfo_alignof, +src/ast/ast_infer_type.cpp,2037,type_not_found,typeinfo(dim ) is not fully inferred,InferTypes::visit(ExprTypeInfo*),follow_on,not_resolved_yet | macro | type,not_resolved_yet_typeinfo_dim, +src/ast/ast_infer_type.cpp,2045,typeinfo_dim,"typeinfo(dim non_array) is prohibited, ",InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type,invalid_typeinfo_dim, +src/ast/ast_infer_type.cpp,2050,type_not_found,typeinfo(dim_table_value ) is not a table type,InferTypes::visit(ExprTypeInfo*),recategorize,invalid | macro | type | table,invalid_typeinfo_dim_table_type,recategorize: type_not_found - actually wrong-type fault +src/ast/ast_infer_type.cpp,2055,type_not_found,typeinfo(dim_table_value ) is not a table type with value,InferTypes::visit(ExprTypeInfo*),recategorize,invalid | macro | type | table,invalid_typeinfo_dim_table_type,recategorize: type_not_found - actually wrong-type fault +src/ast/ast_infer_type.cpp,2060,type_not_found,typeinfo(dim_table_value ) is not fully inferred,InferTypes::visit(ExprTypeInfo*),follow_on,not_resolved_yet | macro | type | table,not_resolved_yet_typeinfo_dim_table, +src/ast/ast_infer_type.cpp,2068,typeinfo_dim,"typeinfo(dim_table_value table<...,non_array>) is prohibited, ",InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type | table,invalid_typeinfo_dim_table, +src/ast/ast_infer_type.cpp,2078,invalid_type,"variant_index only valid for variant, not for ",InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type | variant,invalid_typeinfo_variant_index_type, +src/ast/ast_infer_type.cpp,2090,typeinfo_undefined,variant_index variant not found in ,InferTypes::visit(ExprTypeInfo*),primary,lookup | variant,lookup_variant_field, +src/ast/ast_infer_type.cpp,2096,typeinfo_undefined,mangled name requires subexpression,InferTypes::visit(ExprTypeInfo*),primary,missing | macro | expression,missing_typeinfo_subexpression, +src/ast/ast_infer_type.cpp,2102,typeinfo_undefined,mangled name of unknown @@function,InferTypes::visit(ExprTypeInfo*),primary,lookup | function,lookup_function_mangled_name, +src/ast/ast_infer_type.cpp,2109,typeinfo_undefined,unsupported mangled name subexpression,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | expression,invalid_typeinfo_mangled_subexpression, +src/ast/ast_infer_type.cpp,2115,typeinfo_undefined,is argument requires subexpression,InferTypes::visit(ExprTypeInfo*),primary,missing | macro | expression,missing_typeinfo_subexpression, +src/ast/ast_infer_type.cpp,2153,typeinfo_undefined,can't get struct_name of ,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type,invalid_typeinfo_struct_name, +src/ast/ast_infer_type.cpp,2162,typeinfo_undefined,can't get struct_modulename of ,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type,invalid_typeinfo_struct_modulename, +src/ast/ast_infer_type.cpp,2332,typeinfo_undefined,typeinfo(has_field<> ...) is only defined for structures and handled types,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type | structure,invalid_typeinfo_has_field_type, +src/ast/ast_infer_type.cpp,2346,typeinfo_undefined,typeinfo(struct_has_annotation<> ...) is only defined for structures,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type | structure,invalid_typeinfo_struct_has_annotation_type, +src/ast/ast_infer_type.cpp,2358,typeinfo_undefined,typeinfo(struct_has_annotation_argument<;> ...) annotation not found,InferTypes::visit(ExprTypeInfo*),primary,lookup | annotation,lookup_typeinfo_annotation, +src/ast/ast_infer_type.cpp,2371,typeinfo_undefined,typeinfo(struct_has_annotation_argument<> ...) is only defined for structures,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type | structure,invalid_typeinfo_struct_has_annotation_argument_type, +src/ast/ast_infer_type.cpp,2381,typeinfo_undefined,typeinfo(struct_get_annotation_argument<;> ...) annotation not found,InferTypes::visit(ExprTypeInfo*),primary,lookup | annotation,lookup_typeinfo_annotation, +src/ast/ast_infer_type.cpp,2387,typeinfo_undefined,typeinfo(struct_get_annotation_argument<;> ...) annotation argument not found,InferTypes::visit(ExprTypeInfo*),primary,lookup | annotation,lookup_typeinfo_annotation_argument, +src/ast/ast_infer_type.cpp,2403,typeinfo_undefined,typeinfo(struct_get_annotation_argument<;> ...) unsupported annotation argument type,InferTypes::visit(ExprTypeInfo*),primary,invalid | annotation | type,invalid_typeinfo_annotation_argument_type, +src/ast/ast_infer_type.cpp,2409,typeinfo_undefined,typeinfo(struct_get_annotation_argument<> ...) is only defined for structures,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type | structure,invalid_typeinfo_struct_get_annotation_argument_type, +src/ast/ast_infer_type.cpp,2420,typeinfo_undefined,"typeinfo(offsetof<> ...) of undefined type, ",InferTypes::visit(ExprTypeInfo*),primary,lookup | macro | type,lookup_typeinfo_offsetof_type, +src/ast/ast_infer_type.cpp,2424,typeinfo_undefined,typeinfo(offsetof<> ...) is only defined for structures,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | type | structure,invalid_typeinfo_offsetof_type, +src/ast/ast_infer_type.cpp,2429,typeinfo_undefined,builtin_function_exists requires subexpression,InferTypes::visit(ExprTypeInfo*),primary,missing | macro | expression,missing_typeinfo_subexpression, +src/ast/ast_infer_type.cpp,2438,typeinfo_undefined,builtin_function_exists of non-builtin function @@,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | function,invalid_typeinfo_builtin_function, +src/ast/ast_infer_type.cpp,2445,typeinfo_undefined,unsupported mangled name subexpression,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | expression,invalid_typeinfo_mangled_subexpression, +src/ast/ast_infer_type.cpp,2451,typeinfo_undefined,builtin_module_exists requires subexpression,InferTypes::visit(ExprTypeInfo*),primary,missing | macro | expression,missing_typeinfo_subexpression, +src/ast/ast_infer_type.cpp,2460,typeinfo_undefined,unsupported module name subexpression,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | module,invalid_typeinfo_module_subexpression, +src/ast/ast_infer_type.cpp,2469,typeinfo_undefined,builtin_function_exists requires annotation type,InferTypes::visit(ExprTypeInfo*),primary,invalid | macro | annotation,invalid_typeinfo_builtin_annotation, +src/ast/ast_infer_type.cpp,2478,typeinfo_undefined,typeinfo( ...) too many macros match the trait,InferTypes::visit(ExprTypeInfo*),primary,ambiguous | macro,ambiguous_typeinfo_macro, +src/ast/ast_infer_type.cpp,2481,typeinfo_undefined,"typeinfo( ...) is undefined, ",InferTypes::visit(ExprTypeInfo*),primary,lookup | macro,lookup_typeinfo_macro, +src/ast/ast_infer_type.cpp,2491,typeinfo_macro_error,typeinfo( ...) macro reported error,InferTypes::visit(ExprTypeInfo*),primary,runtime | macro,runtime_typeinfo_macro, +src/ast/ast_infer_type.cpp,2502,typeinfo_macro_error,typeinfo( ...) macro reported error,InferTypes::visit(ExprTypeInfo*),primary,runtime | macro,runtime_typeinfo_macro, +src/ast/ast_infer_type.cpp,2505,typeinfo_macro_error,typeinfo( ...) is macro integration error,InferTypes::visit(ExprTypeInfo*),internal,internal | macro,internal_typeinfo_macro, +src/ast/ast_infer_type.cpp,2527,bad_delete,delete super.self is only allowed inside operator delete (a finalizer),InferTypes::visit(ExprDelete*),primary,cant | function,cant_delete_super_outside_finalizer, +src/ast/ast_infer_type.cpp,2533,bad_delete,delete super.self: finalizer's first argument must be 'self' of a structure type,InferTypes::visit(ExprDelete*),primary,invalid | function | argument | type,invalid_delete_super_self_type, +src/ast/ast_infer_type.cpp,2540,bad_delete,delete super.self: has no base class or structure,InferTypes::visit(ExprDelete*),primary,lookup | structure,lookup_super_class, +src/ast/ast_infer_type.cpp,2576,bad_delete,delete super.self in : no ancestor of defines a finalizer,InferTypes::visit(ExprDelete*),primary,lookup | function,lookup_super_finalizer, +src/ast/ast_infer_type.cpp,2607,type_not_found,delete size type can't be inferred,InferTypes::visit(ExprDelete*),follow_on,not_resolved_yet | expression | type,not_resolved_yet_delete_size_type, +src/ast/ast_infer_type.cpp,2612,bad_delete,"can't delete, expecting size to be int and not ",InferTypes::visit(ExprDelete*),primary,invalid | expression | type,invalid_delete_size_type, +src/ast/ast_infer_type.cpp,2618,unsafe,delete of requires unsafe,InferTypes::visit(ExprDelete*),primary,unsafe | expression,unsafe_delete, +src/ast/ast_infer_type.cpp,2624,bad_delete,can't delete ,InferTypes::visit(ExprDelete*),primary,cant | expression,cant_delete, +src/ast/ast_infer_type.cpp,2627,bad_delete,can only delete reference ,InferTypes::visit(ExprDelete*),primary,cant | expression,cant_delete_non_reference, +src/ast/ast_infer_type.cpp,2630,bad_delete,can't delete constant expression ,InferTypes::visit(ExprDelete*),primary,cant | expression,cant_delete_constant, +src/ast/ast_infer_type.cpp,2634,unsafe,delete of pointer requires unsafe,InferTypes::visit(ExprDelete*),primary,unsafe | expression,unsafe_delete_pointer, +src/ast/ast_infer_type.cpp,2638,bad_delete,can't delete smart pointer type via regular pointer delete,InferTypes::visit(ExprDelete*),primary,cant | expression,cant_delete_smart_pointer, +src/ast/ast_infer_type.cpp,2655,function_already_declared,too many finalizers,InferTypes::visit(ExprDelete*),mid_inference,ambiguous | function,ambiguous_finalizer, +src/ast/ast_infer_type.cpp,2739,type_not_found,undefined cast type ,InferTypes::visit(ExprCast*),primary,lookup | type,lookup_cast_type, +src/ast/ast_infer_type.cpp,2745,type_not_found,casting to undefined type ,InferTypes::visit(ExprCast*),primary,lookup | type,lookup_cast_type, +src/ast/ast_infer_type.cpp,2770,unsafe,cast requires unsafe,InferTypes::visit(ExprCast*),primary,unsafe | expression,unsafe_cast, +src/ast/ast_infer_type.cpp,2777,type_not_found,can't cast to ,InferTypes::visit(ExprCast*),recategorize,invalid | expression | type,invalid_cast_type,recategorize: type_not_found - actually a cast-mismatch +src/ast/ast_infer_type.cpp,2794,invalid_new_type,can't ascend (to heap) non-reference value,InferTypes::visit(ExprAscend*),primary,cant | expression,cant_ascend_non_reference, +src/ast/ast_infer_type.cpp,2799,invalid_new_type,array of handled type cannot be allocated on the heap: '',InferTypes::visit(ExprAscend*),primary,invalid | type | array,invalid_ascend_array_handle_type, +src/ast/ast_infer_type.cpp,2803,invalid_new_type,cannot allocate on the heap this handled type at all: '',InferTypes::visit(ExprAscend*),primary,invalid | type,invalid_ascend_handle_type, +src/ast/ast_infer_type.cpp,2823,too_many_arguments,"too many arguments in 'new', max allowed",InferTypes::preVisit(ExprNew*),primary,exceeds | function | argument,exceeds_new_argument, +src/ast/ast_infer_type.cpp,2833,invalid_argument_type,block can't be function argument,InferTypes::checkEmptyBlock,primary,invalid | function | argument | type | block,invalid_function_argument_type_block, +src/ast/ast_infer_type.cpp,2852,type_not_found,new type did not infer,InferTypes::visit(ExprNew*),follow_on,not_resolved_yet | type,not_resolved_yet_new_type, +src/ast/ast_infer_type.cpp,2868,type_not_found,undefined new expression type '',InferTypes::visit(ExprNew*),primary,lookup | type,lookup_new_type, +src/ast/ast_infer_type.cpp,2876,invalid_new_type,a reference cannot be allocated on the heap,InferTypes::visit(ExprNew*),primary,invalid | type | ref,invalid_new_type_ref, +src/ast/ast_infer_type.cpp,2880,invalid_new_type,invalid syntax for 'new' of class,InferTypes::visit(ExprNew*),primary,invalid | type,invalid_new_class_syntax, +src/ast/ast_infer_type.cpp,2897,invalid_new_type,cannot allocate this type on the heap: '',InferTypes::visit(ExprNew*),primary,invalid | type,invalid_new_type, +src/ast/ast_infer_type.cpp,2902,invalid_new_type,new expression cannot be auto or alias type '',InferTypes::visit(ExprNew*),primary,invalid | type | auto,invalid_new_type_auto, +src/ast/ast_infer_type.cpp,2913,invalid_new_type,new expression cannot be auto or alias type '',InferTypes::visit(ExprNew*),primary,invalid | type | auto,invalid_new_type_auto, +src/ast/ast_infer_type.cpp,2923,invalid_new_type,"only tuples, variants, structures or handled types can be allocated on the heap, not ''",InferTypes::visit(ExprNew*),primary,invalid | type,invalid_new_type, +src/ast/ast_infer_type.cpp,2927,invalid_new_type,"only native structures can have initializers, not ''",InferTypes::visit(ExprNew*),primary,invalid | type,invalid_new_initializer_type, +src/ast/ast_infer_type.cpp,2943,invalid_new_type,initializer returns '' vs '',InferTypes::visit(ExprNew*),primary,invalid | function | result | type,invalid_new_initializer_result_type, +src/ast/ast_infer_type.cpp,2956,invalid_new_type,'' does not have default initializer,InferTypes::visit(ExprNew*),primary,missing | function,missing_new_default_initializer, +src/ast/ast_infer_type.cpp,2992,type_not_found,index type can't be inferred,InferTypes::visit(ExprAt*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_index_type, +src/ast/ast_infer_type.cpp,2998,invalid_index_type,"table index type mismatch, '' vs ''",InferTypes::visit(ExprAt*),primary,invalid | argument | type | table,invalid_table_index_type, +src/ast/ast_infer_type.cpp,3003,invalid_table_type,"cannot access the constant table by index, use 'get' instead",InferTypes::visit(ExprAt*),recategorize,cant | table,cant_index_const_table,recategorize: invalid_table_type - cant operation; should be cant_index_const_table +src/ast/ast_infer_type.cpp,3008,invalid_index_type,can't index with the temporary key,InferTypes::visit(ExprAt*),primary,cant | argument,cant_index_temporary_key, +src/ast/ast_infer_type.cpp,3013,invalid_index_type,table<...; void> cannot be accessed by index,InferTypes::visit(ExprAt*),primary,cant | table | void,cant_index_void_table, +src/ast/ast_infer_type.cpp,3018,unsafe,table index requires unsafe,InferTypes::visit(ExprAt*),primary,unsafe | table,unsafe_table_index, +src/ast/ast_infer_type.cpp,3026,invalid_index_type,handle '' does not support index type '',InferTypes::visit(ExprAt*),primary,invalid | argument | type,invalid_handle_index_type, +src/ast/ast_infer_type.cpp,3034,unsafe,index of the pointer must be inside the 'unsafe' block,InferTypes::visit(ExprAt*),primary,unsafe | expression,unsafe_pointer_index, +src/ast/ast_infer_type.cpp,3038,invalid_index_type,"index type must be 'int', 'int64', 'uint', or 'uint64' and not ''",InferTypes::visit(ExprAt*),primary,invalid | argument | type,invalid_index_type, +src/ast/ast_infer_type.cpp,3042,invalid_index_type,can't index 'void' pointer,InferTypes::visit(ExprAt*),primary,cant | expression | void,cant_index_void_pointer, +src/ast/ast_infer_type.cpp,3061,invalid_index_type,"index type must be 'int' or 'uint', not ''",InferTypes::visit(ExprAt*),primary,invalid | argument | type,invalid_index_type, +src/ast/ast_infer_type.cpp,3073,cant_index,type can't be indexed: '',InferTypes::visit(ExprAt*),primary,cant | expression,cant_index, +src/ast/ast_infer_type.cpp,3077,cant_index,type dimensions are not resolved yet: '',InferTypes::visit(ExprAt*),follow_on,not_resolved_yet | type,not_resolved_yet_array_dimension, +src/ast/ast_infer_type.cpp,3108,type_not_found,safe index type can't be inferred,InferTypes::visit(ExprSafeAt*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_index_type, +src/ast/ast_infer_type.cpp,3114,cant_index,can't index 'void' pointer,InferTypes::visit(ExprSafeAt*),primary,cant | expression | void,cant_index_void_pointer, +src/ast/ast_infer_type.cpp,3121,unsafe,safe-index of table<> must be inside the 'unsafe' block,InferTypes::visit(ExprSafeAt*),primary,unsafe | table,unsafe_table_safe_index, +src/ast/ast_infer_type.cpp,3125,invalid_index_type,"table safe-index type mismatch, '' vs ''",InferTypes::visit(ExprSafeAt*),primary,invalid | argument | type | table,invalid_table_safe_index_type, +src/ast/ast_infer_type.cpp,3135,invalid_index_type,handle '' does not support safe index type '',InferTypes::visit(ExprSafeAt*),primary,invalid | argument | type,invalid_handle_safe_index_type, +src/ast/ast_infer_type.cpp,3145,invalid_index_type,"index type must be 'int' or 'uint', not ''",InferTypes::visit(ExprSafeAt*),primary,invalid | argument | type,invalid_index_type, +src/ast/ast_infer_type.cpp,3154,unsafe,safe-index of array<> must be inside the 'unsafe' block,InferTypes::visit(ExprSafeAt*),primary,unsafe | array,unsafe_array_safe_index, +src/ast/ast_infer_type.cpp,3162,cant_index,type dimensions are not resolved yet '',InferTypes::visit(ExprSafeAt*),follow_on,not_resolved_yet | type,not_resolved_yet_array_dimension, +src/ast/ast_infer_type.cpp,3179,invalid_index_type,"index type must be 'int', 'int64', 'uint', or 'uint64' and not ''",InferTypes::visit(ExprSafeAt*),primary,invalid | argument | type,invalid_index_type, +src/ast/ast_infer_type.cpp,3184,unsafe,safe-index of pointer must be inside the 'unsafe' block,InferTypes::visit(ExprSafeAt*),primary,unsafe | expression,unsafe_pointer_safe_index, +src/ast/ast_infer_type.cpp,3193,unsafe,safe-index of array<> must be inside the 'unsafe' block,InferTypes::visit(ExprSafeAt*),primary,unsafe | array,unsafe_array_safe_index, +src/ast/ast_infer_type.cpp,3197,invalid_index_type,"index type must be 'int' or 'uint', not ''",InferTypes::visit(ExprSafeAt*),primary,invalid | argument | type,invalid_index_type, +src/ast/ast_infer_type.cpp,3207,unsafe,safe-index of table<> must be inside the 'unsafe' block,InferTypes::visit(ExprSafeAt*),primary,unsafe | table,unsafe_table_safe_index, +src/ast/ast_infer_type.cpp,3212,invalid_index_type,"table safe-index type mismatch, '' vs ''",InferTypes::visit(ExprSafeAt*),primary,invalid | argument | type | table,invalid_table_safe_index_type, +src/ast/ast_infer_type.cpp,3217,invalid_index_type,can't safe-index into table<...; void>,InferTypes::visit(ExprSafeAt*),primary,cant | table | void,cant_safe_index_void_table, +src/ast/ast_infer_type.cpp,3226,unsafe,safe-index of fixed_array<> must be inside the 'unsafe' block,InferTypes::visit(ExprSafeAt*),primary,unsafe | array,unsafe_fixed_array_safe_index, +src/ast/ast_infer_type.cpp,3230,invalid_index_type,"index type must be 'int' or 'uint', not ''",InferTypes::visit(ExprSafeAt*),primary,invalid | argument | type,invalid_index_type, +src/ast/ast_infer_type.cpp,3236,cant_index,type dimensions are not resolved yet: '',InferTypes::visit(ExprSafeAt*),follow_on,not_resolved_yet | type,not_resolved_yet_array_dimension, +src/ast/ast_infer_type.cpp,3248,invalid_index_type,"index type must be 'int' or 'uint', not ''",InferTypes::visit(ExprSafeAt*),primary,invalid | argument | type,invalid_index_type, +src/ast/ast_infer_type.cpp,3257,cant_index,type can't be safe-indexed: '',InferTypes::visit(ExprSafeAt*),primary,cant | expression,cant_safe_index, +src/ast/ast_infer_type.cpp,3274,malformed_ast,"malformed AST, closure is missing return type",InferTypes::preVisit(ExprBlock*),internal,internal | block,internal_block_missing_return_type, +src/ast/ast_infer_type.cpp,3288,return_or_break_in_finally,"finally section can't have 'break', 'return', or 'goto'",InferTypes::preVisitBlockFinal,primary,invalid | block,invalid_block_finally, +src/ast/ast_infer_type.cpp,3298,variable_not_found,block argument '' is shadowed by function argument '',InferTypes::preVisitBlockArgument,recategorize,already_declared | block | argument,already_declared_block_argument,recategorize: variable_not_found - shadowing not lookup miss; should be already_declared_block_argument +src/ast/ast_infer_type.cpp,3308,variable_not_found,block argument '' is shadowed by another block argument '',InferTypes::preVisitBlockArgument,recategorize,already_declared | block | argument,already_declared_block_argument,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,3315,variable_not_found,block argument '' is shadowed by local variable '',InferTypes::preVisitBlockArgument,recategorize,already_declared | block | argument,already_declared_block_argument,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,3321,variable_not_found,block argument '' is shadowed by with expression,InferTypes::preVisitBlockArgument,recategorize,already_declared | block | argument,already_declared_block_argument,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,3331,type_not_found,undefined block argument type '',InferTypes::preVisitBlockArgument,primary,lookup | block | argument | type,lookup_block_argument_type, +src/ast/ast_infer_type.cpp,3336,cant_infer_missing_initializer,"block argument type can't be inferred, it needs an initializer",InferTypes::preVisitBlockArgument,primary,missing | block | argument,missing_block_argument_init, +src/ast/ast_infer_type.cpp,3345,invalid_type,block argument type can't be declared void,InferTypes::preVisitBlockArgument,primary,invalid | block | argument | type | void,invalid_block_argument_type_void, +src/ast/ast_infer_type.cpp,3352,invalid_type,block argument initialization with undefined expression,InferTypes::visitBlockArgumentInit,follow_on,not_resolved_yet | block | argument,not_resolved_yet_block_argument_init, +src/ast/ast_infer_type.cpp,3359,cant_infer_mismatching_restrictions,"block argument initialization type can't be inferred, = ",InferTypes::visitBlockArgumentInit,primary,invalid | block | argument | type,invalid_block_argument_init_type, +src/ast/ast_infer_type.cpp,3371,invalid_argument_type,block argument default value type mismatch '' vs '',InferTypes::visitBlockArgumentInit,primary,invalid | block | argument | type,invalid_block_argument_init_type, +src/ast/ast_infer_type.cpp,3375,invalid_argument_type,"block argument default value type mismatch '' vs '', reference matters",InferTypes::visitBlockArgumentInit,primary,invalid | block | argument | type | ref,invalid_block_argument_init_type_ref, +src/ast/ast_infer_type.cpp,3418,invalid_block,captured block can't 'break' outside of the block,InferTypes::visit(ExprBlock*),primary,invalid | block,invalid_block_break, +src/ast/ast_infer_type.cpp,3422,invalid_block,captured block can't 'continue' outside of the block,InferTypes::visit(ExprBlock*),primary,invalid | block,invalid_block_continue, +src/ast/ast_infer_type.cpp,3441,type_not_found,undefined block result type '',InferTypes::visit(ExprBlock*),primary,lookup | block | result | type,lookup_block_result_type, +src/ast/ast_infer_type.cpp,3462,invalid_swizzle_mask,unsupported swizzle type '',InferTypes::visit(ExprSwizzle*),primary,invalid | type,invalid_swizzle_type, +src/ast/ast_infer_type.cpp,3468,invalid_swizzle_mask,invalid swizzle mask ,InferTypes::visit(ExprSwizzle*),primary,invalid | expression,invalid_swizzle_mask, +src/ast/ast_infer_type.cpp,3515,invalid_type,as '' only allowed for variants,InferTypes::visit(ExprAsVariant*),recategorize,invalid | variant,invalid_as_non_variant,recategorize: invalid_type - actually wrong-construct; should be invalid_as_non_variant +src/ast/ast_infer_type.cpp,3521,cant_get_field,can't get variant field '',InferTypes::visit(ExprAsVariant*),primary,lookup | variant,lookup_variant_field, +src/ast/ast_infer_type.cpp,3565,unsafe,variant ?as on non-pointer requires unsafe,InferTypes::visit(ExprSafeAsVariant*),primary,unsafe | variant,unsafe_variant_safe_as, +src/ast/ast_infer_type.cpp,3570,invalid_type,?as only allowed for variants or pointers to variants and not ,InferTypes::visit(ExprSafeAsVariant*),recategorize,invalid | variant,invalid_safe_as_non_variant,recategorize: invalid_type - actually wrong-construct +src/ast/ast_infer_type.cpp,3579,cant_get_field,can't get variant field '',InferTypes::visit(ExprSafeAsVariant*),primary,lookup | variant,lookup_variant_field, +src/ast/ast_infer_type.cpp,3625,invalid_type,is only allowed for variants,InferTypes::visit(ExprIsVariant*),recategorize,invalid | variant,invalid_is_non_variant,recategorize: invalid_type - actually wrong-construct +src/ast/ast_infer_type.cpp,3631,cant_get_field,can't get variant field '',InferTypes::visit(ExprIsVariant*),primary,lookup | variant,lookup_variant_field, +src/ast/ast_infer_type.cpp,3660,cant_get_field,"ambiguous field lookup, '' is both an enum and a bitfield",InferTypes::visit(ExprField*),primary,ambiguous | field,ambiguous_field_lookup, +src/ast/ast_infer_type.cpp,3699,cant_get_field,bitfield constant '' of type is not initialized,InferTypes::visit(ExprField*),primary,missing | bitfield | constant,missing_bitfield_constant_init, +src/ast/ast_infer_type.cpp,3702,cant_get_field,not a valid bitfield constant of type ,InferTypes::visit(ExprField*),primary,invalid | bitfield | constant,invalid_bitfield_constant, +src/ast/ast_infer_type.cpp,3720,cant_get_field,bitfield constant '' of type is ambiguous,InferTypes::visit(ExprField*),mid_inference,ambiguous | bitfield | constant,ambiguous_bitfield_constant, +src/ast/ast_infer_type.cpp,3725,cant_get_field,bitfield '' not found in ,InferTypes::visit(ExprField*),primary,lookup | bitfield,lookup_bitfield, +src/ast/ast_infer_type.cpp,3743,cant_get_field,'' is ambiguous,InferTypes::visit(ExprField*),mid_inference,ambiguous | field,ambiguous_field, +src/ast/ast_infer_type.cpp,3746,cant_get_field,Don't know what '' is,InferTypes::visit(ExprField*),mid_inference,lookup | field,lookup_field,vague: clarify what 'X' means +src/ast/ast_infer_type.cpp,3755,cant_get_field,"syntax error, expecting field after '.'",InferTypes::visit(ExprField*),primary,invalid | field,invalid_field_syntax, +src/ast/ast_infer_type.cpp,3770,cant_get_field,can't get field '' of 'void' pointer,InferTypes::visit(ExprField*),primary,cant | field | void,cant_get_field_void_pointer, +src/ast/ast_infer_type.cpp,3792,cant_get_field,can't get tuple field '',InferTypes::visit(ExprField*),primary,lookup | tuple | field,lookup_tuple_field, +src/ast/ast_infer_type.cpp,3799,unsafe,'variant.field' must be inside the 'unsafe' block,InferTypes::visit(ExprField*),primary,unsafe | variant | field,unsafe_variant_field, +src/ast/ast_infer_type.cpp,3805,cant_get_field,can't get variant field '',InferTypes::visit(ExprField*),primary,lookup | variant | field,lookup_variant_field, +src/ast/ast_infer_type.cpp,3819,type_not_found,bitfield type can't be inferred,InferTypes::visit(ExprField*),follow_on,not_resolved_yet | bitfield | type,not_resolved_yet_bitfield_type, +src/ast/ast_infer_type.cpp,3825,cant_get_field,can't get bit field '' in ,InferTypes::visit(ExprField*),primary,lookup | bitfield,lookup_bitfield, +src/ast/ast_infer_type.cpp,3847,cant_get_field,can't get tuple field '',InferTypes::visit(ExprField*),primary,lookup | tuple | field,lookup_tuple_field, +src/ast/ast_infer_type.cpp,3854,unsafe,variant.field requires unsafe,InferTypes::visit(ExprField*),primary,unsafe | variant | field,unsafe_variant_field, +src/ast/ast_infer_type.cpp,3860,cant_get_field,can't get variant field '',InferTypes::visit(ExprField*),primary,lookup | variant | field,lookup_variant_field, +src/ast/ast_infer_type.cpp,3866,cant_get_field,can't get field '' of ,InferTypes::visit(ExprField*),primary,cant | field,cant_get_field, +src/ast/ast_infer_type.cpp,3878,type_not_found,undefined field type '',InferTypes::visit(ExprField*),primary,lookup | field | type,lookup_field_type, +src/ast/ast_infer_type.cpp,3898,cant_get_field,"can't get field '', invalid field type ''",InferTypes::visit(ExprField*),primary,invalid | field | type,invalid_field_type, +src/ast/ast_infer_type.cpp,3916,cant_get_field,field '' not found in ,InferTypes::visit(ExprField*),mid_inference,lookup | field,lookup_field, +src/ast/ast_infer_type.cpp,3920,cant_get_field,field '' not found in ,InferTypes::visit(ExprField*),primary,lookup | field,lookup_field, +src/ast/ast_infer_type.cpp,3950,cant_get_field,can only safe dereference a variant or a pointer to a tuple,InferTypes::visit(ExprSafeField*),mid_inference,invalid | expression | type,invalid_safe_dereference_type, +src/ast/ast_infer_type.cpp,3954,cant_get_field,can only safe dereference a variant or a pointer to a tuple,InferTypes::visit(ExprSafeField*),primary,invalid | expression | type,invalid_safe_dereference_type, +src/ast/ast_infer_type.cpp,3964,cant_get_field,can't get variant field '',InferTypes::visit(ExprSafeField*),primary,lookup | variant | field,lookup_variant_field, +src/ast/ast_infer_type.cpp,3974,cant_get_field,can't safe get field '',InferTypes::visit(ExprSafeField*),primary,cant | field,cant_safe_get_field, +src/ast/ast_infer_type.cpp,3978,type_not_found,undefined safe field type '',InferTypes::visit(ExprSafeField*),primary,lookup | field | type,lookup_safe_field_type, +src/ast/ast_infer_type.cpp,3987,cant_get_field,can't safe get field '',InferTypes::visit(ExprSafeField*),primary,cant | field,cant_safe_get_field, +src/ast/ast_infer_type.cpp,3994,cant_get_field,can't get tuple field '',InferTypes::visit(ExprSafeField*),primary,lookup | tuple | field,lookup_tuple_field, +src/ast/ast_infer_type.cpp,4001,cant_get_field,"can't safe get field '', invalid field type ''",InferTypes::visit(ExprSafeField*),primary,invalid | field | type,invalid_safe_field_type, +src/ast/ast_infer_type.cpp,4007,cant_get_field,can only safe dereference a pointer to a tuple,InferTypes::visit(ExprSafeField*),primary,invalid | expression | type,invalid_safe_dereference_type, +src/ast/ast_infer_type.cpp,4025,unbound_macro_tag,macro tags can only appear in macro blocks,InferTypes::preVisit(ExprTag*),primary,invalid | macro,invalid_macro_tag_outside, +src/ast/ast_infer_type.cpp,4126,variable_not_found,global variable '' cant't be initialized with itself,InferTypes::visit(ExprVar*),wording_fix,invalid | global,invalid_global_self_init,typo: cant't -> can't +src/ast/ast_infer_type.cpp,4146,variable_not_found,can't access private variable '',InferTypes::visit(ExprVar*),mid_inference,invalid | variable,invalid_variable_private, +src/ast/ast_infer_type.cpp,4149,variable_not_found,can't locate variable '',InferTypes::visit(ExprVar*),mid_inference,lookup | variable,lookup_variable, +src/ast/ast_infer_type.cpp,4153,variable_not_found,can't locate variable '',InferTypes::visit(ExprVar*),primary,lookup | variable,lookup_variable, +src/ast/ast_infer_type.cpp,4166,variable_not_found,too many matching variables '',InferTypes::visit(ExprVar*),mid_inference,ambiguous | variable,ambiguous_variable, +src/ast/ast_infer_type.cpp,4169,variable_not_found,too many matching variables '',InferTypes::visit(ExprVar*),primary,ambiguous | variable,ambiguous_variable, +src/ast/ast_infer_type.cpp,4212,invalid_return_semantics,: ,InferTypes::visit(ExprReturn*),primary,invalid | function | result,invalid_return_semantics, +src/ast/ast_infer_type.cpp,4220,invalid_return_type,returning reference requires unsafe,InferTypes::visit(ExprReturn*),recategorize,unsafe | function | result | ref,unsafe_return_reference,recategorize: invalid_return_type - actually unsafe; should be unsafe_return_reference +src/ast/ast_infer_type.cpp,4224,invalid_return_type,returning temporary value from block requires unsafe,InferTypes::visit(ExprReturn*),recategorize,unsafe | block | result,unsafe_return_temporary_block,recategorize: invalid_return_type - actually unsafe +src/ast/ast_infer_type.cpp,4228,unsafe,returning smart pointers without move semantics is unsafe,InferTypes::visit(ExprReturn*),primary,unsafe | function | result,unsafe_return_smart_pointer, +src/ast/ast_infer_type.cpp,4252,invalid_return_semantics,: ,InferTypes::visit(ExprReturn*),primary,invalid | function | result,invalid_return_semantics, +src/ast/ast_infer_type.cpp,4260,invalid_return_type,returning reference requires unsafe,InferTypes::visit(ExprReturn*),recategorize,unsafe | function | result | ref,unsafe_return_reference,recategorize: invalid_return_type - actually unsafe +src/ast/ast_infer_type.cpp,4264,invalid_return_type,returning temporary value from function requires unsafe,InferTypes::visit(ExprReturn*),recategorize,unsafe | function | result,unsafe_return_temporary_function,recategorize: invalid_return_type - actually unsafe +src/ast/ast_infer_type.cpp,4268,unsafe,returning smart pointers without move semantics is unsafe,InferTypes::visit(ExprReturn*),primary,unsafe | function | result,unsafe_return_smart_pointer, +src/ast/ast_infer_type.cpp,4285,invalid_yield,can't yield from inside the block,InferTypes::visit(ExprYield*),primary,invalid | generator | block,invalid_yield_in_block, +src/ast/ast_infer_type.cpp,4289,invalid_yield,can't yield from non-generator,InferTypes::visit(ExprYield*),primary,invalid | generator,invalid_yield_outside_generator, +src/ast/ast_infer_type.cpp,4307,invalid_loop,'break' without a loop,InferTypes::visit(ExprBreak*),primary,invalid | statement | loop,invalid_break_outside_loop, +src/ast/ast_infer_type.cpp,4313,invalid_loop,'continue' without a loop,InferTypes::visit(ExprContinue*),primary,invalid | statement | loop,invalid_continue_outside_loop, +src/ast/ast_infer_type.cpp,4354,condition_must_be_bool,"if-then-else condition must be boolean, and not ",InferTypes::visit(ExprIfThenElse*),primary,invalid | expression | type,invalid_if_condition_type, +src/ast/ast_infer_type.cpp,4372,condition_must_be_static,static_if must resolve to constant,InferTypes::visit(ExprIfThenElse*),primary,invalid | expression,invalid_static_if_condition, +src/ast/ast_infer_type.cpp,4392,invalid_yield,can't have final section in the if-then-else inside generator yet,InferTypes::visit(ExprIfThenElse*),primary,invalid | generator | block,invalid_finally_in_generator_if, +src/ast/ast_infer_type.cpp,4400,invalid_yield,can't have final section in the if-then-else inside generator yet,InferTypes::visit(ExprIfThenElse*),primary,invalid | generator | block,invalid_finally_in_generator_if, +src/ast/ast_infer_type.cpp,4420,invalid_assume,"can't assume , alias already taken by another assume expression",InferTypes::preVisit(ExprAssume*),primary,already_declared | type_alias,already_declared_assume_alias, +src/ast/ast_infer_type.cpp,4428,invalid_assume,"can't assume , alias already taken by local variable",InferTypes::preVisit(ExprAssume*),primary,already_declared | type_alias,already_declared_assume_alias, +src/ast/ast_infer_type.cpp,4435,invalid_assume,"can't assume , alias already taken by `with`",InferTypes::preVisit(ExprAssume*),primary,already_declared | type_alias,already_declared_assume_alias, +src/ast/ast_infer_type.cpp,4443,invalid_assume,"can't assume , alias already taken by block argument",InferTypes::preVisit(ExprAssume*),primary,already_declared | type_alias,already_declared_assume_alias, +src/ast/ast_infer_type.cpp,4453,invalid_assume,"can't assume , alias already taken by block argument",InferTypes::preVisit(ExprAssume*),primary,already_declared | type_alias,already_declared_assume_alias, +src/ast/ast_infer_type.cpp,4463,invalid_assume,"can't assume , alias already taken by global variable",InferTypes::preVisit(ExprAssume*),primary,already_declared | type_alias,already_declared_assume_alias, +src/ast/ast_infer_type.cpp,4466,invalid_assume,"can't assume , alias already taken by multiple global variables",InferTypes::preVisit(ExprAssume*),primary,already_declared | type_alias,already_declared_assume_alias, +src/ast/ast_infer_type.cpp,4481,invalid_assume,"can't assume , type or alias name is already used",InferTypes::preVisit(ExprAssume*),primary,already_declared | type_alias,already_declared_assume_alias, +src/ast/ast_infer_type.cpp,4486,invalid_assume,assume without subexpression must have type,InferTypes::preVisit(ExprAssume*),primary,missing | type,missing_assume_type, +src/ast/ast_infer_type.cpp,4551,invalid_assume,assume '' creates a circular dependency,InferTypes::visit(ExprAssume*),primary,recursion | type_alias,recursion_assume_alias, +src/ast/ast_infer_type.cpp,4569,invalid_with_type,"with array in undefined, ",InferTypes::visit(ExprWith*),primary,invalid | type | array,invalid_with_array_type, +src/ast/ast_infer_type.cpp,4576,invalid_with_type,unexpected with type ,InferTypes::visit(ExprWith*),primary,invalid | type,invalid_with_type, +src/ast/ast_infer_type.cpp,4583,variable_not_found,with expression shadows local variable ,InferTypes::visit(ExprWith*),recategorize,already_declared | local,already_declared_with_shadow,recategorize: variable_not_found - shadowing not lookup miss +src/ast/ast_infer_type.cpp,4606,invalid_loop,while loop condition must be boolean,InferTypes::visit(ExprWhile*),primary,invalid | expression | type | loop,invalid_while_condition_type, +src/ast/ast_infer_type.cpp,4640,invalid_loop,for loop needs at least one iterator,InferTypes::preVisitForStack,primary,missing | local | loop,missing_for_iterator, +src/ast/ast_infer_type.cpp,4644,invalid_loop,for loop needs as many iterators as there are sources,InferTypes::preVisitForStack,primary,invalid | local | loop,invalid_for_iterator_count, +src/ast/ast_infer_type.cpp,4669,invalid_iteration_source,can't iterate over const iterator,InferTypes::preVisitForStack,primary,cant | expression | loop,cant_iterate_const_iterator, +src/ast/ast_infer_type.cpp,4687,invalid_iteration_source,unsupported iteration type ,InferTypes::preVisitForStack,primary,invalid | expression | type | loop,invalid_iteration_source_type, +src/ast/ast_infer_type.cpp,4697,variable_not_found,"can't make loop variable ``, name already taken by alias",InferTypes::preVisitForStack,recategorize,already_declared | local | loop,already_declared_loop_variable,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,4705,variable_not_found,for loop iterator variable is shadowed by function argument ,InferTypes::preVisitForStack,recategorize,already_declared | local | loop,already_declared_loop_variable,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,4713,variable_not_found,for loop iterator variable is shadowed by block argument ,InferTypes::preVisitForStack,recategorize,already_declared | local | loop,already_declared_loop_variable,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,4720,variable_not_found,for loop iterator variable is shadowed by another local variable ,InferTypes::preVisitForStack,recategorize,already_declared | local | loop,already_declared_loop_variable,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,4726,variable_not_found,for loop iterator variable is shadowed by with expression,InferTypes::preVisitForStack,recategorize,already_declared | local | loop,already_declared_loop_variable,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,4734,invalid_iteration_source,for loop iterator variable is not a tuple,InferTypes::preVisitForStack,primary,invalid | local | type | loop,invalid_for_iterator_tuple, +src/ast/ast_infer_type.cpp,4862,type_not_found,undefined let type ,InferTypes::preVisitLet,primary,lookup | local | type,lookup_local_type, +src/ast/ast_infer_type.cpp,4867,cant_infer_missing_initializer,"local variable type can't be inferred, it needs an initializer",InferTypes::preVisitLet,primary,missing | local,missing_local_init, +src/ast/ast_infer_type.cpp,4872,variable_not_found,"can't make local variable ``, name already taken by alias",InferTypes::preVisitLet,recategorize,already_declared | local,already_declared_local_variable,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,4880,variable_not_found,local variable is shadowed by function argument ,InferTypes::preVisitLet,recategorize,already_declared | local,already_declared_local_variable,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,4888,variable_not_found,local variable is shadowed by block argument ,InferTypes::preVisitLet,recategorize,already_declared | local,already_declared_local_variable,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,4895,variable_not_found,local variable is shadowed by another local variable ,InferTypes::preVisitLet,recategorize,already_declared | local,already_declared_local_variable,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,4901,variable_not_found,local variable is shadowed by with expression,InferTypes::preVisitLet,recategorize,already_declared | local,already_declared_local_variable,recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp,4917,invalid_variable_type,local reference has to be initialized,InferTypes::preVisitLet,primary,missing | local | ref,missing_local_reference_init, +src/ast/ast_infer_type.cpp,4921,unsafe,local reference to non-local expression is unsafe,InferTypes::preVisitLet,primary,unsafe | local | ref,unsafe_local_reference, +src/ast/ast_infer_type.cpp,4926,invalid_variable_type,local variable can't be declared void,InferTypes::preVisitLet,primary,invalid | local | type | void,invalid_local_type_void, +src/ast/ast_infer_type.cpp,4931,invalid_variable_type,local block variable needs to be initialized,InferTypes::preVisitLet,primary,missing | local | block,missing_local_block_init, +src/ast/ast_infer_type.cpp,4935,invalid_variable_type,local variable of type requires unsafe,InferTypes::preVisitLet,recategorize,unsafe | local | type,unsafe_local_type,recategorize: invalid_variable_type - actually unsafe +src/ast/ast_infer_type.cpp,4940,unsafe,local class requires unsafe ,InferTypes::preVisitLet,primary,unsafe | local | class,unsafe_local_class, +src/ast/ast_infer_type.cpp,4946,invalid_variable_type,local variable of type needs to be initialized,InferTypes::preVisitLet,primary,missing | local,missing_local_init, +src/ast/ast_infer_type.cpp,4971,invalid_variable_type,in-scope variable can't be declared in the finally block,InferTypes::visitLet,primary,invalid | local | block,invalid_local_in_scope_finally, +src/ast/ast_infer_type.cpp,4977,invalid_variable_type,variable of type can't be in-scope const,InferTypes::visitLet,primary,invalid | local | type,invalid_local_in_scope_const, +src/ast/ast_infer_type.cpp,4993,invalid_generator_finalizer,internal error. generator function has finalize function which is not a block,InferTypes::visitLet,internal,internal | generator,internal_generator_finalizer, +src/ast/ast_infer_type.cpp,4998,invalid_generator_finalizer,internal error. generator function has multiple finalize functions,InferTypes::visitLet,internal,internal | generator,internal_generator_finalizer_multiple, +src/ast/ast_infer_type.cpp,5004,invalid_variable_type,internal error. in-scope variable in lambda gets converted as part of the lambda function,InferTypes::visitLet,internal,internal | lambda,internal_lambda_in_scope_conversion, +src/ast/ast_infer_type.cpp,5012,bad_delete,can't delete ,InferTypes::visitLet,primary,cant | local,cant_delete_local, +src/ast/ast_infer_type.cpp,5018,invalid_variable_type,variable of type requires var inscope to be safe,InferTypes::visitLet,recategorize,unsafe | local,unsafe_local_in_scope_required,recategorize: invalid_variable_type - actually unsafe +src/ast/ast_infer_type.cpp,5024,unsafe,Uninitialized variable is unsafe,InferTypes::visitLet,wording_fix,unsafe | local,unsafe_local,inconsistent: uses [safe_when_uninitialized]; lines 295/370 use @safe_when_uninitialized +src/ast/ast_infer_type.cpp,5062,cant_infer_mismatching_restrictions,"local variable initialization type can't be inferred, = ",InferTypes::visitLetInit,primary,invalid | local | type,invalid_local_init_type, +src/ast/ast_infer_type.cpp,5065,cant_infer_mismatching_restrictions,"local variable initialization can't be void, ",InferTypes::visitLetInit,primary,invalid | local | type | void,invalid_local_init_type_void, +src/ast/ast_infer_type.cpp,5082,invalid_initialization_type,local variable initialization type mismatch. reference can't be initialized via value,InferTypes::visitLetInit,primary,invalid | local | type | ref,invalid_local_init_type_ref, +src/ast/ast_infer_type.cpp,5085,invalid_initialization_type,local variable initialization type mismatch. const matters,InferTypes::visitLetInit,primary,invalid | local | type,invalid_local_init_type, +src/ast/ast_infer_type.cpp,5089,invalid_initialization_type,local variable can only be initialized with make block expression,InferTypes::visitLetInit,primary,invalid | local | block,invalid_local_init_block, +src/ast/ast_infer_type.cpp,5093,invalid_initialization_type,local variable can only be initialized with type constructor,InferTypes::visitLetInit,primary,invalid | local | type,invalid_local_init_constructor, +src/ast/ast_infer_type.cpp,5096,invalid_initialization_type,local variable can only be initialized with copy,InferTypes::visitLetInit,primary,invalid | local | type,invalid_local_init_copy, +src/ast/ast_infer_type.cpp,5099,invalid_initialization_type,local variable can't be initialized at all,InferTypes::visitLetInit,primary,invalid | local | type,invalid_local_init, +src/ast/ast_infer_type.cpp,5102,invalid_initialization_type,local variable can only be move-initialized,InferTypes::visitLetInit,primary,invalid | local | type,invalid_local_init_move, +src/ast/ast_infer_type.cpp,5109,cant_move,local variable can't init (move) from a constant value,InferTypes::visitLetInit,primary,cant | local,cant_move_local, +src/ast/ast_infer_type.cpp,5143,,type not ready yet,InferTypes::visit(ExprLet*),follow_on,not_resolved_yet | local | type,not_resolved_yet_local_type,current cerr unspecified - should be not_resolved_yet_local_type; vague: clarify which type isn't ready +src/ast/ast_infer_type.cpp,5173,invalid_type,expansion of should be tuple,InferTypes::visit(ExprLet*),primary,invalid | local | type | tuple,invalid_local_tuple_expansion, +src/ast/ast_infer_type.cpp,5195,unsupported_call_macro,call macro '' failed to compile,InferTypes::visit(ExprCallMacro*),primary,runtime | macro,runtime_call_macro, +src/ast/ast_infer_type.cpp,5202,too_many_infer_passes,call expression depth exceeded maximum allowed (),InferTypes::canVisitLooksLikeCall,recategorize,exceeds | function,exceeds_call_depth,recategorize: too_many_infer_passes - actually call depth not infer passes +src/ast/ast_infer_type.cpp,5213,too_many_arguments,"too many arguments in , max allowed",InferTypes::preVisit(ExprLooksLikeCall*),primary,exceeds | function | argument,exceeds_function_argument, +src/ast/ast_infer_type.cpp,5231,too_many_infer_passes,call expression depth exceeded maximum allowed (),InferTypes::canVisitNamedCall,recategorize,exceeds | function,exceeds_call_depth,recategorize: too_many_infer_passes - actually call depth +src/ast/ast_infer_type.cpp,5242,too_many_arguments,"too many arguments in , max allowed",InferTypes::preVisit(ExprNamedCall*),primary,exceeds | function | argument,exceeds_function_argument, +src/ast/ast_infer_type.cpp,5264,invalid_argument_type,can't infer type of non-named argument in call to ,InferTypes::visit(ExprNamedCall*),follow_on,not_resolved_yet | argument | type,not_resolved_yet_argument_type, +src/ast/ast_infer_type.cpp,5353,,recursive call to in argument initializer is not allowed,InferTypes::visit(ExprNamedCall*),primary,recursion | function | argument,recursion_function_argument,current cerr unspecified - should be recursion_function_argument +src/ast/ast_infer_type.cpp,5363,too_many_infer_passes,call expression depth exceeded maximum allowed (),InferTypes::canVisitCall,recategorize,exceeds | function,exceeds_call_depth,recategorize: too_many_infer_passes - actually call depth +src/ast/ast_infer_type.cpp,5374,too_many_arguments,"too many arguments in , max allowed",InferTypes::preVisit(ExprCall*),primary,exceeds | function | argument,exceeds_function_argument, +src/ast/ast_infer_type.cpp,5378,result_discarded,"call to result is discarded, which is unsafe",InferTypes::preVisit(ExprCall*),primary,invalid | function | result,invalid_function_result_discarded, +src/ast/ast_infer_type.cpp,5434,function_not_found,too many candidates for super constructor ,InferTypes::visit(ExprCall*),mid_inference,ambiguous | function,ambiguous_super_constructor, +src/ast/ast_infer_type.cpp,5441,function_not_found,call to super in : no matching super constructor,InferTypes::visit(ExprCall*),primary,lookup | function,lookup_super_constructor, +src/ast/ast_infer_type.cpp,5445,function_not_found,call to super in is not allowed,InferTypes::visit(ExprCall*),primary,invalid | function,invalid_super_call_no_base, +src/ast/ast_infer_type.cpp,5467,invalid_cast,casting to bitfield requires one argument,InferTypes::visit(ExprCall*),primary,invalid | argument,invalid_bitfield_cast_argument_count, +src/ast/ast_infer_type.cpp,5602,unsafe,unsafe call '' must be inside the 'unsafe' block,InferTypes::visit(ExprCall*),primary,unsafe | function,unsafe_function_call, +src/ast/ast_infer_type.cpp,5605,unsafe,'' is unsafe when not source of for-loop,InferTypes::visit(ExprCall*),primary,unsafe | function,unsafe_function_call_outside_for, +src/ast/ast_infer_type.cpp,5608,unsafe,'' is unsafe when not clone array,InferTypes::visit(ExprCall*),primary,unsafe | function,unsafe_function_call_outside_clone, +src/ast/ast_infer_type.cpp,5640,annotation_failed,call annotated by '' failed to transform,InferTypes::visit(ExprCall*),primary,runtime | annotation,runtime_annotation_transform, +src/ast/ast_infer_type.cpp,5652,unsafe,Constructing class on stack is unsafe,InferTypes::visit(ExprCall*),primary,unsafe | class,unsafe_class_stack_construction, +src/ast/ast_infer_type.cpp,5663,expecting_return_value,argument of format string should not be `void`,InferTypes::visitStringBuilderElement,recategorize,invalid | argument | type | void,invalid_string_builder_argument_void,recategorize: expecting_return_value - misnamed; actual fault is void argument +src/ast/ast_infer_type.cpp,5666,invalid_type,argument of format string can't be `auto` or alias,InferTypes::visitStringBuilderElement,primary,invalid | argument | type | auto,invalid_string_builder_argument_auto, +src/ast/ast_infer_type.cpp,5702,unspecified,macro '::' failed,Program::inferTypes,primary,runtime | macro,runtime_macro,current cerr unspecified - should be runtime_macro +src/ast/ast_infer_type.cpp,5710,unspecified,macro '::' failed to infer,Program::inferTypes,primary,runtime | macro,runtime_macro_infer,current cerr unspecified - should be runtime_macro_infer +src/ast/ast_infer_type.cpp,5732,unspecified,internal compiler error: variable relocation infer to fail,Program::inferTypes,internal,internal | function,internal_relocate_infer,current cerr unspecified - should be internal_relocate_infer +src/ast/ast_infer_type.cpp,5743,unspecified,internal compiler error: pod analysis infer to fail,Program::inferTypes,internal,internal | function,internal_pod_analysis_infer,current cerr unspecified - should be internal_pod_analysis_infer +src/ast/ast_infer_type.cpp,5755,too_many_infer_passes,type inference exceeded maximum allowed number of passes (),Program::inferTypes,primary,exceeds | function,exceeds_infer_passes, +src/ast/ast_infer_type.cpp,5791,unspecified,internal compiler error: failed to refresh '',Program::inferTypesDirty,internal,internal | function,internal_function_refresh,current cerr unspecified - should be internal_function_refresh +src/ast/ast_infer_type.cpp,5822,too_many_infer_passes,type inference exceeded maximum allowed number of passes (),Program::inferTypesDirty,primary,exceeds | function,exceeds_infer_passes, +src/ast/ast_infer_type_function.cpp,607,function_not_found,both generated and custom '' functions exist for ,InferTypes::verifyAnyFunc,primary,ambiguous | function | mix,ambiguous_function_mix, +src/ast/ast_infer_type_function.cpp,610,function_not_found,both generated and custom '' functions exist,InferTypes::verifyAnyFunc,primary,ambiguous | function | mix,ambiguous_function_mix, +src/ast/ast_infer_type_function.cpp,617,function_not_found,too many custom '' functions exist for ,InferTypes::verifyAnyFunc,primary,ambiguous | function,ambiguous_function, +src/ast/ast_infer_type_function.cpp,620,function_not_found,too many custom '' functions exist,InferTypes::verifyAnyFunc,primary,ambiguous | function,ambiguous_function, +src/ast/ast_infer_type_function.cpp,1064,,void type is not allowed as argument,InferTypes::inferArguments,recategorize,invalid | argument | type | void,invalid_argument_type_void,missing cerr; assign invalid_argument_type +src/ast/ast_infer_type_function.cpp,1088,too_many_infer_passes,infer expression depth exceeded maximum allowed,InferTypes::inferFunctionCall,primary,exceeds | expression | recursion,exceeds_expression_recursion, +src/ast/ast_infer_type_function.cpp,1109,,recursive call in argument initializer is not allowed,InferTypes::inferFunctionCall,recategorize,recursion | argument,recursion_argument,missing cerr; assign recursion-related code +src/ast/ast_infer_type_function.cpp,1114,invalid_type,cannot infer type for function call '' with 'auto' return type,InferTypes::inferFunctionCall,primary,invalid | function | result | auto,invalid_function_result_auto, +src/ast/ast_infer_type_function.cpp,1119,,recursive call in function is not allowed,InferTypes::inferFunctionCall,recategorize,recursion | function,recursion_function,missing cerr; assign recursion-related code +src/ast/ast_infer_type_function.cpp,1138,invalid_type,default arguments don't match the function signature of '',InferTypes::inferFunctionCall,primary,invalid | function | argument | mismatching,mismatching_function_argument, +src/ast/ast_infer_type_function.cpp,1153,,internal compiler error: array type not under default> or default<,InferTypes::inferFunctionCall,internal,internal | type | array,internal_array_type,missing cerr; internal invariant +src/ast/ast_infer_type_function.cpp,1162,,internal compiler error: unknown array type not under make strcut,InferTypes::inferFunctionCall,internal,internal | type | array,internal_array_type,typo: strcut -> struct; missing cerr; internal invariant +src/ast/ast_infer_type_function.cpp,1212,,internal compiler error: multiple instances of '',InferTypes::inferFunctionCall,internal,internal | function | ambiguous,internal_function_ambiguous,missing cerr; internal invariant +src/ast/ast_infer_type_function.cpp,1303,invalid_type,unknown type of argument ; can't instance ,InferTypes::inferFunctionCall,primary,lookup | argument | type,lookup_argument_type, +src/ast/ast_infer_type_function.cpp,1350,function_already_declared,can't instance generic ,InferTypes::inferFunctionCall,primary,already_declared | function,already_declared_function, +src/ast/ast_infer_type_function.cpp,1362,invalid_annotation,Macro [] failed to generic_apply to a function ,InferTypes::inferFunctionCall,primary,invalid | annotation | macro,invalid_annotation_macro, +src/ast/ast_infer_type_function.cpp,1391,function_not_found,can't access private structure ,InferTypes::inferFunctionCall,recategorize,cant | structure | private,cant_access_private_structure,recategorize from function_not_found to invalid_private/cant_access_private +src/ast/ast_infer_type_function.cpp,1395,function_not_found,default constructor is not visible directly,InferTypes::inferFunctionCall,primary,lookup | function | constant,lookup_function, +src/ast/ast_infer_type_function.cpp,1400,invalid_argument_count,can only generate default structure constructor without arguments,InferTypes::inferFunctionCall,primary,invalid | function | argument,invalid_function_argument_count, +src/ast/ast_infer_type_helper.cpp,89,invalid_array_dimension,array dimension can't be 0 or less: '',InferTypes::verifyType,primary,invalid | array | exceeds,invalid_array_dimension, +src/ast/ast_infer_type_helper.cpp,94,invalid_array_dimension,array is too big: '',InferTypes::verifyType,primary,exceeds | array,exceeds_array, +src/ast/ast_infer_type_helper.cpp,106,invalid_type,malformed type: '',InferTypes::verifyType,primary,invalid | type,invalid_type, +src/ast/ast_infer_type_helper.cpp,112,invalid_type,can't declare an array of void: '',InferTypes::verifyType,primary,invalid | array | void,invalid_array_void, +src/ast/ast_infer_type_helper.cpp,116,invalid_type,can't declare a void reference: '',InferTypes::verifyType,primary,invalid | type | ref | void,invalid_type_ref_void, +src/ast/ast_infer_type_helper.cpp,122,invalid_type,can't declare a pointer to a reference: '',InferTypes::verifyType,primary,invalid | type | ref,invalid_type_ref, +src/ast/ast_infer_type_helper.cpp,127,invalid_type,can't declare a smart pointer to anything other than annotation: '',InferTypes::verifyType,primary,invalid | type,invalid_type, +src/ast/ast_infer_type_helper.cpp,130,invalid_type,this annotation does not support smart pointers: '',InferTypes::verifyType,primary,invalid | annotation | type,invalid_annotation_type, +src/ast/ast_infer_type_helper.cpp,137,invalid_type,can't declare a void smart pointer,InferTypes::verifyType,primary,invalid | type | void,invalid_type_void, +src/ast/ast_infer_type_helper.cpp,148,invalid_array_type,array type is not fully resolved: '',InferTypes::verifyType,follow_on,not_resolved_yet | array | type,not_resolved_yet_array_type, +src/ast/ast_infer_type_helper.cpp,152,invalid_array_type,can't declare an array of references: '',InferTypes::verifyType,primary,invalid | array | ref,invalid_array_ref, +src/ast/ast_infer_type_helper.cpp,156,invalid_array_type,can't declare a void array: '',InferTypes::verifyType,primary,invalid | array | void,invalid_array_void, +src/ast/ast_infer_type_helper.cpp,160,invalid_type,can't have array of non-trivial type: '',InferTypes::verifyType,primary,invalid | array | type,invalid_array_type, +src/ast/ast_infer_type_helper.cpp,168,invalid_array_type,table key is not fully resolved: '',InferTypes::verifyType,follow_on,not_resolved_yet | table | type,not_resolved_yet_table_type,recategorize: cerr is invalid_array_type but it's a table key +src/ast/ast_infer_type_helper.cpp,172,invalid_table_type,table key can't be declared as a reference: '',InferTypes::verifyType,primary,invalid | table | ref,invalid_table_ref, +src/ast/ast_infer_type_helper.cpp,176,invalid_table_type,table key has to be declare as a basic 'hashable' type: '',InferTypes::verifyType,primary,invalid | table | type,invalid_table_type,typo: declare -> declared +src/ast/ast_infer_type_helper.cpp,183,invalid_array_type,table value is not fully resolved: '',InferTypes::verifyType,follow_on,not_resolved_yet | table | type,not_resolved_yet_table_type,recategorize: cerr is invalid_array_type but it's a table value +src/ast/ast_infer_type_helper.cpp,187,invalid_table_type,table value can't be declared as a reference: '',InferTypes::verifyType,primary,invalid | table | ref,invalid_table_ref, +src/ast/ast_infer_type_helper.cpp,191,invalid_type,can't have table value of non-trivial type: '',InferTypes::verifyType,primary,invalid | table | type,invalid_table_type, +src/ast/ast_infer_type_helper.cpp,199,invalid_return_type,not a valid return type: '',InferTypes::verifyType,primary,invalid | result | type,invalid_result_type, +src/ast/ast_infer_type_helper.cpp,206,invalid_argument_type,can't pass a boxed type by a reference: '',InferTypes::verifyType,primary,invalid | argument | type | ref,invalid_argument_type_ref, +src/ast/ast_infer_type_helper.cpp,214,invalid_type,tuple element can't be a reference: '',InferTypes::verifyType,primary,invalid | tuple | ref,invalid_tuple_ref, +src/ast/ast_infer_type_helper.cpp,218,invalid_type,tuple element can't be void,InferTypes::verifyType,primary,invalid | tuple | void,invalid_tuple_void, +src/ast/ast_infer_type_helper.cpp,222,invalid_type,invalid tuple element type: '',InferTypes::verifyType,primary,invalid | tuple | type,invalid_tuple_type, +src/ast/ast_infer_type_helper.cpp,230,invalid_type,variant element can't be a reference: '',InferTypes::verifyType,primary,invalid | variant | ref,invalid_variant_ref, +src/ast/ast_infer_type_helper.cpp,234,invalid_type,variant element can't be void,InferTypes::verifyType,primary,invalid | variant | void,invalid_variant_void, +src/ast/ast_infer_type_helper.cpp,238,invalid_type,invalid variant element type: '',InferTypes::verifyType,primary,invalid | variant | type,invalid_variant_type, +src/ast/ast_infer_type_helper.cpp,649,invalid_array_dimension,array dimension can't be 0 or less,InferTypes::inferTypeExpr,primary,invalid | array | exceeds,invalid_array_dimension, +src/ast/ast_infer_type_helper.cpp,653,invalid_array_dimension,array dimension must be int32 or uint32,InferTypes::inferTypeExpr,primary,invalid | array | type,invalid_array_dimension_type, +src/ast/ast_infer_type_helper.cpp,657,invalid_array_dimension,array dimension must be constant,InferTypes::inferTypeExpr,primary,invalid | array | constant,invalid_array_dimension_constant, +src/ast/ast_infer_type_helper.cpp,661,invalid_array_dimension,can't deduce array dimension,InferTypes::inferTypeExpr,primary,invalid | array,invalid_array_dimension, +src/ast/ast_infer_type_helper.cpp,668,invalid_type,typeDecl must have exactly one dimension,InferTypes::inferTypeExpr,primary,invalid | type,invalid_type_dimension, +src/ast/ast_infer_type_helper.cpp,678,invalid_type,can't deduce typeDecl type,InferTypes::inferTypeExpr,follow_on,not_resolved_yet | type,not_resolved_yet_type, +src/ast/ast_infer_type_helper.cpp,682,invalid_type,can't deduce type,InferTypes::inferTypeExpr,follow_on,not_resolved_yet | type,not_resolved_yet_type, +src/ast/ast_infer_type_helper.cpp,689,invalid_type,can't find typeMacro ,InferTypes::inferTypeExpr,primary,lookup | macro,lookup_macro, +src/ast/ast_infer_type_helper.cpp,692,invalid_type,too many typeMacro found,InferTypes::inferTypeExpr,primary,ambiguous | macro,ambiguous_macro, +src/ast/ast_infer_type_helper.cpp,697,invalid_type,can't deduce typeMacro ,InferTypes::inferTypeExpr,primary,invalid | macro | type,invalid_macro_type, +src/ast/ast_infer_type_helper.cpp,770,invalid_cast,"incompatible cast, can't cast to ",InferTypes::castStruct,primary,invalid | structure | type,invalid_cast_structure, +src/ast/ast_infer_type_helper.cpp,774,invalid_cast,"invalid cast, expecting structure",InferTypes::castStruct,primary,invalid | structure,invalid_cast_structure, +src/ast/ast_infer_type_helper.cpp,791,invalid_cast,"incompatible cast, can't cast '?' to '?'",InferTypes::castStruct,primary,invalid | structure | type,invalid_cast_structure_pointer, +src/ast/ast_infer_type_helper.cpp,795,invalid_cast,"invalid cast, expecting structure pointer",InferTypes::castStruct,primary,invalid | structure | type,invalid_cast_structure_pointer, +src/ast/ast_infer_type_helper.cpp,805,invalid_cast,"invalid cast, number of arguments does not match",InferTypes::castFunc,primary,invalid | function | argument | mismatching,mismatching_function_argument_count, +src/ast/ast_infer_type_helper.cpp,842,invalid_cast,"incompatible cast, can't cast to ",InferTypes::castFunc,primary,invalid | function | type,invalid_cast_function, +src/ast/ast_infer_type_helper.cpp,872,invalid_return_type,this type can't be returned at all: '',InferTypes::setBlockCopyMoveFlags,primary,invalid | result | type,invalid_result_type, +src/ast/ast_infer_type_helper.cpp,892,cant_get_field,can't access private field '' of outside of member functions.,InferTypes::verifyPrivateFieldLookup,recategorize,cant | field | private,cant_access_private_field,recategorize from cant_get_field to invalid_private/cant_access_private +src/ast/ast_infer_type_helper.cpp,959,invalid_return_type,returning void value,InferTypes::inferReturnType,primary,invalid | result | void,invalid_result_void, +src/ast/ast_infer_type_helper.cpp,966,,subexpresion type is not resolved yet,InferTypes::inferReturnType,follow_on,not_resolved_yet | expression | type,not_resolved_yet_expression_type,typo: subexpresion -> subexpression; missing cerr +src/ast/ast_infer_type_helper.cpp,969,,subexpresion type is not fully resolved yet,InferTypes::inferReturnType,follow_on,not_resolved_yet | expression | type,not_resolved_yet_expression_type,typo: subexpresion -> subexpression; missing cerr +src/ast/ast_infer_type_helper.cpp,974,cant_infer_mismatching_restrictions,"type can't be inferred, , returns ",InferTypes::inferReturnType,primary,invalid | result | type | mismatching,mismatching_result_type, +src/ast/ast_infer_type_helper.cpp,995,not_expecting_return_value,not expecting a return value,InferTypes::inferReturnType,primary,invalid | result | void,not_expecting_result_value, +src/ast/ast_infer_type_helper.cpp,1000,expecting_return_value,expecting a return value,InferTypes::inferReturnType,primary,missing | result,missing_result_value, +src/ast/ast_infer_type_helper.cpp,1007,invalid_return_type,"incompatible return type, reference matters. expecting , passing ",InferTypes::inferReturnType,primary,invalid | result | type | ref,invalid_result_type_ref, +src/ast/ast_infer_type_helper.cpp,1011,invalid_return_type,"incompatible return type, constant matters. expecting , passing ",InferTypes::inferReturnType,primary,invalid | result | type,invalid_result_type_constant, +src/ast/ast_infer_type_helper.cpp,1018,invalid_return_type,this type can't be returned at all ,InferTypes::inferReturnType,primary,invalid | result | type,invalid_result_type, +src/ast/ast_infer_type_helper.cpp,1023,cant_move,can't return via move from a constant value,InferTypes::inferReturnType,primary,cant | result,cant_move_result, +src/ast/ast_infer_type_make.cpp,32,type_not_found,undefined generator type ,InferTypes::visit(ExprMakeGenerator),primary,lookup | generator | type,lookup_generator_type, +src/ast/ast_infer_type_make.cpp,38,type_not_found,generator of undefined type ,InferTypes::visit(ExprMakeGenerator),primary,lookup | generator | type,lookup_generator_type, +src/ast/ast_infer_type_make.cpp,42,type_not_found,generator can't be void (yet),InferTypes::visit(ExprMakeGenerator),recategorize,invalid | generator | void,invalid_generator_void,recategorize: not a lookup miss; cerr should be invalid_type +src/ast/ast_infer_type_make.cpp,47,invalid_argument_count,generator can only have one argument,InferTypes::visit(ExprMakeGenerator),primary,invalid | generator | argument,invalid_generator_argument_count, +src/ast/ast_infer_type_make.cpp,50,invalid_argument_type,"expecting generator(closure), got instead",InferTypes::visit(ExprMakeGenerator),primary,invalid | generator | argument | type,invalid_generator_argument_type, +src/ast/ast_infer_type_make.cpp,57,invalid_block,can't infer generator block type,InferTypes::visit(ExprMakeGenerator),follow_on,not_resolved_yet | generator | block,not_resolved_yet_generator_block, +src/ast/ast_infer_type_make.cpp,60,invalid_argument_type,generator must return boolean,InferTypes::visit(ExprMakeGenerator),primary,invalid | generator | result | type,invalid_generator_result_type, +src/ast/ast_infer_type_make.cpp,63,invalid_argument_type,generator must have no arguments,InferTypes::visit(ExprMakeGenerator),primary,invalid | generator | argument,invalid_generator_argument_count, +src/ast/ast_infer_type_make.cpp,136,invalid_block,generator finalizer name mismatch,InferTypes::visit(ExprMakeGenerator),internal,internal | generator | name,internal_generator_finalizer_name, +src/ast/ast_infer_type_make.cpp,140,invalid_block,generator function name mismatch,InferTypes::visit(ExprMakeGenerator),internal,internal | generator | name,internal_generator_function_name, +src/ast/ast_infer_type_make.cpp,144,invalid_block,generator struct name mismatch ,InferTypes::visit(ExprMakeGenerator),internal,internal | generator | name,internal_generator_structure_name, +src/ast/ast_infer_type_make.cpp,169,invalid_capture,can't captured variable ,InferTypes::verifyCapture,wording_fix,invalid | lambda | variable,invalid_capture_variable,typo: captured -> capture +src/ast/ast_infer_type_make.cpp,173,invalid_capture,"implicit capture by move requires unsafe, while capturing ",InferTypes::verifyCapture,primary,unsafe | lambda | variable,unsafe_capture_variable_move, +src/ast/ast_infer_type_make.cpp,177,invalid_capture,can't implicitly capture constant variable by move,InferTypes::verifyCapture,primary,cant | lambda | variable,cant_capture_constant_variable, +src/ast/ast_infer_type_make.cpp,183,invalid_capture,"capture by reference requires unsafe, while capturing ",InferTypes::verifyCapture,primary,unsafe | lambda | variable,unsafe_capture_variable_ref, +src/ast/ast_infer_type_make.cpp,189,invalid_capture,can't move captured variable ,InferTypes::verifyCapture,primary,cant | lambda | variable,cant_capture_variable_move, +src/ast/ast_infer_type_make.cpp,193,invalid_capture,can't capture constant variable by move,InferTypes::verifyCapture,primary,cant | lambda | variable,cant_capture_constant_variable, +src/ast/ast_infer_type_make.cpp,199,invalid_capture,can't copy captured variable ,InferTypes::verifyCapture,primary,cant | lambda | variable,cant_capture_variable_copy, +src/ast/ast_infer_type_make.cpp,205,invalid_capture,can't capture variable ,InferTypes::verifyCapture,primary,cant | lambda | variable,cant_capture_variable, +src/ast/ast_infer_type_make.cpp,217,invalid_block,can't infer lambda block type,InferTypes::convertBlockToLambda,follow_on,not_resolved_yet | lambda | block,not_resolved_yet_lambda_block, +src/ast/ast_infer_type_make.cpp,260,invalid_block,lambda finalizer name mismatch,InferTypes::convertBlockToLambda,internal,internal | lambda | name,internal_lambda_finalizer_name, +src/ast/ast_infer_type_make.cpp,264,invalid_block,lambda function name mismatch,InferTypes::convertBlockToLambda,internal,internal | lambda | name,internal_lambda_function_name, +src/ast/ast_infer_type_make.cpp,268,invalid_block,lambda struct name mismatch,InferTypes::convertBlockToLambda,internal,internal | lambda | name,internal_lambda_structure_name, +src/ast/ast_infer_type_make.cpp,281,invalid_block,can't infer local function block type,InferTypes::convertBlockToLocalFunction,follow_on,not_resolved_yet | function | block,not_resolved_yet_function_block, +src/ast/ast_infer_type_make.cpp,295,invalid_block,local function name mismatch,InferTypes::convertBlockToLocalFunction,internal,internal | function | name,internal_function_name, +src/ast/ast_infer_type_make.cpp,307,invalid_argument_type,,InferTypes::visit(ExprMakeBlock),primary,invalid | argument | type,invalid_argument_type, +src/ast/ast_infer_type_make.cpp,322,invalid_block,block is not fully inferred yet,InferTypes::visit(ExprMakeBlock),follow_on,not_resolved_yet | block,not_resolved_yet_block, +src/ast/ast_infer_type_make.cpp,340,invalid_block,block is not fully inferred yet,InferTypes::visit(ExprMakeBlock),follow_on,not_resolved_yet | block,not_resolved_yet_block, +src/ast/ast_infer_type_make.cpp,359,invalid_type,[[variant]] with non-variant type,InferTypes::preVisit(ExprMakeVariant),primary,invalid | variant | type,invalid_variant_type, +src/ast/ast_infer_type_make.cpp,363,invalid_type,[[]] variant can only initialize single dimension arrays,InferTypes::preVisit(ExprMakeVariant),primary,invalid | variant | array,invalid_variant_array, +src/ast/ast_infer_type_make.cpp,366,invalid_type,"[[]] variant dimension mismatch, provided elements",InferTypes::preVisit(ExprMakeVariant),primary,invalid | variant | mismatching,mismatching_variant_dimension, +src/ast/ast_infer_type_make.cpp,371,invalid_type,[[]] variant can't be reference,InferTypes::preVisit(ExprMakeVariant),primary,invalid | variant | ref,invalid_variant_ref, +src/ast/ast_infer_type_make.cpp,385,cant_pass_temporary,can't initialize variant field with temporary value,InferTypes::visitMakeVariantField,primary,cant | variant | field,cant_initialize_variant_field_temporary, +src/ast/ast_infer_type_make.cpp,389,invalid_type,field can't be copied; ,InferTypes::visitMakeVariantField,recategorize,cant | variant | field,cant_copy_variant_field,recategorize: cerr is invalid_type but error is about copy semantics +src/ast/ast_infer_type_make.cpp,396,cant_move,can't move from a constant value ,InferTypes::visitMakeVariantField,primary,cant | variant | field,cant_move_variant_field, +src/ast/ast_infer_type_make.cpp,400,cant_get_field,field not found: '',InferTypes::visitMakeVariantField,primary,lookup | variant | field,lookup_variant_field, +src/ast/ast_infer_type_make.cpp,417,type_not_found,undefined variant type ,InferTypes::visit(ExprMakeVariant),primary,lookup | variant | type,lookup_variant_type, +src/ast/ast_infer_type_make.cpp,423,type_not_found,variant of undefined type ,InferTypes::visit(ExprMakeVariant),primary,lookup | variant | type,lookup_variant_type, +src/ast/ast_infer_type_make.cpp,427,type_not_found,variant can't be void,InferTypes::visit(ExprMakeVariant),recategorize,invalid | variant | void,invalid_variant_void,recategorize: not a lookup miss; cerr should be invalid_type +src/ast/ast_infer_type_make.cpp,493,too_many_infer_passes,call expression depth exceeded maximum allowed (),InferTypes::canVisitMakeStructure,primary,exceeds | expression | recursion,exceeds_expression_recursion, +src/ast/ast_infer_type_make.cpp,509,invalid_type,[[]] with non-structure type,InferTypes::preVisit(ExprMakeStruct),primary,invalid | structure | type,invalid_structure_type, +src/ast/ast_infer_type_make.cpp,514,invalid_type,[[]] struct can only initialize single dimension arrays,InferTypes::preVisit(ExprMakeStruct),primary,invalid | structure | array,invalid_structure_array, +src/ast/ast_infer_type_make.cpp,517,invalid_type,"[[]] struct dimension mismatch, provided elements",InferTypes::preVisit(ExprMakeStruct),primary,invalid | structure | mismatching,mismatching_structure_dimension, +src/ast/ast_infer_type_make.cpp,522,invalid_type,[[]] struct can't be reference,InferTypes::preVisit(ExprMakeStruct),primary,invalid | structure | ref,invalid_structure_ref, +src/ast/ast_infer_type_make.cpp,526,invalid_type,Class '' has fields which can't be allocated locally,InferTypes::preVisit(ExprMakeStruct),primary,invalid | class | type,invalid_class_local, +src/ast/ast_infer_type_make.cpp,531,invalid_type,() can`t be allocated locally (on the stack...),InferTypes::preVisit(ExprMakeStruct),primary,invalid | structure | type,invalid_structure_local,typo: can`t -> can't (backtick instead of apostrophe) +src/ast/ast_infer_type_make.cpp,538,invalid_type,'new [[]]' struct requires initializer syntax,InferTypes::preVisit(ExprMakeStruct),primary,invalid | structure | type,invalid_structure_initializer_required, +src/ast/ast_infer_type_make.cpp,543,unsafe,Constructing class on stack is unsafe,InferTypes::preVisit(ExprMakeStruct),primary,unsafe | class,unsafe_class_local, +src/ast/ast_infer_type_make.cpp,548,unsafe,Uninitialized structure is unsafe,InferTypes::preVisit(ExprMakeStruct),primary,unsafe | structure,unsafe_structure_uninitialized, +src/ast/ast_infer_type_make.cpp,557,invalid_type,"Expected make block for struct construction, got ",InferTypes::convertCloneSemanticsToExpression,internal,internal | structure | block,internal_structure_block, +src/ast/ast_infer_type_make.cpp,563,invalid_type,"Expected block for make block, got ",InferTypes::convertCloneSemanticsToExpression,internal,internal | block,internal_block, +src/ast/ast_infer_type_make.cpp,603,cant_pass_temporary,can't capture temporary lambda variable ,InferTypes::visitMakeStructureField,primary,cant | lambda | variable,cant_capture_temporary_variable, +src/ast/ast_infer_type_make.cpp,606,cant_pass_temporary,can't initialize structure field with temporary value,InferTypes::visitMakeStructureField,primary,cant | structure | field,cant_initialize_structure_field_temporary, +src/ast/ast_infer_type_make.cpp,611,invalid_type,field can't be copied; ,InferTypes::visitMakeStructureField,recategorize,cant | structure | field,cant_copy_structure_field,recategorize: cerr is invalid_type but error is about copy semantics +src/ast/ast_infer_type_make.cpp,618,cant_move,can't move from a constant value ,InferTypes::visitMakeStructureField,primary,cant | structure | field,cant_move_structure_field, +src/ast/ast_infer_type_make.cpp,622,cant_get_field,"field is private, can't be initialized",InferTypes::visitMakeStructureField,recategorize,cant | structure | field | private,cant_initialize_private_field,recategorize: cerr is cant_get_field; should be invalid_private +src/ast/ast_infer_type_make.cpp,672,cant_get_field,"field not found, ",InferTypes::visitMakeStructureField,primary,lookup | structure | field,lookup_structure_field, +src/ast/ast_infer_type_make.cpp,678,cant_get_field,"field is a property, not a value; ",InferTypes::visitMakeStructureField,primary,invalid | annotation | field,invalid_annotation_field, +src/ast/ast_infer_type_make.cpp,685,invalid_type,field can't be copied; ,InferTypes::visitMakeStructureField,recategorize,cant | annotation | field,cant_copy_annotation_field,recategorize: cerr is invalid_type but error is about copy semantics +src/ast/ast_infer_type_make.cpp,692,cant_move,can't move from a constant value ,InferTypes::visitMakeStructureField,primary,cant | annotation | field,cant_move_annotation_field, +src/ast/ast_infer_type_make.cpp,699,cant_get_field,"annotation field not found, ",InferTypes::visitMakeStructureField,primary,lookup | annotation | field,lookup_annotation_field, +src/ast/ast_infer_type_make.cpp,707,invalid_type,can't infer tuple type ,InferTypes::structToTuple,follow_on,not_resolved_yet | tuple | type,not_resolved_yet_tuple_type, +src/ast/ast_infer_type_make.cpp,717,cant_get_field,"tuple field not found, ",InferTypes::structToTuple,primary,lookup | tuple | field,lookup_tuple_field, +src/ast/ast_infer_type_make.cpp,721,field_already_initialized,"tuple field already initialized, ",InferTypes::structToTuple,primary,already_declared | tuple | field,already_declared_tuple_field, +src/ast/ast_infer_type_make.cpp,743,unsafe,ignoring visibility check on structure initialization requires unsafe,InferTypes::visit(ExprMakeStruct),primary,unsafe | structure,unsafe_structure_visibility, +src/ast/ast_infer_type_make.cpp,751,type_not_found,undefined [[ ]] expression type ,InferTypes::visit(ExprMakeStruct),primary,lookup | expression | type,lookup_expression_type, +src/ast/ast_infer_type_make.cpp,774,function_not_found,constructor can't be inferred ,InferTypes::visit(ExprMakeStruct),primary,lookup | structure | function,lookup_constructor, +src/ast/ast_infer_type_make.cpp,788,invalid_block,can only pipe block into structure declaration,InferTypes::visit(ExprMakeStruct),primary,invalid | structure | block,invalid_structure_block_pipe, +src/ast/ast_infer_type_make.cpp,796,invalid_block,where closure should only have one argument,InferTypes::visit(ExprMakeStruct),primary,invalid | block | argument,invalid_block_argument_count, +src/ast/ast_infer_type_make.cpp,814,invalid_block,can't infer where closure block argument,InferTypes::visit(ExprMakeStruct),follow_on,not_resolved_yet | block | argument,not_resolved_yet_block_argument, +src/ast/ast_infer_type_make.cpp,819,invalid_block,"where closure block argument type mismatch, vs ",InferTypes::visit(ExprMakeStruct),primary,invalid | block | argument | mismatching,mismatching_block_argument_type, +src/ast/ast_infer_type_make.cpp,824,invalid_block,where closure block argument can't be constant,InferTypes::visit(ExprMakeStruct),primary,invalid | block | argument,invalid_block_argument_constant, +src/ast/ast_infer_type_make.cpp,835,invalid_type, is not a class but a variant,InferTypes::visit(ExprMakeStruct),primary,invalid | class | variant,invalid_class_variant, +src/ast/ast_infer_type_make.cpp,839,invalid_type, is not a struct but a variant,InferTypes::visit(ExprMakeStruct),primary,invalid | structure | variant,invalid_structure_variant, +src/ast/ast_infer_type_make.cpp,843,invalid_type, is not a tuple but a variant,InferTypes::visit(ExprMakeStruct),primary,invalid | tuple | variant,invalid_tuple_variant, +src/ast/ast_infer_type_make.cpp,848,invalid_block,[[variant]] can't have where closure,InferTypes::visit(ExprMakeStruct),primary,invalid | variant | block,invalid_variant_block, +src/ast/ast_infer_type_make.cpp,857,field_already_initialized,variant only supports one initializer,InferTypes::visit(ExprMakeStruct),primary,invalid | variant,invalid_variant_initializer_count, +src/ast/ast_infer_type_make.cpp,872,invalid_type, is not a class but a tuple,InferTypes::visit(ExprMakeStruct),primary,invalid | class | tuple,invalid_class_tuple, +src/ast/ast_infer_type_make.cpp,876,invalid_type, is not a struct but a tuple,InferTypes::visit(ExprMakeStruct),primary,invalid | structure | tuple,invalid_structure_tuple, +src/ast/ast_infer_type_make.cpp,880,invalid_type, is not a variant but a tuple,InferTypes::visit(ExprMakeStruct),primary,invalid | variant | tuple,invalid_variant_tuple, +src/ast/ast_infer_type_make.cpp,885,invalid_block,[[tuple]] can't have where closure,InferTypes::visit(ExprMakeStruct),primary,invalid | tuple | block,invalid_tuple_block, +src/ast/ast_infer_type_make.cpp,917,invalid_type,can't initialize template structure ,InferTypes::visit(ExprMakeStruct),primary,invalid | structure | type,invalid_structure_template, +src/ast/ast_infer_type_make.cpp,926,field_already_initialized,field is already initialized,InferTypes::visit(ExprMakeStruct),primary,already_declared | structure | field,already_declared_structure_field_init, +src/ast/ast_infer_type_make.cpp,941,,structure '' is not fully resolved yet,InferTypes::visit(ExprMakeStruct),follow_on,not_resolved_yet | structure,not_resolved_yet_structure,missing cerr +src/ast/ast_infer_type_make.cpp,1035,invalid_type,enumeration is missing 0 value,InferTypes::visit(ExprMakeStruct),primary,missing | enumeration | enumerator,missing_enumeration_zero_value, +src/ast/ast_infer_type_make.cpp,1060,invalid_type,undefined structure type ,InferTypes::visit(ExprMakeStruct),follow_on,not_resolved_yet | structure | type,not_resolved_yet_structure_type, +src/ast/ast_infer_type_make.cpp,1064,unsafe,skipping initializer for class initialization requires unsafe,InferTypes::visit(ExprMakeStruct),primary,unsafe | class,unsafe_class_initializer, +src/ast/ast_infer_type_make.cpp,1068,invalid_type, is not a class,InferTypes::visit(ExprMakeStruct),primary,invalid | class,invalid_class, +src/ast/ast_infer_type_make.cpp,1072,invalid_type, is not a struct,InferTypes::visit(ExprMakeStruct),primary,invalid | structure,invalid_structure, +src/ast/ast_infer_type_make.cpp,1076,invalid_type, is not a variant,InferTypes::visit(ExprMakeStruct),primary,invalid | variant,invalid_variant, +src/ast/ast_infer_type_make.cpp,1080,invalid_type, is not a tuple,InferTypes::visit(ExprMakeStruct),primary,invalid | tuple,invalid_tuple, +src/ast/ast_infer_type_make.cpp,1097,invalid_type,tuple element _ out of element range,InferTypes::visitMakeTupleIndex,primary,exceeds | tuple,exceeds_tuple_index, +src/ast/ast_infer_type_make.cpp,1106,cant_move,can't move from a constant value ,InferTypes::visitMakeTupleIndex,primary,cant | tuple,cant_move_tuple, +src/ast/ast_infer_type_make.cpp,1119,invalid_type,not fully defined tuple element type,InferTypes::visit(ExprMakeTuple),follow_on,not_resolved_yet | tuple | type,not_resolved_yet_tuple_type, +src/ast/ast_infer_type_make.cpp,1126,invalid_type,internal error. ExprMakeTuple with non-tuple record type,InferTypes::visit(ExprMakeTuple),internal,internal | tuple | type,internal_tuple_type, +src/ast/ast_infer_type_make.cpp,1132,invalid_type,declaring arguments in ,InferTypes::visit(ExprMakeTuple),primary,invalid | tuple | argument | mismatching,mismatching_tuple_argument_count, +src/ast/ast_infer_type_make.cpp,1142,invalid_type,"invalid argument _, expecting , passing ",InferTypes::visit(ExprMakeTuple),primary,invalid | tuple | argument | type,invalid_tuple_argument_type, +src/ast/ast_infer_type_make.cpp,1162,invalid_type,tuple element type can't be void,InferTypes::visit(ExprMakeTuple),primary,invalid | tuple | void,invalid_tuple_void, +src/ast/ast_infer_type_make.cpp,1172,invalid_type,tuple field names mismatch,InferTypes::visit(ExprMakeTuple),primary,invalid | tuple | field | mismatching,mismatching_tuple_field_names, +src/ast/ast_infer_type_make.cpp,1187,invalid_table_type,a => b tuple key can't be declared as a reference,InferTypes::visit(ExprMakeTuple),primary,invalid | tuple | ref,invalid_tuple_key_ref, +src/ast/ast_infer_type_make.cpp,1191,invalid_table_type,a => b tuple key has to be declare as a basic 'hashable' type,InferTypes::visit(ExprMakeTuple),primary,invalid | tuple | type,invalid_tuple_key_type,typo: declare -> declared +src/ast/ast_infer_type_make.cpp,1197,invalid_type,tuple element has to be copyable or moveable,InferTypes::visit(ExprMakeTuple),primary,invalid | tuple | type,invalid_tuple_type, +src/ast/ast_infer_type_make.cpp,1214,invalid_type,fixed_array<> array type can't be reference,InferTypes::preVisit(ExprMakeArray),primary,invalid | array | ref,invalid_array_ref, +src/ast/ast_infer_type_make.cpp,1220,invalid_type,[[]] array can only initialize single dimension arrays,InferTypes::preVisit(ExprMakeArray),primary,invalid | array,invalid_array_dimension_multi, +src/ast/ast_infer_type_make.cpp,1223,invalid_type,"[[]] array dimension mismatch, provided elements",InferTypes::preVisit(ExprMakeArray),primary,invalid | array | mismatching,mismatching_array_dimension, +src/ast/ast_infer_type_make.cpp,1228,invalid_type,[[]] array can't be reference,InferTypes::preVisit(ExprMakeArray),primary,invalid | array | ref,invalid_array_ref, +src/ast/ast_infer_type_make.cpp,1259,invalid_array_type,"array type can't be inferred, = ",InferTypes::visitMakeArrayIndex,follow_on,not_resolved_yet | array | type,not_resolved_yet_array_type, +src/ast/ast_infer_type_make.cpp,1266,invalid_array_type,array element type can't be void,InferTypes::visitMakeArrayIndex,primary,invalid | array | void,invalid_array_void, +src/ast/ast_infer_type_make.cpp,1275,invalid_array_type,"can't infer array auto type, first element type is undefined",InferTypes::visitMakeArrayIndex,follow_on,not_resolved_yet | array | type,not_resolved_yet_array_type, +src/ast/ast_infer_type_make.cpp,1296,invalid_type,can't recognize unique variant '' in '',InferTypes::visitMakeArrayIndex,primary,invalid | variant | type,invalid_variant_unique, +src/ast/ast_infer_type_make.cpp,1306,invalid_type,can't recognize unique variant '' in '',InferTypes::visitMakeArrayIndex,mid_inference,invalid | variant | type,invalid_variant_unique,verbose-gated branch with describe candidates +src/ast/ast_infer_type_make.cpp,1310,invalid_type,can't recognize unique variant,InferTypes::visitMakeArrayIndex,primary,invalid | variant | type,invalid_variant_unique, +src/ast/ast_infer_type_make.cpp,1331,cant_move,can't move from a constant value ,InferTypes::visitMakeArrayIndex,primary,cant | array,cant_move_array_element, +src/ast/ast_infer_type_make.cpp,1334,cant_pass_temporary,can't initialize array element with temporary value,InferTypes::visitMakeArrayIndex,primary,cant | array,cant_initialize_array_element_temporary, +src/ast/ast_infer_type_make.cpp,1386,invalid_type,array element has to be copyable or moveable,InferTypes::visit(ExprMakeArray),primary,invalid | array | type,invalid_array_element_type, +src/ast/ast_infer_type_make.cpp,1400,invalid_type,unknown value type,InferTypes::visit(ExprMakeArray),follow_on,not_resolved_yet | type,not_resolved_yet_value_type, +src/ast/ast_infer_type_make.cpp,1404,invalid_type,incompatible value type. expecting vs ,InferTypes::visit(ExprMakeArray),primary,invalid | array | type | mismatching,mismatching_array_element_type, +src/ast/ast_infer_type_make.cpp,1426,invalid_type,array element type is not resolved,InferTypes::visit(ExprMakeArray),follow_on,not_resolved_yet | array | type,not_resolved_yet_array_type, +src/ast/ast_infer_type_make.cpp,1444,invalid_type,comprehension element has to be copyable or moveable,InferTypes::visit(ExprArrayComprehension),primary,invalid | array | type,invalid_comprehension_element_type, +src/ast/ast_infer_type_make.cpp,1447,invalid_type,comprehension element type is not resolved,InferTypes::visit(ExprArrayComprehension),follow_on,not_resolved_yet | array | type,not_resolved_yet_comprehension_type, +src/ast/ast_infer_type_op.cpp,34,invalid_type,operations on 'void' pointers are prohibited; ,InferTypes::visit(ExprOp1*),primary,cant | type | void,cant_type_void, +src/ast/ast_infer_type_op.cpp,47,invalid_type,"type is not fully inferred, fixed array dimension is unknown",InferTypes::visit(ExprOp1*),follow_on,not_resolved_yet | type | array,not_resolved_yet_array_type, +src/ast/ast_infer_type_op.cpp,58,operator_not_found,"pointer arithmetics only allows +, -, +=, -=, ++, --; not",InferTypes::visit(ExprOp1*),primary,invalid | expression,invalid_pointer_arithmetic, +src/ast/ast_infer_type_op.cpp,66,operator_not_found, can't be applied to non reference ,InferTypes::visit(ExprOp1*),primary,cant | expression | ref,cant_apply_op_non_reference, +src/ast/ast_infer_type_op.cpp,70,operator_not_found, can't be applied to constant ,InferTypes::visit(ExprOp1*),primary,cant | expression | constant,cant_apply_op_constant, +src/ast/ast_infer_type_op.cpp,104,unsafe,unsafe operator '' must be inside the 'unsafe' block,InferTypes::visit(ExprOp1*),primary,unsafe | expression,unsafe_operator, +src/ast/ast_infer_type_op.cpp,270,invalid_type,operations on 'void' pointers are prohibited; ,InferTypes::visit(ExprOp2*),primary,cant | type | void,cant_type_void, +src/ast/ast_infer_type_op.cpp,295,operator_not_found,"pointer arithmetics only allows +, -, +=, -=, ++, --; not",InferTypes::visit(ExprOp2*),primary,invalid | expression,invalid_pointer_arithmetic, +src/ast/ast_infer_type_op.cpp,303,invalid_type,operations on incompatible pointers are prohibited; vs ,InferTypes::visit(ExprOp2*),primary,invalid | type | mix,invalid_type_mix, +src/ast/ast_infer_type_op.cpp,310,invalid_type,operations on 'void' pointers are prohibited; ,InferTypes::visit(ExprOp2*),primary,cant | type | void,cant_type_void, +src/ast/ast_infer_type_op.cpp,327,invalid_type,operations on different enumerations are prohibited,InferTypes::visit(ExprOp2*),primary,invalid | enumeration | mix,invalid_enumeration_mix, +src/ast/ast_infer_type_op.cpp,360,unsafe,unsafe operator '' must be inside the 'unsafe' block,InferTypes::visit(ExprOp2*),primary,unsafe | expression,unsafe_operator, +src/ast/ast_infer_type_op.cpp,379,operator_not_found,Op3 currently only supports 'is',InferTypes::visit(ExprOp3*),wording_fix,invalid | expression,invalid_op3_expression,"reword: 'Op3 currently only supports ?:' (code uses ?, not 'is')" +src/ast/ast_infer_type_op.cpp,385,condition_must_be_bool,cond operator condition must be boolean,InferTypes::visit(ExprOp3*),primary,invalid | expression,condition_must_be_bool, +src/ast/ast_infer_type_op.cpp,388,operator_not_found,cond operator must return the same types on both sides,InferTypes::visit(ExprOp3*),primary,mismatching | type,mismatching_type, +src/ast/ast_infer_type_op.cpp,392,invalid_type,"cond operator must return a value, not void",InferTypes::visit(ExprOp3*),primary,invalid | type | void,invalid_type_void, +src/ast/ast_infer_type_op.cpp,426,,; = ,InferTypes::canCopyOrMoveType,primary,cant | type | void,cant_copy_void_pointer, +src/ast/ast_infer_type_op.cpp,433,,; = ,InferTypes::canCopyOrMoveType,primary,cant | type | constant,cant_copy_to_non_const_pointer, +src/ast/ast_infer_type_op.cpp,439,,; = ,InferTypes::canCopyOrMoveType,primary,mismatching | type,mismatching_type, +src/ast/ast_infer_type_op.cpp,455,,; = ,InferTypes::canCopyOrMoveType,primary,mismatching | type,mismatching_type, +src/ast/ast_infer_type_op.cpp,479,cant_write_to_non_reference,can only move to a reference,InferTypes::visit(ExprMove*),primary,cant | expression | ref,cant_move_to_non_reference, +src/ast/ast_infer_type_op.cpp,482,cant_write_to_non_reference,can only move to from a reference,InferTypes::visit(ExprMove*),wording_fix,cant | expression | ref,cant_move_from_non_reference,"typo: 'move to from' -> 'move from'" +src/ast/ast_infer_type_op.cpp,485,cant_move_to_const,can't move to a constant value,InferTypes::visit(ExprMove*),primary,cant | expression | constant,cant_move_to_const, +src/ast/ast_infer_type_op.cpp,488,cant_move,"this type can't be moved, use clone (:=) instead",InferTypes::visit(ExprMove*),primary,cant | type,cant_move_type, +src/ast/ast_infer_type_op.cpp,491,cant_move,can't move from a constant value,InferTypes::visit(ExprMove*),primary,cant | expression | constant,cant_move_from_const, +src/ast/ast_infer_type_op.cpp,494,cant_pass_temporary,can't move temporary value,InferTypes::visit(ExprMove*),primary,cant | expression,cant_move_temporary, +src/ast/ast_infer_type_op.cpp,497,unsafe,moving values which contain smart pointers is unsafe,InferTypes::visit(ExprMove*),primary,unsafe | expression,unsafe_move_smart_pointer, +src/ast/ast_infer_type_op.cpp,502,unsafe,moving from the smart pointer value requires unsafe,InferTypes::visit(ExprMove*),primary,unsafe | expression,unsafe_move_from_smart_pointer, +src/ast/ast_infer_type_op.cpp,508,unsafe,moving classes requires unsafe,InferTypes::visit(ExprMove*),primary,unsafe | class,unsafe_move_class, +src/ast/ast_infer_type_op.cpp,589,cant_write_to_non_reference,can only copy to a reference,InferTypes::visit(ExprCopy*),primary,cant | expression | ref,cant_copy_to_non_reference, +src/ast/ast_infer_type_op.cpp,592,cant_write_to_const,can't write to a constant value,InferTypes::visit(ExprCopy*),primary,cant | expression | constant,cant_write_to_const, +src/ast/ast_infer_type_op.cpp,595,cant_pass_temporary,can't copy temporary value,InferTypes::visit(ExprCopy*),primary,cant | expression,cant_copy_temporary, +src/ast/ast_infer_type_op.cpp,598,unsafe,copying classes requires unsafe,InferTypes::visit(ExprCopy*),primary,unsafe | class,unsafe_copy_class, +src/ast/ast_infer_type_op.cpp,602,cant_copy,this type can't be copied,InferTypes::visit(ExprCopy*),primary,cant | type,cant_copy_type, +src/ast/ast_infer_type_op.cpp,710,operator_not_found,can only clone the same type vs ,InferTypes::visit(ExprClone*),recategorize,mismatching | type,mismatching_clone_type,recategorize: cerror operator_not_found wrong; this is type-mismatch on clone (use mismatching_type) +src/ast/ast_infer_type_op.cpp,713,cant_write_to_non_reference,can only clone to a reference,InferTypes::visit(ExprClone*),primary,cant | expression | ref,cant_clone_to_non_reference, +src/ast/ast_infer_type_op.cpp,716,cant_write_to_const,can't write to a constant value ,InferTypes::visit(ExprClone*),primary,cant | expression | constant,cant_clone_to_const, +src/ast/ast_infer_type_op.cpp,736,invalid_type,can only clone smart pointer to handled type,InferTypes::visit(ExprClone*),primary,invalid | type,invalid_clone_smart_pointer_type, +src/ast/ast_infer_type_report.cpp,358,,,InferTypes::reportDualFunctionNotFound,mid_inference,lookup | function,lookup_function,gated by verbose; emits expensive describe()/candidate dump every infer pass +src/ast/ast_infer_type_report.cpp,360,,,InferTypes::reportDualFunctionNotFound,primary,lookup | function,lookup_function, +src/ast/ast_infer_type_report.cpp,441,,,InferTypes::reportFunctionNotFound,mid_inference,lookup | function,lookup_function,gated by verbose; emits expensive describe()/candidate dump every infer pass +src/ast/ast_infer_type_report.cpp,443,,,InferTypes::reportFunctionNotFound,primary,lookup | function,lookup_function, +src/ast/ast_infer_type_report.cpp,506,,,InferTypes::reportFunctionNotFound,mid_inference,lookup | function,lookup_function,gated by verbose; emits expensive describe()/candidate dump every infer pass +src/ast/ast_infer_type_report.cpp,508,,,InferTypes::reportFunctionNotFound,primary,lookup | function,lookup_function, +src/ast/ast_infer_type_report.cpp,520,cant_copy,,InferTypes::reportCantClone,mid_inference,cant | type,cant_clone_type,gated by verbose; emits trait-walk for clonable subtypes +src/ast/ast_infer_type_report.cpp,522,cant_copy,,InferTypes::reportCantClone,primary,cant | type,cant_clone_type, +src/ast/ast_infer_type_report.cpp,534,,; ,InferTypes::reportCantCloneFromConst,mid_inference,cant | type | constant,cant_clone_from_const,gated by verbose; emits trait-walk for non-clonable-from-const subtypes +src/ast/ast_infer_type_report.cpp,536,,,InferTypes::reportCantCloneFromConst,primary,cant | type | constant,cant_clone_from_const, +src/ast/ast_infer_type_report.cpp,591,function_not_found,function not found ,InferTypes::reportFunctionNotFound(ExprAddr*),mid_inference,lookup | function,lookup_function,gated by verbose; emits library-wide candidate scan +src/ast/ast_infer_type_report.cpp,594,function_not_found,function not found ,InferTypes::reportFunctionNotFound(ExprAddr*),primary,lookup | function,lookup_function, +src/ast/ast_infer_type_report.cpp,607,function_already_declared,,InferTypes::reportMissingFinalizer,recategorize,missing | function,missing_finalizer,recategorize: function_already_declared wrong cerr for missing finalizer (verbose path uses reportMissing which keeps it; non-verbose path emits as-is) +src/ast/ast_infer_type_report.cpp,659,,no matching functions or generics: ,InferTypes::reportMissing(ExprNamedCall*),primary,lookup | function,lookup_function, +src/ast/ast_infer_type_report.cpp,669,,too many matching functions or generics: ,InferTypes::reportExcess(ExprNamedCall*),primary,ambiguous | function,ambiguous_function, +src/ast/ast_infer_type_report.cpp,723,,no matching functions or generics: ,InferTypes::reportMissing(ExprLooksLikeCall*),primary,lookup | function,lookup_function, +src/ast/ast_infer_type_report.cpp,735,,too many matching functions or generics: ,InferTypes::reportExcess(ExprLooksLikeCall*),primary,ambiguous | function,ambiguous_function, +src/ast/ast_infer_type_report.cpp,745,operator_not_found,numeric operator '' left side must be reference,InferTypes::reportOp2Errors,primary,cant | expression | ref,cant_assign_op_non_reference,"reword: drop trailing period for consistency" +src/ast/ast_infer_type_report.cpp,749,operator_not_found,numeric operator '' left side can't be constant,InferTypes::reportOp2Errors,primary,cant | expression | constant,cant_assign_op_constant,"reword: drop trailing period for consistency" +src/ast/ast_infer_type_report.cpp,756,operator_not_found,numeric operator '' type mismatch. both sides have to be of the same type; is not defined,InferTypes::reportOp2Errors,mid_inference,mismatching | type,mismatching_numeric_type,gated by verbose; expensive describe of try-the-following hint +src/ast/ast_infer_type_report.cpp,762,operator_not_found,numeric operator '' type mismatch. both sides have to be of the same type,InferTypes::reportOp2Errors,primary,mismatching | type,mismatching_numeric_type, +src/ast/ast_infer_type_report.cpp,773,operator_not_found,numeric operator '' type mismatch. both sides have to be of the same type. is not defined,InferTypes::reportOp2Errors,mid_inference,mismatching | type,mismatching_numeric_type,gated by verbose; expensive describe of try-one-of-the-following hint +src/ast/ast_infer_type_report.cpp,779,operator_not_found,"numeric operator '' is not defined for storage types (int8, uint8, int16, uint16)",InferTypes::reportOp2Errors,primary,invalid | type,invalid_storage_type_op, +src/ast/ast_infer_type_report.cpp,784,operator_not_found,numeric operator '' type mismatch,InferTypes::reportOp2Errors,mid_inference,mismatching | type,mismatching_numeric_type,gated by verbose; emits describe of left/right baseTypes +src/ast/ast_infer_type_report.cpp,790,operator_not_found,numeric operator '' type mismatch,InferTypes::reportOp2Errors,primary,mismatching | type,mismatching_numeric_type, +src/ast/ast.cpp,3033,invalid_annotation,can't create structure handle ,Program::addStructureHandle,primary,cant | structure | annotation,cant_create_structure_annotation, +src/ast/ast.cpp,3037,invalid_annotation,not a structure annotation ,Program::addStructureHandle,primary,invalid | structure | annotation,invalid_structure_annotation, +src/ast/ast.cpp,3066,type_not_found,undefined make type declaration type ,Program::makeTypeDeclaration,ambiguous,ambiguous | type,ambiguous_type,"wording: 'undefined' contradicts ambiguous semantics; cerr says type_not_found but multiple matches exist" +src/ast/ast.cpp,3076,structure_not_found,too many options for ,Program::makeTypeDeclaration,recategorize,ambiguous | structure,ambiguous_structure,"recategorize: structure_not_found when multiple found is wrong; should be ambiguous_structure" +src/ast/ast.cpp,3088,handle_not_found,not a handled type annotation ,Program::makeTypeDeclaration,recategorize,invalid | annotation,invalid_annotation,"recategorize: handle_not_found is misleading; this is a type-mismatch on the resolved annotation" +src/ast/ast.cpp,3094,handle_not_found,too many options for ,Program::makeTypeDeclaration,recategorize,ambiguous | annotation,ambiguous_annotation,"recategorize: handle_not_found should be ambiguous_annotation when multiple found" +src/ast/ast.cpp,3106,enumeration_not_found,too many options for ,Program::makeTypeDeclaration,recategorize,ambiguous | enumeration,ambiguous_enumeration,"recategorize: enumeration_not_found should be ambiguous_enumeration when multiple found" +src/ast/ast.cpp,3117,type_alias_not_found,too many options for ,Program::makeTypeDeclaration,recategorize,ambiguous | type_alias,ambiguous_type_alias,"recategorize: type_alias_not_found should be ambiguous_type_alias when multiple found" +src/ast/ast.cpp,3146,function_not_found,too many options for ,Program::makeCall,recategorize,ambiguous | function,ambiguous_function,"recategorize: function_not_found should be ambiguous_function when multiple found" +src/ast/ast.cpp,3527,,optimization macro :: failed,Program::optimizationRefreshSemanticHashes,primary,runtime | macro,runtime_macro,missing cerr; suggest macro_failed +src/ast/ast_annotations.cpp,33,invalid_annotation,can't finalize structure annotation [],FinAnnotationVisitor::preVisit(Structure*),primary,cant | structure | annotation,cant_finalize_structure_annotation, +src/ast/ast_annotations.cpp,45,invalid_annotation,can't finalize annotation [],FinAnnotationVisitor::preVisit(Function*),primary,cant | function | annotation,cant_finalize_function_annotation, +src/ast/ast_annotations.cpp,57,invalid_annotation,can't finalize annotation [],FinAnnotationVisitor::preVisit(ExprBlock*),primary,cant | block | annotation,cant_finalize_block_annotation, +src/ast/ast_annotations.cpp,65,invalid_annotation,internal error. both annotationData and Sid must be provided,FinAnnotationVisitor::preVisit(ExprBlock*),internal,internal | annotation,internal_annotation, +src/ast/ast_annotations.cpp,117,annotation_failed,function annotation patch failed,Program::patchAnnotations,primary,runtime | function | annotation,runtime_function_annotation, +src/ast/ast_annotations.cpp,131,annotation_failed,structure annotation patch failed,Program::patchAnnotations,primary,runtime | structure | annotation,runtime_structure_annotation, +src/ast/ast_annotations.cpp,179,annotation_failed,function annotation patch failed,Program::fixupAnnotations,primary,runtime | function | annotation,runtime_function_annotation, +src/ast/ast_const_folding.cpp,86,missing_node,internal compilation error reached side-effect analysis with unresolved func,SideEffectVisitor::reportNullFunc,internal,internal | function | not_resolved_yet,internal_function_not_resolved_yet, +src/ast/ast_const_folding.cpp,851,,static assert condition is not constexpr or const,RunFolding::visit(ExprStaticAssert*),primary,invalid | expression,invalid_expression,missing cerr; suggest static_assert_failed or new not_constexpr +src/ast/ast_const_folding.cpp,859,,exception while computing static assert condition,RunFolding::visit(ExprStaticAssert*),primary,runtime | expression,runtime_expression,missing cerr; suggest static_assert_failed +src/ast/ast_const_folding.cpp,872,,exception while computing static assert message,RunFolding::visit(ExprStaticAssert*),primary,runtime | expression,runtime_expression,missing cerr; suggest static_assert_failed +src/ast/ast_const_folding.cpp,888,concept_failed,,RunFolding::visit(ExprStaticAssert*),primary,missing | annotation,missing_annotation,"message is user-supplied; concept_failed cerr stays" +src/ast/ast_const_folding.cpp,894,static_assert_failed,,RunFolding::visit(ExprStaticAssert*),primary,missing | annotation,missing_annotation,"message is user-supplied; static_assert_failed cerr stays" +src/ast/ast_const_folding.cpp,904,run_failed,function did not run at compilation time because it has side-effects,RunFolding::preVisit(ExprCall*),primary,runtime | function,runtime_function, +src/ast/ast_const_folding.cpp,907,run_failed,function did not run at compilation time,RunFolding::preVisit(ExprCall*),primary,runtime | function,runtime_function, +src/ast/ast_const_folding.cpp,962,run_failed,internal compilation error folding symbol was not marked as used,RunFolding::visit(ExprCall*),internal,internal | function,internal_function, +src/ast/ast_derive_alias.cpp,355,make_local_aliasing,[[ ]] always aliases,DeriveAliasingVisitor::preVisitMakeLocal,primary,invalid | expression | mix,invalid_expression_mix, +src/ast/ast_derive_alias.cpp,375,make_local_aliasing,[[ ]] always aliases,DeriveAliasingVisitor::preVisitMakeLocal,primary,invalid | expression | mix,invalid_expression_mix, +src/ast/ast_derive_alias.cpp,383,make_local_aliasing,[[ ]] aliases,DeriveAliasingVisitor::preVisitMakeLocal,primary,invalid | expression | mix,invalid_expression_mix, +src/ast/ast_derive_alias.cpp,447,argument_aliasing,invoke result always aliases,DeriveAliasingVisitor::preVisit(ExprInvoke*),primary,invalid | argument | mix,invalid_argument_mix, +src/ast/ast_derive_alias.cpp,471,argument_aliasing,invoke result aliases argument ,DeriveAliasingVisitor::preVisit(ExprInvoke*),primary,invalid | argument | mix,invalid_argument_mix, +src/ast/ast_derive_alias.cpp,480,argument_aliasing,invoke result aliases argument ,DeriveAliasingVisitor::preVisit(ExprInvoke*),primary,invalid | argument | mix,invalid_argument_mix, +src/ast/ast_derive_alias.cpp,502,argument_aliasing,invoke result potentially aliases global through function ,DeriveAliasingVisitor::preVisit(ExprInvoke*),primary,invalid | argument | global | mix,invalid_argument_global_mix, +src/ast/ast_derive_alias.cpp,506,argument_aliasing,invoke result potentially aliases global through lambda at ,DeriveAliasingVisitor::preVisit(ExprInvoke*),primary,invalid | argument | global | mix,invalid_argument_global_mix, +src/ast/ast_derive_alias.cpp,534,argument_aliasing,function result always aliases,DeriveAliasingVisitor::preVisit(ExprCall*),primary,invalid | argument | mix,invalid_argument_mix, +src/ast/ast_derive_alias.cpp,555,argument_aliasing,function result aliases argument ,DeriveAliasingVisitor::preVisit(ExprCall*),primary,invalid | argument | mix,invalid_argument_mix, +src/ast/ast_derive_alias.cpp,564,argument_aliasing,function result aliases argument ,DeriveAliasingVisitor::preVisit(ExprCall*),primary,invalid | argument | mix,invalid_argument_mix, +src/ast/ast_derive_alias.cpp,578,argument_aliasing,function result aliases global variable through function ,DeriveAliasingVisitor::preVisit(ExprCall*),primary,invalid | argument | global | mix,invalid_argument_global_mix, +src/ast/ast_derive_alias.cpp,593,argument_aliasing,function result aliases global variable through function ,DeriveAliasingVisitor::preVisit(ExprCall*),primary,invalid | argument | global | mix,invalid_argument_global_mix, +src/ast/ast_export.cpp,126,,internal error failed to add function ,RemoveUnusedSymbolsVisitor::RemoveUnusedSymbols,internal,internal | function,internal_function,missing cerr; suggest internal_error +src/ast/ast_export.cpp,133,,internal error failed to add variable ,RemoveUnusedSymbolsVisitor::RemoveUnusedSymbols,internal,internal | variable,internal_variable,missing cerr; suggest internal_error +src/ast/ast_lint.cpp,231,invalid_type,type expression result is used and not just passed,LintVisitor::reportUnsafeTypeExpressions,primary,invalid | type | expression,invalid_type_expression, +src/ast/ast_lint.cpp,247,only_fast_aot_no_cpp_name, has no cppName while onlyFastAot option is set,LintVisitor::verifyOnlyFastAot,primary,missing | function | name,missing_function_name, +src/ast/ast_lint.cpp,258,invalid_name,invalid module name '',LintVisitor::preVisitModule,primary,invalid | module | name,invalid_module_name, +src/ast/ast_lint.cpp,271,invalid_name,invalid type argument name '',LintVisitor::lintType,primary,invalid | argument | name,invalid_argument_name, +src/ast/ast_lint.cpp,287,invalid_type,alias '' is too big,LintVisitor::preVisitAlias,primary,exceeds | type_alias,exceeds_type_alias, +src/ast/ast_lint.cpp,295,invalid_name,invalid enumeration name '',LintVisitor::preVisit(Enumeration*),primary,invalid | enumeration | name,invalid_enumeration_name, +src/ast/ast_lint.cpp,302,invalid_name,invalid enumeration value name '',LintVisitor::preVisitEnumerationValue,primary,invalid | enumerator | name,invalid_enumerator_name, +src/ast/ast_lint.cpp,315,invalid_name,invalid structure name '',LintVisitor::preVisit(Structure*),primary,invalid | structure | name,invalid_structure_name, +src/ast/ast_lint.cpp,319,invalid_type,structure '' is too big,LintVisitor::preVisit(Structure*),primary,exceeds | structure,exceeds_structure, +src/ast/ast_lint.cpp,329,unsafe_function,unsafe in global initializer,LintVisitor::preVisitExpression,primary,unsafe | global,unsafe_global, +src/ast/ast_lint.cpp,341,unsafe_function,unsafe function '',LintVisitor::preVisitExpression,primary,unsafe | function,unsafe_function, +src/ast/ast_lint.cpp,354,invalid_name,invalid structure field name ,LintVisitor::preVisitStructureField,primary,invalid | field | name,invalid_field_name, +src/ast/ast_lint.cpp,359,invalid_structure_field_type,class can't contain local class declarations,LintVisitor::preVisitStructureField,primary,cant | field | class,cant_field_class, +src/ast/ast_lint.cpp,367,invalid_name,invalid variable name '',LintVisitor::preVisitGlobalLet,primary,invalid | variable | name,invalid_variable_name, +src/ast/ast_lint.cpp,372,no_global_variables,variable '' is disabled via option no_global_variables_at_all,LintVisitor::preVisitGlobalLet,primary,cant | global,cant_global, +src/ast/ast_lint.cpp,375,no_global_variables,variable '' is not a constant which is disabled via option no_global_variables,LintVisitor::preVisitGlobalLet,primary,cant | global,cant_global, +src/ast/ast_lint.cpp,381,no_global_heap,variable '' uses heap which is disabled via option no_global_heap,LintVisitor::preVisitGlobalLet,primary,cant | global,cant_global, +src/ast/ast_lint.cpp,387,cant_be_null,global variable of type '' needs to be initialized to avoid null pointer,LintVisitor::preVisitGlobalLet,primary,missing | global,missing_global, +src/ast/ast_lint.cpp,392,cant_be_null,global variable of type '' can't be initialized with null,LintVisitor::preVisitGlobalLet,primary,cant | global,cant_global, +src/ast/ast_lint.cpp,397,invalid_variable_type,global variable '' is too big,LintVisitor::preVisitGlobalLet,primary,exceeds | global,exceeds_global, +src/ast/ast_lint.cpp,417,variable_not_found,global variable initialization loop,LintVisitor::preVisitGlobalLetInit,recategorize,recursion | global | loop,recursion_global_loop,"recategorize: variable_not_found is wrong; this is initialization-recursion" +src/ast/ast_lint.cpp,425,no_init,[init] is disabled in the options or CodeOfPolicies,LintVisitor::visitGlobalLetInit,primary,cant | global,cant_global, +src/ast/ast_lint.cpp,437,variable_not_found,global variable is initialized after (),LintVisitor::preVisit(ExprVar*),recategorize,invalid | global,invalid_global,"recategorize: variable_not_found is wrong; this is initialization-order" +src/ast/ast_lint.cpp,451,invalid_name,invalid variable name '',LintVisitor::preVisit(ExprFor*),primary,invalid | variable | name,invalid_variable_name, +src/ast/ast_lint.cpp,459,cant_be_null,can't delete it will create null pointer,LintVisitor::preVisit(ExprDelete*),primary,cant | expression,cant_expression, +src/ast/ast_lint.cpp,470,invalid_name,invalid variable name ,LintVisitor::preVisit(ExprLet*),primary,invalid | variable | name,invalid_variable_name, +src/ast/ast_lint.cpp,475,cant_be_null,local variable of type needs to be initialized to avoid null pointer,LintVisitor::preVisit(ExprLet*),primary,missing | local,missing_local, +src/ast/ast_lint.cpp,480,cant_be_null,local variable of type can't be initialized with null,LintVisitor::preVisit(ExprLet*),primary,cant | local,cant_local, +src/ast/ast_lint.cpp,485,invalid_variable_type,local variable is too big,LintVisitor::preVisit(ExprLet*),primary,exceeds | local,exceeds_local, +src/ast/ast_lint.cpp,493,cant_be_null,can't return null,LintVisitor::preVisit(ExprReturn*),primary,cant | result,cant_result, +src/ast/ast_lint.cpp,514,duplicate_key,duplicate key in string=> table initialization,LintVisitor::verifyToTableMove,primary,already_declared | table | constant,already_declared_table_constant, +src/ast/ast_lint.cpp,532,duplicate_key,duplicate key in table initialization,LintVisitor::verifyToTableMove,primary,already_declared | table | constant,already_declared_table_constant, +src/ast/ast_lint.cpp,549,duplicate_key,duplicate key in string=> set initialization,LintVisitor::verifyToTableMove,primary,already_declared | table | constant,already_declared_table_constant, +src/ast/ast_lint.cpp,562,duplicate_key,duplicate key in set initialization,LintVisitor::verifyToTableMove,primary,already_declared | table | constant,already_declared_table_constant, +src/ast/ast_lint.cpp,575,no_writing_to_nameless,dead write is prohibited by CodeOfPolicies,LintVisitor::verifyNoWrite,primary,cant | expression,cant_expression, +src/ast/ast_lint.cpp,594,missing_node,internal compilation error call reached lint with unresolved func,LintVisitor::preVisit(ExprCall*),internal,internal | function | not_resolved_yet,internal_function_not_resolved_yet, +src/ast/ast_lint.cpp,618,deprecated_function,function is deprecated,LintVisitor::preVisit(ExprCall*),primary,cant | function,cant_function, +src/ast/ast_lint.cpp,627,annotation_failed,call annotated by failed,LintVisitor::preVisit(ExprCall*),primary,runtime | function | annotation,runtime_function_annotation, +src/ast/ast_lint.cpp,636,aot_side_effects,side effects may affect function evaluation order,LintVisitor::preVisit(ExprCall*),primary,invalid | function | argument,invalid_function_argument, +src/ast/ast_lint.cpp,649,invalid_argument_type,builtin_try_recover shouldn't be called directly,LintVisitor::preVisit(ExprCall*),primary,invalid | function | argument,invalid_function_argument, +src/ast/ast_lint.cpp,653,not_expecting_return_value,try { ... } recover { ... } can't have return inside in jit mode,LintVisitor::preVisit(ExprCall*),primary,cant | result,cant_result, +src/ast/ast_lint.cpp,663,cant_be_null,can't pass null to function argument ,LintVisitor::preVisit(ExprCall*),primary,cant | argument,cant_argument, +src/ast/ast_lint.cpp,722,aot_side_effects,side effects may affect evaluation order,LintVisitor::preVisit(ExprOp2*),primary,invalid | expression,invalid_expression, +src/ast/ast_lint.cpp,732,aot_side_effects,side effects may affect evaluation order,LintVisitor::preVisit(ExprOp3*),primary,invalid | expression,invalid_expression, +src/ast/ast_lint.cpp,783,cant_be_null,can't assign null pointer to ,LintVisitor::preVisit(ExprCopy*),primary,cant | expression,cant_expression, +src/ast/ast_lint.cpp,787,no_writing_to_nameless,dead assignment to a temporary value which is prohibited by CodeOfPolicies,LintVisitor::preVisit(ExprCopy*),primary,cant | expression,cant_expression, +src/ast/ast_lint.cpp,797,aot_side_effects,side effects may affect move evaluation order,LintVisitor::preVisit(ExprMove*),primary,invalid | expression,invalid_expression, +src/ast/ast_lint.cpp,802,cant_be_null,can't assign null pointer to ,LintVisitor::preVisit(ExprMove*),primary,cant | expression,cant_expression, +src/ast/ast_lint.cpp,806,no_writing_to_nameless,dead move to a temporary value which is prohibited by CodeOfPolicies,LintVisitor::preVisit(ExprMove*),primary,cant | expression,cant_expression, +src/ast/ast_lint.cpp,816,aot_side_effects,side effects may affect clone evaluation order,LintVisitor::preVisit(ExprClone*),primary,invalid | expression,invalid_expression, +src/ast/ast_lint.cpp,824,invalid_new_type,can't ascend type which is too big,LintVisitor::preVisit(ExprAscend*),primary,exceeds | type,exceeds_type, +src/ast/ast_lint.cpp,828,invalid_new_type,can't ascend (to heap) type of size 0,LintVisitor::preVisit(ExprAscend*),primary,invalid | type,invalid_type, +src/ast/ast_lint.cpp,835,invalid_new_type,can't new to a type that is too big,LintVisitor::preVisit(ExprNew*),primary,exceeds | type,exceeds_type, +src/ast/ast_lint.cpp,839,invalid_new_type,can't new (to heap) type of size 0,LintVisitor::preVisit(ExprNew*),primary,invalid | type,invalid_type, +src/ast/ast_lint.cpp,846,assert_with_side_effects,assert expressions can't have side-effects (use verify instead),LintVisitor::preVisit(ExprAssert*),primary,invalid | expression,invalid_expression, +src/ast/ast_lint.cpp,860,unsafe_function,unsafe function ,LintVisitor::preVisit(ExprUnsafe*),primary,unsafe | function,unsafe_function, +src/ast/ast_lint.cpp,882,invalid_name,invalid function name ,LintVisitor::preVisit(Function*),primary,invalid | function | name,invalid_function_name, +src/ast/ast_lint.cpp,887,not_all_paths_return_value,not all control paths return value,LintVisitor::preVisit(Function*),primary,missing | function | result,missing_function_result, +src/ast/ast_lint.cpp,899,unsafe_function,implicit argument ,LintVisitor::preVisit(Function*),primary,unsafe | argument,unsafe_argument, +src/ast/ast_lint.cpp,911,annotation_failed,function annotation lint failed,LintVisitor::preVisit(Function*),primary,runtime | function | annotation,runtime_function_annotation, +src/ast/ast_lint.cpp,916,no_init,[init] is disabled in the options or CodeOfPolicies,LintVisitor::preVisit(Function*),primary,cant | function,cant_function, +src/ast/ast_lint.cpp,925,invalid_member_function,class constructor does not call super initializer,LintVisitor::visit(Function*),primary,missing | function | body,missing_function_body, +src/ast/ast_lint.cpp,936,invalid_name,invalid argument variable name ,LintVisitor::preVisitArgument,primary,invalid | argument | name,invalid_argument_name, +src/ast/ast_lint.cpp,941,unused_function_argument,unused function argument ,LintVisitor::preVisitArgument,primary,invalid | function | argument,invalid_function_argument, +src/ast/ast_lint.cpp,947,invalid_variable_type,argument variable is too big,LintVisitor::preVisitArgument,primary,exceeds | argument,exceeds_argument, +src/ast/ast_lint.cpp,956,not_all_paths_return_value,not all control paths of the block return value,LintVisitor::preVisit(ExprBlock*),primary,missing | block | result,missing_block_result, +src/ast/ast_lint.cpp,962,invalid_label,jit blocks can't have finally and goto,LintVisitor::preVisit(ExprBlock*),primary,cant | block,cant_block, +src/ast/ast_lint.cpp,969,invalid_name,invalid block argument variable name ,LintVisitor::preVisitBlockArgument,primary,invalid | argument | name,invalid_argument_name, +src/ast/ast_lint.cpp,974,unused_block_argument,unused block argument ,LintVisitor::preVisitBlockArgument,primary,invalid | block | argument,invalid_block_argument, +src/ast/ast_lint.cpp,980,invalid_variable_type,block argument variable is too big,LintVisitor::preVisitBlockArgument,primary,exceeds | argument,exceeds_argument, +src/ast/ast_lint.cpp,987,unspecified,default arguments of constructors can't be used in make declarations,LintVisitor::preVisit(ExprMakeStruct*),primary,cant | argument | structure,cant_argument_structure,wording: 'its not yet implemented' belongs in fixme or extra; cerr=unspecified should be invalid_argument_type or new +src/ast/ast_lint.cpp,1002,top_level_no_sideeffect_operation,top level no side effect operation ,LintVisitor::preVisitBlockExpression,primary,invalid | expression,invalid_expression, +src/ast/ast_lint.cpp,1018,top_level_no_sideeffect_operation,top level no side effect operation ,LintVisitor::preVisitBlockFinalExpression,primary,invalid | expression,invalid_expression, +src/ast/ast_lint.cpp,1039,table_lookup_collision,potential table lookup collision for ,LintVisitor::preVisit(ExprAt*),primary,invalid | table | expression,invalid_table_expression, +src/ast/ast_lint.cpp,1145,internal_error,internal error: option '' is already defined,Program::lint,internal,internal | options,internal_options, +src/ast/ast_lint.cpp,1154,internal_error,internal error: option '' is already defined,Program::lint,internal,internal | options,internal_options, +src/ast/ast_lint.cpp,1175,invalid_option,invalid option type for '' unexpected '' expecting '',Program::lint,primary,invalid | options,invalid_options, +src/ast/ast_lint.cpp,1181,invalid_option,invalid option '',Program::lint,primary,invalid | options,invalid_options, +src/ast/ast_lint.cpp,1216,internal_error,internal error. leaking alias or expression type,InferLintVisitor::visitExpression,internal,internal | type,internal_type, +src/ast/ast_simulate.cpp,620,missing_node,integration error function failed to simulate,Function::simulate,internal,internal | function | annotation,internal_function_annotation, +src/ast/ast_simulate.cpp,916,,internal compilation error can't generate structure initialization,SimulateVisitor::sv_simulateMakeStruct,internal,internal | structure,internal_structure,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1124,,internal compilation error can't generate array initialization,SimulateVisitor::sv_simulateMakeArray,internal,internal | array,internal_array,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1225,,internal compilation error can't generate array initialization,SimulateVisitor::sv_simulateMakeTuple,internal,internal | tuple,internal_tuple,missing cerr; wording 'array' wrong context (tuple); suggest internal_error +src/ast/ast_simulate.cpp,1252,,internal compilation error calling 'simulate' on reader,SimulateVisitor::visit(ExprReader*),internal,internal | macro,internal_macro,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1260,,internal compilation error calling 'simulate' on label,SimulateVisitor::visit(ExprLabel*),internal,internal | label,internal_label,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1303,,internal compilation error ExprAddr func is null,SimulateVisitor::visit(ExprAddr*),internal,internal | function,internal_function,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1307,,internal compilation error ExprAddr func->index is unused,SimulateVisitor::visit(ExprAddr*),internal,internal | function,internal_function,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1352,,internal compilation error simluateNullCoalescing returned null,SimulateVisitor::visit(ExprNullCoalescing*),internal,internal | expression,internal_expression,"missing cerr; typo: simluate -> simulate; suggest internal_error" +src/ast/ast_simulate.cpp,1445,,internal compilation error generating node for ExprMakeGenerator,SimulateVisitor::visit(ExprMakeGenerator*),internal,internal | generator,internal_generator,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1453,,internal compilation error generating node for ExprYield,SimulateVisitor::visit(ExprYield*),internal,internal | generator,internal_generator,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1461,,internal compilation error generating node for ExprArrayComprehension,SimulateVisitor::visit(ExprArrayComprehension*),internal,internal | array,internal_array,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1505,,internal compilation error invoke method expects field,SimulateVisitor::visit(ExprMakeBlock*),internal,internal | field,internal_field,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1590,,internal compilation error generating erase for non-table type,SimulateVisitor::visit(ExprErase*),internal,internal | table,internal_table,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1613,,internal compilation error generating set insert for non-table type,SimulateVisitor::visit(ExprSetInsert*),internal,internal | table,internal_table,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1636,,internal compilation error generating find for non-table type,SimulateVisitor::visit(ExprFind*),internal,internal | table,internal_table,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1659,,internal compilation error generating find for non-table type,SimulateVisitor::visit(ExprKeyExists*),internal,internal | table,internal_table,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1668,,internal compilation error generating 'is',SimulateVisitor::visit(ExprIs*),internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1683,,internal compilation error generating typeinfo(...),SimulateVisitor::visit(ExprTypeInfo*),internal,internal | macro,internal_macro,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1689,typeinfo_macro_error,typeinfo(...) macro generated no node; ,SimulateVisitor::visit(ExprTypeInfo*),primary,runtime | macro,runtime_macro, +src/ast/ast_simulate.cpp,1719,missing_node,internal compiler error: SimNode_DeleteClassPtr needs size expression,SimulateVisitor::visit(ExprDelete*),internal,internal | expression,internal_expression, +src/ast/ast_simulate.cpp,1739,missing_node,integration error simulateDelete returned null,SimulateVisitor::visit(ExprDelete*),internal,internal | expression,internal_expression, +src/ast/ast_simulate.cpp,1749,missing_node,integration error simulateDelete returned null,SimulateVisitor::visit(ExprDelete*),internal,internal | expression,internal_expression, +src/ast/ast_simulate.cpp,1758,,internal compiler error: generating node for unsupported ExprDelete,SimulateVisitor::visit(ExprDelete*),internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1811,missing_node,integration error simulateGetNew returned null,SimulateVisitor::visit(ExprNew*),internal,internal | expression,internal_expression, +src/ast/ast_simulate.cpp,1819,missing_node,integration error simulateGetNew returned null,SimulateVisitor::visit(ExprNew*),internal,internal | expression,internal_expression, +src/ast/ast_simulate.cpp,1859,missing_node,integration error simulateGetAtR2V returned null,SimulateVisitor::sv_trySimulate_At,internal,internal | expression,internal_expression, +src/ast/ast_simulate.cpp,1865,missing_node,integration error simulateGetAt returned null,SimulateVisitor::sv_trySimulate_At,internal,internal | expression,internal_expression, +src/ast/ast_simulate.cpp,1890,,internal compilation error generating ptr at for unsupported index type ,SimulateVisitor::sv_trySimulate_At,internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1900,,internal compilation error generating ptr at for unsupported index type ,SimulateVisitor::sv_trySimulate_At,internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,1912,index_out_of_range,index out of range of ,SimulateVisitor::sv_trySimulate_At,primary,exceeds | array,exceeds_array, +src/ast/ast_simulate.cpp,1961,,internal compilation error generating vector at for unsupported vector type,SimulateVisitor::visit(ExprAt*),internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,2237,,internal compilation error swizzle field offset of unsupported type,SimulateVisitor::sv_trySimulate_Swizzle,internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,2669,,internal compilation error trying to simulate a tag,SimulateVisitor::visit(ExprTag*),internal,internal | macro,internal_macro,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,2683,,internal compilation error can't generate move,SimulateVisitor::visit(ExprMove*),internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,2705,,internal compilation error can't generate clone,SimulateVisitor::visit(ExprClone*),internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,2720,,internal compilation error can't generate copy,SimulateVisitor::visit(ExprCopy*),internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,2943,,internal error expecting block,SimulateVisitor::sv_simulateBody,internal,internal | block,internal_block,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3052,missing_node,integration error simulateGetIterator returned null,SimulateVisitor::visit(ExprFor*),internal,internal | expression,internal_expression, +src/ast/ast_simulate.cpp,3071,,internal compilation error generating for-with-iterator,SimulateVisitor::visit(ExprFor*),internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3117,,internal compilation error generating for,SimulateVisitor::visit(ExprFor*),internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3154,,internal compilation error generating for,SimulateVisitor::visit(ExprFor*),internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3190,,internal compilation error generating for,SimulateVisitor::visit(ExprFor*),internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3275,,internal compilation error can't generate move,SimulateVisitor::simulateLetInit,internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3286,,internal compilation error can't generate copy,SimulateVisitor::simulateLetInit,internal,internal | expression,internal_expression,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3305,,internal compilation error can't generate class constructor,SimulateVisitor::simulateLetInit,internal,internal | class,internal_class,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3309,,internal compilation error initializing variable which can't be copied or moved,SimulateVisitor::simulateLetInit,internal,internal | variable,internal_variable,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3465,,internal compiler error: global variable mangled name hash collision '',Program::buildGMNLookup,internal,internal | global,internal_global,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3484,,internal compiler error: function mangled name hash collision '',Program::buildMNLookup,internal,internal | function,internal_function,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3503,,internal compiler error: annotation data hash collision ,Program::buildADLookup,internal,internal | annotation,internal_annotation,missing cerr; suggest internal_error +src/ast/ast_simulate.cpp,3572,,keep_alive is not enabled in this build. Modify DAS_ENABLE_KEEPALIVE first,Program::simulate,primary,invalid | options,invalid_options,missing cerr +src/ast/ast_simulate.cpp,3619,,Internal compiler errors. Simulating variable which is not used,Program::simulate,internal,internal | variable,internal_variable,"missing cerr; wording: 'errors.' should be 'error,' and missing space before ; suggest internal_error" +src/ast/ast_simulate.cpp,3643,,Global variables size exceeds ,Program::simulate,primary,exceeds | global,exceeds_global,missing cerr +src/ast/ast_simulate.cpp,3647,,Shared variables size exceeds ,Program::simulate,primary,exceeds | global,exceeds_global,missing cerr +src/ast/ast_simulate.cpp,3653,,Failed to allocate memory for global variables,Program::simulate,primary,runtime | global,runtime_global,missing cerr +src/ast/ast_simulate.cpp,3657,,Failed to allocate memory for shared variables,Program::simulate,primary,runtime | global,runtime_global,missing cerr +src/ast/ast_simulate.cpp,3680,no_init,[init] is disabled in the options or CodeOfPolicies,Program::simulate,internal,internal | function,internal_function,"extra-msg says 'made it all the way to simulate somehow' — this is a should-not-reach lint-bypass invariant, not a primary user-facing error" +src/ast/ast_simulate.cpp,3727,no_init,[init] is disabled in the options or CodeOfPolicies,Program::simulate,internal,internal | global,internal_global,"extra-msg says 'made it all the way to simulate somehow' — should-not-reach invariant, not primary" +src/ast/ast_simulate.cpp,3796,cant_initialize,function annotation simulation failed,Program::simulate,primary,runtime | function | annotation,runtime_function_annotation, +src/ast/ast_simulate.cpp,3913,cant_initialize,exception during init script,Program::simulate,primary,runtime | function,runtime_function, +src/ast/ast_simulate.cpp,3937,,simulate macro :: failed to preSimulate,Program::simulate,primary,runtime | macro,runtime_macro,missing cerr; suggest macro_failed +src/ast/ast_simulate.cpp,3971,,simulate macro :: failed to simulate,Program::simulate,primary,runtime | macro,runtime_macro,missing cerr; suggest macro_failed +src/ast/ast_typedecl.cpp,3785,,expecting '<',MangledNameParser::parseAnyNameInBrackets,internal,internal | name,internal_name,DAS_VERIFY-only; not Program::error +src/ast/ast_typedecl.cpp,3788,,expecting '>',MangledNameParser::parseAnyNameInBrackets,internal,internal | name,internal_name,DAS_VERIFY-only; not Program::error +src/ast/ast_typedecl.cpp,3807,,expecting ']',MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,"DAS_VERIFY-only; typo: missing closing apostrophe in 'expecting '\]'" +src/ast/ast_typedecl.cpp,3817,,expecting '<',MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,3820,,expecting '>',MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,3828,,expecting '<',MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,3831,,expecting '>',MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,3859,,unresolved annotation '',MangledNameParser::parseTypeFromMangledName,internal,internal | annotation,internal_annotation,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,3861,,'' is not a handled type,MangledNameParser::parseTypeFromMangledName,internal,internal | annotation,internal_annotation,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,3874,,unknown structure '',MangledNameParser::parseTypeFromMangledName,internal,internal | structure,internal_structure,"DAS_VERIFY-only; logic-bug: condition is `stt.size()==1` but message says 'unknown' — should be ==0" +src/ast/ast_typedecl.cpp,3885,,expecting ';' or '>',MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,3887,,expecting '>',MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,3901,,expecting '>',MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,3930,,unresolved enumeration '',MangledNameParser::parseTypeFromMangledName,internal,internal | enumeration,internal_enumeration,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,3945,,unsupported mangled name format - expecting fake...,MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,4065,,expecting '-[]',MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,4072,,unsupported mangled name format - expecting remove trait,MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_typedecl.cpp,4107,,unsupported mangled name format symbol,MangledNameParser::parseTypeFromMangledName,internal,internal | type,internal_type,DAS_VERIFY-only +src/ast/ast_validate.cpp,71,unspecified,validate_ast: duplicate TypeDecl (gc_id=) ,ValidateAstVisitor::reportDuplicateTypeDecl,internal,internal | type,internal_type, +src/ast/ast_validate.cpp,82,unspecified,validate_ast: duplicate Expression (gc_id=),ValidateAstVisitor::reportDuplicateExpression,internal,internal | expression,internal_expression, +src/ast/ast_validate.cpp,294,unspecified,validate_ast: TypeDecl (gc_id=) not reached by visitor: ,Program::validateAst,internal,internal | type,internal_type, +src/ast/ast_validate.cpp,302,unspecified,validate_ast: Expression (gc_id=) not reached by visitor: ,Program::validateAst,internal,internal | expression,internal_expression, +src/ast/ast_parse.cpp,777,, not found,parseDaScript,primary,lookup | file,lookup_file, +src/ast/ast_parse.cpp,870,module_does_not_have_a_name,Module is not setup correctly for macros,parseDaScript,primary,missing | module | name,missing_module_name, +src/ast/ast_parse.cpp,975,module_does_not_have_a_name,Module is not setup correctly for AOT,aotModuleHasName,primary,missing | module | name,missing_module_name, +src/ast/ast_parse.cpp,998,module_required_from_shared,Shared module has incorrect dependency type,canShareModule,primary,invalid | module | require,invalid_module_require, +src/ast/ast_parse.cpp,1149,module_not_found,,reportPrerequisitesErrors,primary,lookup | module,lookup_module, +src/ast/ast_parse.cpp,1241,syntax_error,internal error: failed to build builtin.das,compileDaScript,internal,internal | module,internal_module,recategorize: not a syntax error +src/ast/ast_parse.cpp,1249,syntax_error,internal error,compileDaScript,internal,internal | module,internal_module,recategorize: not a syntax error; vague text — name the failing module +src/ast/ast_parse.cpp,1258,module_not_found,Several modules with invalid names,compileDaScript,primary,already_declared | module,already_declared_module,recategorize: collision not lookup +src/ast/ast_parse.cpp,1267,module_not_found,Module '' required for another builtin module,compileDaScript,primary,already_declared | module,already_declared_module,recategorize: collision not lookup +src/parser/ds2_lexer.lpp,89,syntax_error,can't open ,line directive action,primary,lookup | file,lookup_file, +src/parser/ds2_lexer.lpp,97,invalid_line_directive,can't process line directive ,line directive action,primary,invalid | line,invalid_line, +src/parser/ds2_lexer.lpp,101,unexpected_close_comment,Unexpected */,'*/' rule,primary,invalid | line,invalid_line,UNCLASSIFIED:comment subject — propose 'comment' +src/parser/ds2_lexer.lpp,158,comment_contains_eof,end of file encountered inside c-style comment,c_comment EOF,primary,exceeds | file,exceeds_file, +src/parser/ds2_lexer.lpp,162,string_constant_exceeds_file,reader constant exceeds file,reader EOF,primary,exceeds | file,exceeds_file, +src/parser/ds2_lexer.lpp,182,nested_string_constant,nested string constants are not allowed,strb '{' rule,primary,invalid | string,invalid_string,UNCLASSIFIED:string subject +src/parser/ds2_lexer.lpp,191,string_constant_exceeds_file,string constant exceeds file,strb EOF,primary,exceeds | file,exceeds_file, +src/parser/ds2_lexer.lpp,217,string_constant_exceeds_file,string format exceeds file,strfmt EOF,primary,exceeds | file,exceeds_file, +src/parser/ds2_lexer.lpp,244,syntax_error,can't open ,include rule,primary,lookup | file,lookup_file, +src/parser/ds2_lexer.lpp,420,integer_constant_out_of_range,uint64 constant out of range,uint64 literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,431,integer_constant_out_of_range,int64 constant out of range,int64 literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,443,integer_constant_out_of_range,uint8 constant out of range,uint8 literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,455,integer_constant_out_of_range,uint constant out of range,uint literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,466,integer_constant_out_of_range,int constant out of range,int literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,481,integer_constant_out_of_range,int constant out of range,int hex/oct literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,492,integer_constant_out_of_range,uint64 constant out of range,uint64 hex literal,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,503,integer_constant_out_of_range,int64 constant out of range,int64 hex literal,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,516,integer_constant_out_of_range,uint8 constant out of range,uint8 hex literal,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,525,integer_constant_out_of_range,uint constant out of range,uint hex literal,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,537,integer_constant_out_of_range,uint constant out of range,uint hex literal (alt),primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,546,floating_point_constant_out_of_range,float constant out of range,float literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,555,floating_point_constant_out_of_range,float constant out of range,float literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,565,floating_point_constant_out_of_range,float constant out of range,float literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,574,floating_point_constant_out_of_range,float constant out of range,float literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,583,floating_point_constant_out_of_range,double constant out of range,double literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,592,floating_point_constant_out_of_range,double constant out of range,double literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,601,floating_point_constant_out_of_range,double constant out of range,double literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,610,floating_point_constant_out_of_range,double constant out of range,double exp-form literal,primary,exceeds | constant,exceeds_constant, +src/parser/ds2_lexer.lpp,618,mismatching_parentheses,mismatching parentheses,')' rule,primary,mismatching | parens,mismatching_parens, +src/parser/ds2_lexer.lpp,630,mismatching_parentheses,mismatching square braces,']' rule,primary,mismatching | parens,mismatching_parens,recategorize: square braces are not parens; propose mismatching_square_brackets +src/parser/ds2_lexer.lpp,651,mismatching_curly_bracers,mismatching curly braces,'}' rule,primary,mismatching | curly_bracers,mismatching_curly_bracers,wording: 'bracers' -> 'brackets' (also rename enum) +src/parser/ds2_lexer.lpp,809,,mismatching keyword in module ,das2_collect_keywords,primary,mismatching | name | module,mismatching_module_name,UNCLASSIFIED:keyword subject; missing cerr — defaults to unspecified +src/parser/ds2_lexer.lpp,819,,mismatching type function in module ,das2_collect_keywords,primary,mismatching | name | module,mismatching_module_name,UNCLASSIFIED:keyword/type_function subject; missing cerr — defaults to unspecified +src/parser/ds2_parser.ypp,569,syntax_error,module name has to be first declaration,program rule,primary,invalid | module,invalid_module,recategorize: ordering not syntax_error +src/parser/ds2_parser.ypp,628,module_already_has_a_name,this module already has a name ,module_declaration,primary,already_declared | module | name,already_declared_module_name, +src/parser/ds2_parser.ypp,669,invalid_escape_sequence,invalid escape sequence,string_builder_body,primary,invalid | escape,invalid_escape, +src/parser/ds2_parser.ypp,722,unsupported_read_macro,reader macro not found,expr_reader,primary,lookup | macro,lookup_macro, +src/parser/ds2_parser.ypp,729,unsupported_read_macro,too many options for the reader macro ,expr_reader,primary,ambiguous | macro,ambiguous_macro, +src/parser/ds2_parser.ypp,732,syntax_error,expecting ~ after the reader macro,expr_reader,primary,invalid | macro,invalid_macro, +src/parser/ds2_parser.ypp,763,invalid_option,option is not allowed here,options_declaration,primary,invalid | options,invalid_options, +src/parser/ds2_parser.ypp,1161,invalid_annotation,annotation is not found,annotation_declaration_basic,primary,lookup | annotation,lookup_annotation,recategorize: it's a lookup miss not invalid +src/parser/ds2_parser.ypp,1166,invalid_annotation,annotation is not allowed here,annotation_declaration_basic,primary,invalid | annotation,invalid_annotation, +src/parser/ds2_parser.ypp,1179,invalid_annotation,annotation is not found,annotation_declaration_basic (with args),primary,lookup | annotation,lookup_annotation,recategorize: it's a lookup miss not invalid +src/parser/ds2_parser.ypp,1184,invalid_annotation,annotation is not allowed here,annotation_declaration_basic (with args),primary,invalid | annotation,invalid_annotation, +src/parser/ds2_parser.ypp,1199,invalid_annotation,can only run logical operations on contracts,annotation_declaration ('!'),primary,invalid | annotation,invalid_annotation, +src/parser/ds2_parser.ypp,1209,invalid_annotation,can only run logical operations on contracts,annotation_declaration (&&),primary,invalid | annotation,invalid_annotation, +src/parser/ds2_parser.ypp,1214,invalid_annotation,can only run logical operations on contracts,annotation_declaration (&&),primary,invalid | annotation,invalid_annotation, +src/parser/ds2_parser.ypp,1224,invalid_annotation,can only run logical operations on contracts,annotation_declaration (||),primary,invalid | annotation,invalid_annotation, +src/parser/ds2_parser.ypp,1229,invalid_annotation,can only run logical operations on contracts,annotation_declaration (||),primary,invalid | annotation,invalid_annotation, +src/parser/ds2_parser.ypp,1239,invalid_annotation,can only run logical operations on contracts,annotation_declaration (^^),primary,invalid | annotation,invalid_annotation, +src/parser/ds2_parser.ypp,1244,invalid_annotation,can only run logical operations on contracts,annotation_declaration (^^),primary,invalid | annotation,invalid_annotation, +src/parser/ds2_parser.ypp,1440,function_already_declared,function is already defined ,global_function_declaration,primary,already_declared | function,already_declared_function, +src/parser/ds2_parser.ypp,2798,enumeration_value_already_declared,enumeration already declared ,enum_list,primary,already_declared | enumerator,already_declared_enumerator,wording: 'enumeration already declared' -> 'enumeration value already declared' +src/parser/ds2_parser.ypp,2810,enumeration_value_already_declared,enumeration already declared ,enum_list,primary,already_declared | enumerator,already_declared_enumerator,wording: 'enumeration already declared' -> 'enumeration value already declared' +src/parser/ds2_parser.ypp,2841,invalid_type,alias cannot be defined in terms of another alias ,single_alias,primary,invalid | type_alias,invalid_type_alias, +src/parser/ds2_parser.ypp,2846,type_alias_already_declared,type alias is already defined ,single_alias,primary,already_declared | type_alias,already_declared_type_alias, +src/parser/ds2_parser.ypp,3191,invalid_type,only different bits are allowed in a bitfield,bitfield_type_declaration,primary,exceeds | bitfield,exceeds_bitfield,recategorize: it's exceeds not invalid_type +src/parser/ds2_parser.ypp,3240,invalid_type,type declaration can't be used as array base type,type_declaration_no_options,primary,invalid | array | type,invalid_array_type, +src/parser/ds2_parser.ypp,3243,invalid_type,macro can't be used as array base type,type_declaration_no_options,primary,invalid | array | type,invalid_array_type, +src/parser/ds2_parser.ypp,3513,type_alias_already_declared,type alias is already defined ,tuple_alias_declaration,primary,already_declared | type_alias,already_declared_type_alias, +src/parser/ds2_parser.ypp,3552,type_alias_already_declared,type alias is already defined ,variant_alias_declaration,primary,already_declared | type_alias,already_declared_type_alias, +src/parser/ds2_parser.ypp,3594,invalid_type,only different bits are allowed in a bitfield,bitfield_alias_declaration,primary,exceeds | bitfield,exceeds_bitfield,recategorize: it's exceeds not invalid_type +src/parser/ds2_parser.ypp,3603,type_alias_already_declared,type alias is already defined ,bitfield_alias_declaration,primary,already_declared | type_alias,already_declared_type_alias, +src/parser/ds2_parser.ypp,4036,,(dispatcher) das2_yyfatalerror,das2_yyfatalerror,primary,invalid | expression,invalid_expression,UNCLASSIFIED:dispatcher — cerr passed through from caller +src/parser/ds2_parser.ypp,4042,syntax_error,(dispatcher) das2_yyerror default,das2_yyerror,primary,invalid | expression,invalid_expression,UNCLASSIFIED:dispatcher — defaults to syntax_error when caller passes none +src/parser/ds_lexer.lpp,89,syntax_error,can't open ,line directive action,primary,lookup | file,lookup_file, +src/parser/ds_lexer.lpp,97,invalid_line_directive,can't process line directive ,line directive action,primary,invalid | line,invalid_line, +src/parser/ds_lexer.lpp,101,unexpected_close_comment,Unexpected */,'*/' rule (indent),primary,invalid | line,invalid_line,UNCLASSIFIED:comment subject — propose 'comment' +src/parser/ds_lexer.lpp,111,unexpected_close_comment,Unexpected */,'*/' rule (normal),primary,invalid | line,invalid_line,UNCLASSIFIED:comment subject — propose 'comment' +src/parser/ds_lexer.lpp,182,comment_contains_eof,end of file encountered inside c-style comment,c_comment EOF,primary,exceeds | file,exceeds_file, +src/parser/ds_lexer.lpp,186,string_constant_exceeds_file,reader constant exceeds file,reader EOF,primary,exceeds | file,exceeds_file, +src/parser/ds_lexer.lpp,206,nested_string_constant,nested string constants are not allowed,strb '{' rule,primary,invalid | string,invalid_string,UNCLASSIFIED:string subject +src/parser/ds_lexer.lpp,215,string_constant_exceeds_file,string constant exceeds file,strb EOF,primary,exceeds | file,exceeds_file, +src/parser/ds_lexer.lpp,242,string_constant_exceeds_file,string format exceeds file,strfmt EOF,primary,exceeds | file,exceeds_file, +src/parser/ds_lexer.lpp,297,syntax_error,invalid indentation,indent rule,primary,invalid | line,invalid_line,UNCLASSIFIED:indentation subject; missing cerr — defaults to syntax_error +src/parser/ds_lexer.lpp,304,syntax_error,invalid indentation,indent rule,primary,invalid | line,invalid_line,UNCLASSIFIED:indentation subject; missing cerr — defaults to syntax_error +src/parser/ds_lexer.lpp,365,syntax_error,can't open ,include rule,primary,lookup | file,lookup_file, +src/parser/ds_lexer.lpp,553,integer_constant_out_of_range,uint64 constant out of range,uint64 literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,564,integer_constant_out_of_range,int64 constant out of range,int64 literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,576,integer_constant_out_of_range,uint8 constant out of range,uint8 literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,588,integer_constant_out_of_range,uint constant out of range,uint literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,599,integer_constant_out_of_range,int constant out of range,int literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,614,integer_constant_out_of_range,int constant out of range,int hex/oct literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,625,integer_constant_out_of_range,uint64 constant out of range,uint64 hex literal,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,636,integer_constant_out_of_range,int64 constant out of range,int64 hex literal,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,649,integer_constant_out_of_range,uint8 constant out of range,uint8 hex literal,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,658,integer_constant_out_of_range,uint constant out of range,uint hex literal,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,670,integer_constant_out_of_range,uint constant out of range,uint hex literal (alt),primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,679,floating_point_constant_out_of_range,float constant out of range,float literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,688,floating_point_constant_out_of_range,float constant out of range,float literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,698,floating_point_constant_out_of_range,float constant out of range,float literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,707,floating_point_constant_out_of_range,float constant out of range,float literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,716,floating_point_constant_out_of_range,double constant out of range,double literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,725,floating_point_constant_out_of_range,double constant out of range,double literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,734,floating_point_constant_out_of_range,double constant out of range,double literal rule,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,743,floating_point_constant_out_of_range,double constant out of range,double exp-form literal,primary,exceeds | constant,exceeds_constant, +src/parser/ds_lexer.lpp,751,mismatching_parentheses,mismatching parentheses,')' rule,primary,mismatching | parens,mismatching_parens, +src/parser/ds_lexer.lpp,763,mismatching_parentheses,mismatching square braces,']' rule,primary,mismatching | parens,mismatching_parens,recategorize: square braces are not parens; propose mismatching_square_brackets +src/parser/ds_lexer.lpp,784,mismatching_curly_bracers,mismatching curly braces,'}' rule,primary,mismatching | curly_bracers,mismatching_curly_bracers,wording: 'bracers' -> 'brackets' (also rename enum) +src/parser/ds_lexer.lpp,989,mismatching_parentheses,mismatching curly braces,SEMICOLON_CUR_CUR rule,primary,mismatching | curly_bracers,mismatching_curly_bracers,recategorize: text says curly but cerr is mismatching_parentheses +src/parser/ds_lexer.lpp,1005,mismatching_parentheses,mismatching curly braces,SEMICOLON_CUR_SQR rule,primary,mismatching | curly_bracers,mismatching_curly_bracers,recategorize: text says curly but cerr is mismatching_parentheses +src/parser/ds_lexer.lpp,1009,mismatching_parentheses,mismatching square braces,SEMICOLON_CUR_SQR rule,primary,mismatching | parens,mismatching_parens,recategorize: square braces; propose mismatching_square_brackets +src/parser/ds_lexer.lpp,1026,mismatching_parentheses,mismatching curly braces,COMMA_CUR_SQR rule,primary,mismatching | curly_bracers,mismatching_curly_bracers,recategorize: text says curly but cerr is mismatching_parentheses +src/parser/ds_lexer.lpp,1030,mismatching_parentheses,mismatching square braces,COMMA_CUR_SQR rule,primary,mismatching | parens,mismatching_parens,recategorize: square braces; propose mismatching_square_brackets +src/parser/ds_lexer.lpp,1047,mismatching_parentheses,mismatching square braces,SEMICOLON_SQR_SQR rule,primary,mismatching | parens,mismatching_parens,recategorize: square braces; propose mismatching_square_brackets +src/parser/ds_lexer.lpp,1064,mismatching_parentheses,mismatching square braces,COMMA_SQR_SQR rule,primary,mismatching | parens,mismatching_parens,recategorize: square braces; propose mismatching_square_brackets +src/parser/ds_lexer.lpp,1171,,mismatching keyword in module ,das_collect_keywords,primary,mismatching | name | module,mismatching_module_name,UNCLASSIFIED:keyword subject; missing cerr — defaults to unspecified +src/parser/ds_lexer.lpp,1181,,mismatching type function in module ,das_collect_keywords,primary,mismatching | name | module,mismatching_module_name,UNCLASSIFIED:keyword/type_function subject; missing cerr — defaults to unspecified +src/parser/ds_parser.ypp,572,syntax_error,module name has to be first declaration,program rule,primary,invalid | module,invalid_module,recategorize: ordering not syntax_error +src/parser/ds_parser.ypp,621,module_already_has_a_name,this module already has a name ,module_declaration,primary,already_declared | module | name,already_declared_module_name, +src/parser/ds_parser.ypp,662,invalid_escape_sequence,invalid escape sequence,string_builder_body,primary,invalid | escape,invalid_escape, +src/parser/ds_parser.ypp,715,unsupported_read_macro,reader macro not found,expr_reader,primary,lookup | macro,lookup_macro, +src/parser/ds_parser.ypp,722,unsupported_read_macro,too many options for the reader macro ,expr_reader,primary,ambiguous | macro,ambiguous_macro, +src/parser/ds_parser.ypp,725,syntax_error,expecting ~ after the reader macro,expr_reader,primary,invalid | macro,invalid_macro, +src/parser/ds_parser.ypp,768,invalid_option,option is not allowed here,options_declaration,primary,invalid | options,invalid_options, +src/parser/ds_parser.ypp,1043,invalid_annotation,annotation is not found,annotation_declaration_basic,primary,lookup | annotation,lookup_annotation,recategorize: it's a lookup miss not invalid +src/parser/ds_parser.ypp,1047,invalid_annotation,annotation is not allowed here,annotation_declaration_basic,primary,invalid | annotation,invalid_annotation, +src/parser/ds_parser.ypp,1060,invalid_annotation,annotation is not found,annotation_declaration_basic (with args),primary,lookup | annotation,lookup_annotation,recategorize: it's a lookup miss not invalid +src/parser/ds_parser.ypp,1064,invalid_annotation,annotation is not allowed here,annotation_declaration_basic (with args),primary,invalid | annotation,invalid_annotation, +src/parser/ds_parser.ypp,1079,invalid_annotation,can only run logical operations on contracts,annotation_declaration ('!'),primary,invalid | annotation,invalid_annotation, +src/parser/ds_parser.ypp,1089,invalid_annotation,can only run logical operations on contracts,annotation_declaration (&&),primary,invalid | annotation,invalid_annotation, +src/parser/ds_parser.ypp,1094,invalid_annotation,can only run logical operations on contracts,annotation_declaration (&&),primary,invalid | annotation,invalid_annotation, +src/parser/ds_parser.ypp,1104,invalid_annotation,can only run logical operations on contracts,annotation_declaration (||),primary,invalid | annotation,invalid_annotation, +src/parser/ds_parser.ypp,1109,invalid_annotation,can only run logical operations on contracts,annotation_declaration (||),primary,invalid | annotation,invalid_annotation, +src/parser/ds_parser.ypp,1119,invalid_annotation,can only run logical operations on contracts,annotation_declaration (^^),primary,invalid | annotation,invalid_annotation, +src/parser/ds_parser.ypp,1124,invalid_annotation,can only run logical operations on contracts,annotation_declaration (^^),primary,invalid | annotation,invalid_annotation, +src/parser/ds_parser.ypp,1307,function_already_declared,function is already defined ,global_function_declaration,primary,already_declared | function,already_declared_function, +src/parser/ds_parser.ypp,1507,cant_pipe,can't pipe into [[ make structure ]]. it already has where closure,'<|' rule,primary,cant | expression,cant_expression,UNCLASSIFIED:pipe subject; wording: drop '[[ ]]' once gen2 is canonical +src/parser/ds_parser.ypp,1515,cant_pipe,can only pipe into function call or [[ make structure ]],'<|' rule,primary,cant | expression,cant_expression,UNCLASSIFIED:pipe subject; wording: drop '[[ ]]' once gen2 is canonical +src/parser/ds_parser.ypp,2466,syntax_error,structure field or class method annotation expected to remain on the same line,struct_variable_declaration,primary,invalid | annotation,invalid_annotation,recategorize: not syntax_error +src/parser/ds_parser.ypp,2778,enumeration_value_already_declared,enumeration already declared ,enum_list,primary,already_declared | enumerator,already_declared_enumerator,wording: 'enumeration already declared' -> 'enumeration value already declared' +src/parser/ds_parser.ypp,2793,enumeration_value_already_declared,enumeration value already declared ,enum_list,primary,already_declared | enumerator,already_declared_enumerator, +src/parser/ds_parser.ypp,2825,invalid_type,alias cannot be defined in terms of another alias ,single_alias,primary,invalid | type_alias,invalid_type_alias, +src/parser/ds_parser.ypp,2830,type_alias_already_declared,type alias is already defined ,single_alias,primary,already_declared | type_alias,already_declared_type_alias, +src/parser/ds_parser.ypp,3151,invalid_type,only different bits are allowed in a bitfield,bitfield_type_declaration,primary,exceeds | bitfield,exceeds_bitfield,recategorize: it's exceeds not invalid_type +src/parser/ds_parser.ypp,3193,invalid_type,type declaration can't be used as array base type,type_declaration_no_options,primary,invalid | array | type,invalid_array_type, +src/parser/ds_parser.ypp,3196,invalid_type,macro can't be used as array base type,type_declaration_no_options,primary,invalid | array | type,invalid_array_type, +src/parser/ds_parser.ypp,3442,type_alias_already_declared,type alias is already defined ,tuple_alias_declaration,primary,already_declared | type_alias,already_declared_type_alias, +src/parser/ds_parser.ypp,3478,type_alias_already_declared,type alias is already defined ,variant_alias_declaration,primary,already_declared | type_alias,already_declared_type_alias, +src/parser/ds_parser.ypp,3517,invalid_type,only different bits are allowed in a bitfield,bitfield_alias_declaration,primary,exceeds | bitfield,exceeds_bitfield,recategorize: it's exceeds not invalid_type +src/parser/ds_parser.ypp,3526,type_alias_already_declared,type alias is already defined ,bitfield_alias_declaration,primary,already_declared | type_alias,already_declared_type_alias, +src/parser/ds_parser.ypp,4098,,(dispatcher) das_yyfatalerror,das_yyfatalerror,primary,invalid | expression,invalid_expression,UNCLASSIFIED:dispatcher — cerr passed through from caller +src/parser/ds_parser.ypp,4104,syntax_error,(dispatcher) das_yyerror default,das_yyerror,primary,invalid | expression,invalid_expression,UNCLASSIFIED:dispatcher — defaults to syntax_error when caller passes none +src/parser/parser_impl.cpp,18,,(dispatcher) das2_yyerror -> g_Program->error,das2_yyerror,primary,invalid | expression,invalid_expression,UNCLASSIFIED:dispatcher — passes cerr through +src/parser/parser_impl.cpp,22,,(dispatcher) das_yyerror -> g_Program->error,das_yyerror,primary,invalid | expression,invalid_expression,UNCLASSIFIED:dispatcher — passes cerr through +src/parser/parser_impl.cpp,27,invalid_name,names starting with __ are reserved ,das_checkName,primary,invalid | name,invalid_name, +src/parser/parser_impl.cpp,123,cant_initialize,can't have default values in a type declaration,varDeclToTypeDecl,primary,cant | type,cant_type,UNCLASSIFIED:type-decl-default subject +src/parser/parser_impl.cpp,129,invalid_aka,type declaration can't have an aka,varDeclToTypeDecl,primary,invalid | type | aka,invalid_type_aka,UNCLASSIFIED:aka modifier +src/parser/parser_impl.cpp,157,annotation_not_found,annotation not found,findAnnotation,primary,lookup | annotation,lookup_annotation, +src/parser/parser_impl.cpp,161,annotation_not_found,too many options for annotation ,findAnnotation,primary,ambiguous | annotation,ambiguous_annotation,recategorize: ambiguous not lookup +src/parser/parser_impl.cpp,179,invalid_annotation,macro [] failed to apply to a function ,runFunctionAnnotations,primary,runtime | annotation,runtime_annotation, +src/parser/parser_impl.cpp,189,invalid_annotation, is not a function macro,runFunctionAnnotations,primary,invalid | annotation,invalid_annotation, +src/parser/parser_impl.cpp,213,invalid_aka,array comprehension can't have an aka,ast_arrayComprehension,primary,invalid | aka,invalid_aka,UNCLASSIFIED:aka subject +src/parser/parser_impl.cpp,244,invalid_override,can't derive from a sealed class or structure ,ast_structureName,primary,cant | structure | sealed,cant_structure_sealed,recategorize: sealed-derive not override +src/parser/parser_impl.cpp,252,structure_not_found,parent structure not found ,ast_structureName,primary,lookup | structure,lookup_structure, +src/parser/parser_impl.cpp,256,structure_not_found,too many options for ,ast_structureName,primary,ambiguous | structure,ambiguous_structure,recategorize: ambiguous not lookup +src/parser/parser_impl.cpp,266,structure_already_declared,structure is already defined ,ast_structureName,primary,already_declared | structure,already_declared_structure, +src/parser/parser_impl.cpp,279,invalid_type,alias is already defined ,ast_structureAlias,primary,already_declared | type_alias,already_declared_type_alias,recategorize: already-declared not invalid_type +src/parser/parser_impl.cpp,288,invalid_type,typedef outside of structure,ast_structureAlias,primary,invalid | type_alias,invalid_type_alias, +src/parser/parser_impl.cpp,294,invalid_type,alias is already defined ,ast_structureAlias,primary,already_declared | type_alias,already_declared_type_alias,recategorize: already-declared not invalid_type +src/parser/parser_impl.cpp,310,invalid_override,class can only derive from a class,ast_structureDeclaration,primary,invalid | class,invalid_class,recategorize: derive-mismatch not override +src/parser/parser_impl.cpp,313,invalid_override,structure can only derive from a structure,ast_structureDeclaration,primary,invalid | structure,invalid_structure,recategorize: derive-mismatch not override +src/parser/parser_impl.cpp,324,function_already_declared,built-in finalizer is already defined ,ast_structureDeclaration,internal,internal | function,internal_function, +src/parser/parser_impl.cpp,344,invalid_static,static member can't be sealed or override ,ast_structureDeclaration,primary,invalid | field | static,invalid_field_static, +src/parser/parser_impl.cpp,348,invalid_static,static member can't have an annotation ,ast_structureDeclaration,primary,invalid | field | static,invalid_field_static, +src/parser/parser_impl.cpp,354,invalid_override,structure field is not overriding anything ,ast_structureDeclaration,primary,invalid | field | override,invalid_field_override, +src/parser/parser_impl.cpp,376,invalid_static,static variable already exists ,ast_structureDeclaration,primary,already_declared | global,already_declared_global,recategorize: already-declared not invalid_static +src/parser/parser_impl.cpp,393,invalid_static,static structure field is already declared ,ast_structureDeclaration,primary,already_declared | field | static,already_declared_field_static,recategorize: already-declared not invalid_static +src/parser/parser_impl.cpp,398,invalid_override,structure field is sealed,ast_structureDeclaration,primary,invalid | field | sealed,invalid_field_sealed, +src/parser/parser_impl.cpp,414,invalid_override,structure field is already declared ,ast_structureDeclaration,primary,already_declared | field,already_declared_field,recategorize: already-declared not invalid_override +src/parser/parser_impl.cpp,447,invalid_annotation,macro [] failed to apply to the structure ,ast_structureDeclaration,primary,runtime | annotation,runtime_annotation, +src/parser/parser_impl.cpp,452,invalid_annotation,structures are only allowed one structure macro,ast_structureDeclaration,primary,invalid | annotation,invalid_annotation, +src/parser/parser_impl.cpp,457,structure_already_declared,handled structure is already defined ,ast_structureDeclaration,primary,already_declared | structure,already_declared_structure, +src/parser/parser_impl.cpp,483,enumeration_already_declared,enumeration is already defined ,ast_addEmptyEnum,primary,already_declared | enumeration,already_declared_enumeration, +src/parser/parser_impl.cpp,505,invalid_annotation,macro [] failed to finalize the enumeration ,ast_enumDeclaration,primary,runtime | annotation,runtime_annotation, +src/parser/parser_impl.cpp,524,invalid_aka,global variable can't have an aka,ast_globalLetList,primary,invalid | global | aka,invalid_global_aka,UNCLASSIFIED:aka modifier +src/parser/parser_impl.cpp,550,global_variable_already_declared,global variable is already declared ,ast_globalLetList,primary,already_declared | global,already_declared_global, +src/parser/parser_impl.cpp,568,global_variable_already_declared,global bitfield constant is already declared ,ast_globalBitfieldConst,primary,already_declared | global | bitfield,already_declared_global_bitfield, +src/parser/parser_impl.cpp,582,invalid_aka,global variable can't have an aka,ast_globalLet,primary,invalid | global | aka,invalid_global_aka,UNCLASSIFIED:aka modifier +src/parser/parser_impl.cpp,614,global_variable_already_declared,global variable is already declared ,ast_globalLet,primary,already_declared | global,already_declared_global, +src/parser/parser_impl.cpp,629,invalid_member_function,structure can't have a member function,ast_structVarDefAbstract,primary,invalid | function,invalid_function, +src/parser/parser_impl.cpp,632,invalid_member_function,generic function can't be a member of a class ,ast_structVarDefAbstract,primary,invalid | function,invalid_function, +src/parser/parser_impl.cpp,635,invalid_member_function,initializers and finalizers can't be abstract ,ast_structVarDefAbstract,primary,invalid | function,invalid_function, +src/parser/parser_impl.cpp,638,invalid_member_function,abstract functions can't have annotations ,ast_structVarDefAbstract,primary,invalid | function | annotation,invalid_function_annotation, +src/parser/parser_impl.cpp,642,invalid_member_function,abstract functions must specify return type explicitly ,ast_structVarDefAbstract,primary,missing | function | result,missing_function_result,recategorize: missing-return-type not invalid_member_function +src/parser/parser_impl.cpp,645,invalid_member_function,abstract functions can't be operators ,ast_structVarDefAbstract,primary,invalid | function,invalid_function, +src/parser/parser_impl.cpp,687,invalid_type,generic function argument of type has matching options and ,implAddGenericFunction,primary,ambiguous | function | argument | type,ambiguous_function_argument_type,recategorize: ambiguous not invalid_type +src/parser/parser_impl.cpp,694,function_already_declared,generic function is already defined ,implAddGenericFunction,primary,already_declared | function,already_declared_function, +src/parser/parser_impl.cpp,707,invalid_member_function,internal error or invalid macro. member function declared outside of a class,ast_structVarDef,internal,internal | function,internal_function,recategorize: internal not invalid_member_function +src/parser/parser_impl.cpp,710,invalid_member_function,structure can't have a member function,ast_structVarDef,primary,invalid | function,invalid_function, +src/parser/parser_impl.cpp,713,invalid_member_function,generic function can't be a member of a class ,ast_structVarDef,primary,invalid | function,invalid_function, +src/parser/parser_impl.cpp,717,invalid_member_function,can't override an operator ,ast_structVarDef,primary,invalid | function | override,invalid_function_override, +src/parser/parser_impl.cpp,731,function_already_declared,function is already defined ,ast_structVarDef,primary,already_declared | function,already_declared_function, +src/parser/parser_impl.cpp,771,invalid_member_function,can't override an initializer or a finalizer ,ast_structVarDef,primary,invalid | function | override,invalid_function_override, +src/parser/parser_impl.cpp,775,invalid_member_function,can't have a constant initializer or a finalizer ,ast_structVarDef,primary,invalid | function,invalid_function, +src/parser/parser_impl.cpp,781,invalid_member_function,finalizer can't be static ,ast_structVarDef,primary,invalid | function | static,invalid_function_static, +src/parser/parser_impl.cpp,791,function_already_declared,intializer is already defined ,ast_structVarDef,primary,already_declared | function,already_declared_function,wording: typo 'intializer' -> 'initializer' +src/parser/parser_impl.cpp,811,function_already_declared,function is already defined ,ast_structVarDef,primary,already_declared | function,already_declared_function, +src/parser/parser_impl.cpp,829,type_not_found,too many options for the ,ast_NameName,primary,ambiguous | enumeration,ambiguous_enumeration,recategorize: ambiguous not lookup +src/parser/parser_impl.cpp,832,type_not_found,enumeration or bitfield not found ,ast_NameName,primary,lookup | enumeration,lookup_enumeration, +src/parser/parser_impl.cpp,850,bitfield_not_found,enumeration or bitfield not found ,ast_NameName,primary,lookup | bitfield,lookup_bitfield, +src/parser/parser_impl.cpp,854,syntax_error,expecting enumeration or bitfield ,ast_NameName,primary,invalid | type,invalid_type,recategorize: kind-mismatch not syntax_error +src/parser/parser_impl.cpp,910,argument_already_declared,block argument is already declared ,ast_makeBlock,primary,already_declared | argument | block,already_declared_block_argument, +src/parser/parser_impl.cpp,922,invalid_capture,can only have capture section for the lambda,ast_makeBlock,primary,invalid | capture,invalid_capture, +src/parser/parser_impl.cpp,933,invalid_annotation,macro [] failed to apply to the block,ast_makeBlock,primary,runtime | annotation,runtime_annotation, +src/parser/parser_impl.cpp,937,invalid_annotation,blocks are only allowed function macros,ast_makeBlock,primary,invalid | annotation,invalid_annotation, +src/parser/parser_impl.cpp,985,local_variable_already_declared,local variable is already declared ,ast_Let,primary,already_declared | local,already_declared_local, +src/parser/parser_impl.cpp,1034,local_variable_already_declared,local variable is already declared ,ast_LetList,primary,already_declared | local,already_declared_local, +src/parser/parser_impl.cpp,1078,argument_already_declared,function argument is already declared ,ast_functionDeclarationHeader,primary,already_declared | function | argument,already_declared_function_argument, +src/parser/parser_impl.cpp,1110,module_not_found,module alias already used as ,ast_requireModule,primary,already_declared | module,already_declared_module,recategorize: alias-conflict not lookup +src/parser/parser_impl.cpp,1119,module_not_found,required module not found ,ast_requireModule,primary,lookup | module,lookup_module, +src/parser/parser_impl.cpp,1180,cant_pipe,can't pipe into make . it already has where closure,ast_lpipe,primary,cant | expression,cant_expression,UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp,1183,cant_pipe,can't pipe into make struct. it already has where closure,ast_lpipe,primary,cant | expression,cant_expression,UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp,1188,cant_pipe,can't pipe into make struct. argument must be a block,ast_lpipe,primary,cant | expression,cant_expression,UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp,1195,cant_pipe,can't pipe into make struct. block must have exactly one argument,ast_lpipe,primary,cant | expression,cant_expression,UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp,1204,cant_pipe,can only pipe into function call or make type,ast_lpipe,primary,cant | expression,cant_expression,UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp,1235,cant_pipe,can only rpipe into a function call,ast_rpipe,primary,cant | expression,cant_expression,UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp,1289,syntax_error,unknown capture mode ,ast_makeCaptureEntry,primary,invalid | capture,invalid_capture,recategorize: not syntax_error +src/builtin/module_builtin_ast.cpp,352,macro_failed, | macro error,ast_error,primary,runtime | macro,runtime_macro, +src/builtin/module_builtin_ast.cpp,357,performance_lint, | performance warning,ast_performance_warning,primary,runtime | macro,runtime_macro_performance,UNCLASSIFIED:performance_lint is a lint-warning facet not in taxonomy; needs `lint` facet or dedicated `performance` tag +src/builtin/module_builtin_ast.cpp,362,style_lint, | style warning,ast_style_warning,primary,runtime | macro,runtime_macro_style,UNCLASSIFIED:style_lint is a lint-warning facet not in taxonomy; needs `lint` facet or dedicated `style` tag +src/builtin/module_builtin_ast_adapters.cpp,24,exception_during_macro,macro caused exception during ,runMacroFunction,primary,runtime | macro,runtime_macro_exception, +src/builtin/module_builtin_math.cpp,257,index_out_of_range,matrix index out of range,MatrixAnnotation::trySimulate,primary,exceeds | array,exceeds_array_index, +src/builtin/module_builtin_runtime.cpp,188,,make_function_unsafe can only be used inside a function,MakeFunctionUnsafeCallMacro::visit,primary,invalid | macro,invalid_macro_context,UNCLASSIFIED:no current_cerr; site needs an enum value (likely `unsupported_call_macro` or new `invalid_macro_context`) +src/simulate/bin_serializer.cpp,40,,binary data too short,BinDataSerialize::read,primary,exceeds | runtime,exceeds_runtime_buffer,UNCLASSIFIED:runtime guard via DataWalker::error; no compile-time enum; subject `buffer` not in taxonomy +src/simulate/bin_serializer.cpp,76,,binary data type mismatch,BinDataSerialize::verify,primary,mismatching | type | runtime,mismatching_runtime_type,UNCLASSIFIED:runtime guard; runtime-mismatch facet not modeled +src/simulate/bin_serializer.cpp,89,,binary data type mismatch,BinDataSerialize::verify_hash,primary,mismatching | type | runtime,mismatching_runtime_type_hash,UNCLASSIFIED:runtime guard; runtime-mismatch facet not modeled +src/simulate/bin_serializer.cpp,122,,binary serialization of tables is not supported,BinDataSerialize::beforeTable,primary,cant | table,cant_serialize_table,UNCLASSIFIED:runtime guard via DataWalker::error; verb `serialize` not modeled in taxonomy +src/simulate/bin_serializer.cpp,125,,binary serialization of pointers is not supported,BinDataSerialize::beforePtr,primary,cant,cant_serialize_pointer,UNCLASSIFIED:subject `pointer` not in taxonomy; runtime guard +src/simulate/bin_serializer.cpp,250,,binary serialization of null pointers is not supported,BinDataSerialize::Null,primary,cant,cant_serialize_null_pointer,UNCLASSIFIED:subject `pointer` not in taxonomy; runtime guard +src/simulate/bin_serializer.cpp,253,,binary serialization of void pointers is not supported,BinDataSerialize::VoidPtr,primary,cant,cant_serialize_void_pointer,UNCLASSIFIED:subject `pointer` not in taxonomy; runtime guard +src/simulate/bin_serializer.cpp,256,,binary serialization of iterators is not supported,BinDataSerialize::beforeIterator,primary,cant,cant_serialize_iterator,UNCLASSIFIED:subject `iterator` not in taxonomy; runtime guard +src/simulate/bin_serializer.cpp,259,,binary serialization of blocks is not supported,BinDataSerialize::WalkBlock,primary,cant | block,cant_serialize_block,UNCLASSIFIED:runtime guard; verb `serialize` not modeled +src/simulate/hash.cpp,56,,"HASH, not expecting iterator",HashDataWalker::beforeIterator,primary,cant,cant_hash_iterator,UNCLASSIFIED:subject `iterator` not in taxonomy; runtime guard +src/simulate/hash.cpp,57,,"HASH, not expecting block",HashDataWalker::WalkBlock,primary,cant | block,cant_hash_block,UNCLASSIFIED:runtime guard; verb `hash` not modeled +src/simulate/hash.cpp,58,,"HASH, not expecting context",HashDataWalker::FakeContext,primary,cant,cant_hash_context,UNCLASSIFIED:subject `context` not in taxonomy; runtime guard diff --git a/doc/internal/error_audit_design.md b/doc/internal/error_audit_design.md new file mode 100644 index 0000000000..41ff277842 --- /dev/null +++ b/doc/internal/error_audit_design.md @@ -0,0 +1,190 @@ +# daslang error-code refactor — audit synthesis & design + +This document is the design output of Phase B of the error-reporting refactor. +It is **a working document**, not user-facing documentation. Source of truth +during implementation; can be moved to a permanent design-docs location once +the work lands, or removed if not useful. + +## Source artifacts + +All produced by the audit pipeline at `D:/daslang-error-audit/`: + +| Artifact | Role | +|---|---| +| `D:/daslang-error-audit/taxonomy.md` | The shared facet/subject/modifier vocabulary used by audit agents | +| `D:/daslang-error-audit/synth_design.py` | Reads `error_audit.csv`, produces the design artifacts below | +| `D:/daslang-error-audit/design/new_enum_draft.h` | Drafted replacement for `compilation_errors.h` (561 entries) | +| `D:/daslang-error-audit/design/uniques.tsv` | Each new enum name + its site count + the old cerrs that mapped into it | +| `D:/daslang-error-audit/design/legacy_map.tsv` | Per-site: file, line, old cerr, new name, new num — input to retag/sweep | +| `D:/daslang-error-audit/design/verbose_gate.tsv` | 89 sites that should be wrapped in `if (verbose)` | +| `D:/daslang-error-audit/design/recategorize.tsv` | 62 sites whose cerr semantics change (not just rename) | +| `D:/daslang-error-audit/design/wording.tsv` | Wording fixes (typos, missing spaces, vague phrasing) | +| `doc/internal/error_audit.csv` | The consolidated audit (1116 rows, 1 per error site) — checked in | + +## What was audited + +Every `error(...)` call site in: +- `src/ast/*.cpp` (semantic, infer, lint, validate, simulate, derive_alias, export, const_folding, annotations, typedecl) +- `src/parser/*.ypp`, `*.lpp`, `parser_impl.cpp` (lexer/parser sources only — generated `.cpp` skipped) +- `src/builtin/*.cpp`, `src/simulate/*.cpp` + +**Total: 1116 sites across 32 source files.** + +Six parallel Explore-style agents performed the inventory; each wrote a CSV +slice; slices consolidated into `doc/internal/error_audit.csv` with columns: +`file, line, current_cerr, message_template, context_function, classification, +tag_composition, proposed_enum_name, wording_change`. + +## Decisions locked with Boris + +| Topic | Decision | +|---|---| +| Storage | Flat `enum class CompilationError` — unchanged shape | +| Naming | Tag-composition discipline: `_[_]` | +| Migration scope | Bundle everything in one PR — retag + wording + recategorize + verbose-plumbing + dedup helper + 111-test sweep + fix the 5 pre-existing under-specified `expect` lines | +| Renaming policy | Rename `*_not_found` → `lookup_*` for prefix consistency. Other agent-proposed names kept as-is (after mild collapse of trailing modifier suffixes). | +| Granularity | Mild collapse: 1116 sites → 561 unique codes (was 632 before collapse). Modifier suffixes like `_void`, `_ref`, `_const`, `_value` are dropped from cerr names; the info stays in the message text. | +| Follow-on / internal granularity | Fine-grained per subject. `not_resolved_yet_` for each subject (38 codes); `internal__` for each (42 codes). | +| Numbering | Loose ranges: 1xxxx lex / 2xxxx parse / 3xxxx semantic / 4xxxx logic / 5xxxx integration. Inside a stage, cluster by leading facet (within-stage offset = `(facet_idx % 90 + 1) * 100`). New codes go next-available within the cluster. | +| Verbose flag | Reuse existing `InferTypes::verbose` ([include/daScript/ast/ast_infer_type.h:30](../../include/daScript/ast/ast_infer_type.h#L30)) — no new user-facing flag. Plumb through 89 emit sites identified by audit. | +| Taxonomy expansion | Accept 11 new tags surfaced by the audit: 8 subjects (`string, comment, indentation, runtime, iterator, pointer, buffer, context`) + 3 facets (`runtime, performance_lint, style_lint`). Reject narrow parser-only tags (`aka, pipe, keyword, dispatcher`). | + +## The naming discipline + +``` +_[_][_] +``` + +| Slot | Source | Examples | +|---|---|---| +| facet | what kind of fault | `invalid`, `lookup`, `cant`, `missing`, `mismatching`, `exceeds`, `ambiguous`, `already_declared`, `not_resolved_yet`, `internal`, `unsafe`, `recursion`, `runtime` | +| subject | what construct | `type`, `function`, `argument`, `result`, `structure`, `field`, `variable`, `array`, `table`, `tuple`, `variant`, `enumeration`, `enumerator`, `expression`, `module`, `annotation`, ... (full list in `taxonomy.md`) | +| modifier | rare; only when needed | (mostly stripped during normalization — they live in message text, not the cerr) | + +Composition order: facet first, then subject(s) general → specific. So +`function | argument | type | invalid` becomes `invalid_function_argument_type`. +Multi-word facets (`not_resolved_yet`, `already_declared`) are matched as a +single facet token. + +**Future contributors:** when adding a new error site, derive the cerr from the +tag composition. If the composed name doesn't yet exist in +`compilation_errors.h`, add it. + +## The new enum — facet sizes + +| Stage | Facet | Count | Notes | +|---|---|---|---| +| 1xxxx (lex) | invalid | 2 | line, string | +| | mismatching | 3 | curly_bracers, parens, module_name | +| | exceeds | 2 | constant ranges, file boundary | +| 2xxxx (parse) | invalid | ~30 | grammar-rule rejections | +| | missing | 1 | module_name | +| | exceeds | 1 | bitfield | +| | already_declared | ~10 | parser-detected name collisions | +| 3xxxx (semantic) | invalid | 213 | the bulk — type/argument/field/etc faults | +| | cant | 62 | `cant_` family — operations forbidden in context | +| | lookup | 46 | `*_not_found` renamed to `lookup_*` | +| | unsafe | 37 | unsafe-required operations | +| | not_resolved_yet | 37 | follow-on cascade family (verbose-gated) | +| | missing | 22 | required-but-absent (return paths, init, etc.) | +| | already_declared | 12 | name collisions | +| | exceeds | 16 | counts/sizes/ranges | +| | ambiguous | 17 | multi-candidate resolution | +| | mismatching | 15 | two things expected to match don't | +| | recursion | 7 | unbounded/forbidden recursion | +| 4xxxx (logic) | (lint) | small | performance_lint, style_lint families | +| 5xxxx (integration) | internal | 42 | validate-AST stubs, DAS_VERIFY, "should not happen" sites | +| | runtime | 14 | DataWalker/hash/serializer compile-time-eval errors | + +**Total: 561 distinct codes** + 1 `unspecified = 0`. + +Full enum draft: `D:/daslang-error-audit/design/new_enum_draft.h`. To copy into +`include/daScript/ast/compilation_errors.h` in Phase C. + +## Transition by phase + +### Phase C — Apply enum + emit-site retags + wording fixes + +1. Replace `include/daScript/ast/compilation_errors.h` body with `new_enum_draft.h` content (preserve `#pragma once` + namespace + `unspecified = 0` line). +2. For each site in `legacy_map.tsv`, edit the `error(...)` call to pass the new cerr value. The TSV is per-site `(file, line, new_name)` — straight mechanical retag. +3. For each site in `wording.tsv` (~22 sites), apply the wording fix inline. Examples: + - `subexpresion → subexpression` (×2: ast_infer_type_helper.cpp:966, 969) + - `strcut → struct` (ast_infer_type_function.cpp:1162) + - `cant't → can't` (ast_infer_type.cpp:4126) + - `intializer → initializer` (parser_impl.cpp:791) + - `simluateNullCoalescing → simulateNullCoalescing` (ast_simulate.cpp:1352) + - missing space at ast_infer_type.cpp:312 (`can't` → ` can't`) + - duplicate emit at ast_infer_type.cpp:1617/1620 — drop the second + - inverted logic at ast_simulate.cpp:3874 (`stt.size()==1` triggers "unknown structure" — should be `>1`) + - 7 sites in `ds_lexer.lpp` saying "curly braces"/"square braces" but tagged `mismatching_parens` — retag accordingly +4. Update consumer files (only matters if they reference enum names by-symbol; none currently observed but check during edit): + - `utils/daScript/main.cpp` + - `utils/daslang-live/main.cpp` + - `utils/dasFormatter/` + - `include/daScript/simulate/runtime_string.h` (the `reportError` formatter — unchanged behavior) +5. `include/daScript/ast/ast_infer_type.h:5` declares CompilationError values used in inference; verify still resolve. +6. Regenerate parsers (CMake handles `.ypp`/`.lpp` automatically when sources touched). + +Worker plan: split Phase C across 4-6 subagents by file group, mirroring the inventory-agent split. Each agent reads `legacy_map.tsv`, filters by its files, applies edits via Edit tool. **No hand-tuning** — the TSV is the source of truth. + +### Phase D — Plumb `verbose` through 89 emit sites + +`verbose_gate.tsv` lists every site classified `mid_inference` or `follow_on`. +89 rows. For each: + +```cpp +if (verbose) { + error(...); +} +``` + +`verbose` is `false` on intermediate infer passes (no work, no emit) and +`true` on the final failure-explanation pass via `reportingInferErrors`. Match +the style of the ~25 existing `if (verbose)` sites in `ast_infer_type.cpp` +(e.g. lines 1011, 3712, 4135). + +### Phase E — `Program::deduplicateErrors()` + +See plan file `C:/Users/Boris/.claude/plans/look-at-wip-das-and-synchronous-quill.md` "Phase E" — implementation per the four-rule algorithm. The `not_resolved_yet_*` family is identified by the facet prefix; Rule 4 drops all of them when ANY non-not_resolved_yet, non-unspecified code exists. + +### Phase F.1 — Test sweep + +`D:/daslang-error-audit/regen_expect.py` already validated baseline (106/111 match, 5 pre-existing under-specified `expect` lines logged at `D:/daslang-error-audit/expect_report.tsv`). + +After Phase C-E land: +1. Re-run `regen_expect.py` — every test will now mismatch. +2. Run with `--write` to apply the new emitted codes in-place. +3. Manual review of sample (~20 files) confirms correctness. +4. Fix the 5 pre-existing under-specifications (`cant_get_field.das`, `failed_aliasing.das`, `failed_call_depth.das`, `failed_condition_must_be_bool.das`, `failed_const_ref.das`) — full multiset, not subset. + +### Phase F.2 — Final verify + +1. `examples/wip.das` — exactly one error. +2. Full test suite green: `daslang.exe dastest/dastest.das -- --test tests`. +3. AOT suite green: `test_aot.exe -use-aot dastest/dastest.das -- --use-aot --test tests`. +4. MCP smoke: `compile_check` on `daslib/`, `tutorials/`, `D:\DASPKG\*\*.das`. +5. Negative test: a `.das` emitting only `not_resolved_yet_*` errors prints them all (Rule 4 doesn't fire when no primary). +6. Performance: time `dastest -- --test tests` before/after; expect small (<5%) speedup on tests that fail compile (verbose-plumbing avoids the work on intermediate passes). + +## Open notes / followups + +1. **Recategorization scope.** The 62 `recategorize` sites change cerr semantics, not just names. Most consequential clusters in the audit: + - 12 shadowing sites in ast_infer_type.cpp (L3298…L4901) marked `variable_not_found` → `already_declared_variable` + - 4 "returning … requires unsafe" sites carrying `invalid_return_type` → `unsafe_function_result` + - 3 call-depth sites carrying `too_many_infer_passes` → `exceeds_call_depth` + - 8 lookup-style codes reused for ambiguous-multi-match → `ambiguous_` family + - Per-site detail in `recategorize.tsv`. + +2. **Duplicate emit at ast_infer_type.cpp:1617/1620.** Audit flagged identical message emitted twice in adjacent lines. Drop the second during Phase C wording sweep. + +3. **`mismatching_parens` mislabel cluster** (7 sites in ds_lexer.lpp at L989, 1005, 1009, 1026, 1030, 1047, 1064) — message says "curly braces" or "square braces" but cerr is `mismatching_parens`. Retag during Phase C using `mismatching_curly_bracers` (existing) or new `mismatching_square_brackets`. + +4. **Inverted logic at ast_simulate.cpp:3874.** Audit flagged: `stt.size()==1` triggers "unknown structure" but should be `>1`. This is a *bug fix*, not an audit change. Apply alongside wording sweep but call it out in the PR description as such. + +5. **Sites with empty `current_cerr` (default unspecified).** ~120 sites total. After Phase C every site has a cerr; the `unspecified` code becomes a fallback for runtime-emitted errors only. + +6. **Tests with `expect` headers under-specified pre-refactor.** `dastest` accepts subset matches today, hiding the under-spec. Phase F.1 explicitly tightens these 5 to full multiset matches. + +7. **Parser-side `expect` directive.** Stays numeric (`expect 30305:3`). No syntax change. The 111-test sweep handles renumbering. + +8. **Backwards compatibility for code that reads `CompilationError::xxx` by-symbol.** All four consumer files (`utils/daScript/main.cpp`, `utils/daslang-live/main.cpp`, `utils/dasFormatter/`, `runtime_string.h`) currently flow numeric codes through; no symbol references observed. Re-verify during Phase C. diff --git a/doc/internal/error_audit_legacy_map.tsv b/doc/internal/error_audit_legacy_map.tsv new file mode 100644 index 0000000000..12e328ecb0 --- /dev/null +++ b/doc/internal/error_audit_legacy_map.tsv @@ -0,0 +1,1117 @@ +file line old_cerr new_name new_num classification wording_change +src/ast/ast_infer_type.cpp 79 invalid_type recursion_type_alias 31106 primary +src/ast/ast_infer_type.cpp 85 invalid_type internal_type_alias 50638 internal +src/ast/ast_infer_type.cpp 91 invalid_type not_resolved_yet_type_alias 31331 follow_on +src/ast/ast_infer_type.cpp 155 not_resolved_yet_enumerator 31311 follow_on current cerr unspecified - should be not_resolved_yet_enumerator +src/ast/ast_infer_type.cpp 167 not_resolved_yet_enumerator 31311 follow_on current cerr unspecified - should be not_resolved_yet_enumerator +src/ast/ast_infer_type.cpp 170 invalid_enumeration invalid_enumerator_type 30149 primary +src/ast/ast_infer_type.cpp 177 invalid_enumeration invalid_enumerator 30147 primary +src/ast/ast_infer_type.cpp 218 cant_infer_missing_initializer missing_structure_field 30320 primary +src/ast/ast_infer_type.cpp 255 not_resolved_yet_structure_field 31326 follow_on current cerr unspecified - should be not_resolved_yet_structure_field; vague: clarify what is not resolved +src/ast/ast_infer_type.cpp 265 invalid_structure_field_type lookup_structure_field_type 30826 primary +src/ast/ast_infer_type.cpp 272 invalid_structure_field_type invalid_structure_field_type 30237 primary +src/ast/ast_infer_type.cpp 286 invalid_structure_field_type invalid_structure_field_type 30237 primary +src/ast/ast_infer_type.cpp 289 invalid_structure_field_type invalid_structure_field_type 30237 primary +src/ast/ast_infer_type.cpp 295 unsafe unsafe_structure_field 31030 primary +src/ast/ast_infer_type.cpp 305 invalid_initialization_type cant_structure_field 30947 primary +src/ast/ast_infer_type.cpp 312 invalid_initialization_type invalid_structure_field_init 30236 wording_fix typo: missing space, 'can't' -> ' can't' +src/ast/ast_infer_type.cpp 315 cant_move cant_structure_field 30947 primary +src/ast/ast_infer_type.cpp 360 invalid_type recursion_structure 31105 primary +src/ast/ast_infer_type.cpp 370 unsafe unsafe_global 31014 primary +src/ast/ast_infer_type.cpp 375 no_global_variables invalid_global_options 30176 primary +src/ast/ast_infer_type.cpp 379 cant_infer_missing_initializer missing_global_init 30312 primary +src/ast/ast_infer_type.cpp 387 invalid_type lookup_global_type 30817 primary +src/ast/ast_infer_type.cpp 403 cant_infer_mismatching_restrictions invalid_global_init_type 30175 primary +src/ast/ast_infer_type.cpp 420 invalid_initialization_type invalid_global_init_type 30175 primary +src/ast/ast_infer_type.cpp 423 invalid_initialization_type invalid_global_init_type 30175 primary +src/ast/ast_infer_type.cpp 426 cant_move cant_global 30930 primary +src/ast/ast_infer_type.cpp 429 cant_copy cant_global 30930 primary +src/ast/ast_infer_type.cpp 436 cant_move cant_global 30930 primary +src/ast/ast_infer_type.cpp 467 no_init invalid_global_init_options 30174 primary +src/ast/ast_infer_type.cpp 480 invalid_variable_type invalid_global_type 30179 primary +src/ast/ast_infer_type.cpp 483 invalid_variable_type invalid_global_type 30179 primary +src/ast/ast_infer_type.cpp 486 invalid_variable_type invalid_global_type 30179 primary +src/ast/ast_infer_type.cpp 489 invalid_variable_type invalid_global_shared 30178 primary +src/ast/ast_infer_type.cpp 492 invalid_variable_type missing_global_shared_init 30313 primary +src/ast/ast_infer_type.cpp 496 invalid_variable_type invalid_global_type_shared 30180 primary +src/ast/ast_infer_type.cpp 501 unsafe unsafe_global_pointer 31015 primary +src/ast/ast_infer_type.cpp 505 invalid_variable_type missing_global_init 30312 primary +src/ast/ast_infer_type.cpp 543 too_many_arguments exceeds_function_argument 30505 primary +src/ast/ast_infer_type.cpp 547 no_init invalid_function_options 30164 primary +src/ast/ast_infer_type.cpp 558 type_not_found lookup_function_argument_type 30812 primary +src/ast/ast_infer_type.cpp 563 invalid_type invalid_function_argument_type 30161 primary +src/ast/ast_infer_type.cpp 570 cant_infer_generic already_declared_function 30702 recategorize recategorize: cant_infer_generic - actually a name collision; should be already_declared_function +src/ast/ast_infer_type.cpp 585 cant_infer_generic invalid_function_argument_type 30161 primary +src/ast/ast_infer_type.cpp 596 invalid_type invalid_function_argument_type 30161 primary +src/ast/ast_infer_type.cpp 600 invalid_type invalid_function_argument_type 30161 primary +src/ast/ast_infer_type.cpp 607 cant_infer_generic not_resolved_yet_function 31313 primary +src/ast/ast_infer_type.cpp 620 expecting_return_value missing_function_result 30310 primary +src/ast/ast_infer_type.cpp 633 type_not_found lookup_function_result_type 30814 primary +src/ast/ast_infer_type.cpp 639 invalid_return_type invalid_function_result_type 30167 primary +src/ast/ast_infer_type.cpp 658 invalid_return_type invalid_function_result_type 30167 primary +src/ast/ast_infer_type.cpp 677 unspecified internal_function_changed 50611 internal current cerr unspecified - should be internal_function_changed +src/ast/ast_infer_type.cpp 783 invalid_enumeration not_resolved_yet_enumerator 31311 follow_on +src/ast/ast_infer_type.cpp 843 type_not_found not_resolved_yet_label_type 31319 follow_on +src/ast/ast_infer_type.cpp 848 invalid_label invalid_label_type 30194 primary +src/ast/ast_infer_type.cpp 871 invalid_label lookup_label 30819 primary +src/ast/ast_infer_type.cpp 885 unsupported_read_macro invalid_macro_read 30204 primary +src/ast/ast_infer_type.cpp 893 invalid_label already_declared_label 30703 primary +src/ast/ast_infer_type.cpp 936 invalid_type cant_dereference 30921 recategorize recategorize: invalid_type - actually a deref fault; should be cant_dereference +src/ast/ast_infer_type.cpp 940 invalid_type cant_dereference 30921 recategorize recategorize: invalid_type - should be cant_dereference +src/ast/ast_infer_type.cpp 961 type_not_found lookup_function_address_type 30811 primary +src/ast/ast_infer_type.cpp 967 type_not_found lookup_function_type 30815 primary +src/ast/ast_infer_type.cpp 977 type_not_found invalid_function_type 30168 recategorize recategorize: type_not_found - actually wrong-type fault; should be invalid_function_type +src/ast/ast_infer_type.cpp 997 function_not_found cant_address_template_function 30903 recategorize recategorize: function_not_found - actually a forbidden-op; should be cant_address_template_function +src/ast/ast_infer_type.cpp 1007 function_not_found lookup_function 30810 primary +src/ast/ast_infer_type.cpp 1012 function_not_found lookup_function 30810 mid_inference +src/ast/ast_infer_type.cpp 1036 type_not_found cant_address_function 30902 recategorize recategorize: type_not_found - actually forbidden; should be cant_address_builtin_function +src/ast/ast_infer_type.cpp 1054 type_not_found not_resolved_yet_dereference_type 31310 follow_on +src/ast/ast_infer_type.cpp 1059 cant_dereference cant_dereference 30921 primary +src/ast/ast_infer_type.cpp 1062 cant_dereference cant_dereference 30921 primary +src/ast/ast_infer_type.cpp 1078 cant_dereference cant_take_pointer 30948 primary +src/ast/ast_infer_type.cpp 1099 unsafe unsafe_address 31000 primary +src/ast/ast_infer_type.cpp 1153 type_not_found not_resolved_yet_null_coalescing_type 31324 follow_on +src/ast/ast_infer_type.cpp 1159 cant_dereference cant_dereference 30921 primary +src/ast/ast_infer_type.cpp 1162 cant_dereference cant_dereference 30921 primary +src/ast/ast_infer_type.cpp 1165 cant_dereference invalid_null_coalescing_type 30215 recategorize recategorize: cant_dereference - actually type-mismatch; should be invalid_null_coalescing_type +src/ast/ast_infer_type.cpp 1168 cant_dereference invalid_null_coalescing_type 30215 recategorize recategorize: cant_dereference - actually type-mismatch +src/ast/ast_infer_type.cpp 1192 invalid_argument_count invalid_static_assert_argument_count 30226 primary +src/ast/ast_infer_type.cpp 1199 type_not_found not_resolved_yet_argument_type 31300 follow_on +src/ast/ast_infer_type.cpp 1204 invalid_argument_type invalid_static_assert_condition_type 30228 primary +src/ast/ast_infer_type.cpp 1207 invalid_argument_type invalid_static_assert_comment_type 30227 primary +src/ast/ast_infer_type.cpp 1233 concept_failed concept_failed 31400 mid_inference +src/ast/ast_infer_type.cpp 1239 static_assert_failed static_assert_failed 31403 mid_inference +src/ast/ast_infer_type.cpp 1260 invalid_argument_count invalid_assert_argument_count 30116 primary +src/ast/ast_infer_type.cpp 1267 type_not_found not_resolved_yet_argument_type 31300 follow_on +src/ast/ast_infer_type.cpp 1272 invalid_argument_type invalid_assert_condition_type 30118 primary +src/ast/ast_infer_type.cpp 1275 invalid_argument_type invalid_assert_comment_type 30117 primary +src/ast/ast_infer_type.cpp 1283 invalid_argument_count invalid_quote_argument_count 30219 primary +src/ast/ast_infer_type.cpp 1306 invalid_argument_count invalid_debug_argument_count 30141 primary +src/ast/ast_infer_type.cpp 1312 invalid_argument_type invalid_debug_comment_type 30142 primary +src/ast/ast_infer_type.cpp 1325 invalid_argument_count invalid_memzero_argument_count 30208 primary +src/ast/ast_infer_type.cpp 1332 invalid_argument_type invalid_memzero_argument_type 30209 primary +src/ast/ast_infer_type.cpp 1335 invalid_argument_type invalid_memzero_argument 30207 primary +src/ast/ast_infer_type.cpp 1357 function_not_found ambiguous_call_macro 30602 primary +src/ast/ast_infer_type.cpp 1433 function_not_found ambiguous_super_call 30610 mid_inference +src/ast/ast_infer_type.cpp 1440 function_not_found lookup_super_method 30830 primary +src/ast/ast_infer_type.cpp 1444 function_not_found invalid_super_call 30245 primary +src/ast/ast_infer_type.cpp 1450 function_not_found not_resolved_yet_method_call 31322 follow_on +src/ast/ast_infer_type.cpp 1580 invalid_argument_count recursion_function_argument 31103 primary +src/ast/ast_infer_type.cpp 1601 invalid_argument_count not_resolved_yet_function 31313 follow_on +src/ast/ast_infer_type.cpp 1605 invalid_argument_count invalid_invoke_argument_type 30187 primary +src/ast/ast_infer_type.cpp 1617 invalid_argument_count invalid_invoke_target_type 30189 primary +src/ast/ast_infer_type.cpp 1620 invalid_argument_count invalid_invoke_target_type 30189 wording_fix duplicate error call - line 1617 already emitted same error; remove duplicate +src/ast/ast_infer_type.cpp 1624 invalid_argument_count lookup_method 30822 primary +src/ast/ast_infer_type.cpp 1628 invalid_argument_count invalid_invoke_method_syntax 30188 primary +src/ast/ast_infer_type.cpp 1632 invalid_argument_count not_resolved_yet_class_type 31307 follow_on +src/ast/ast_infer_type.cpp 1636 invalid_argument_count invalid_invoke_method_syntax 30188 primary +src/ast/ast_infer_type.cpp 1640 invalid_argument_count invalid_invoke_argument_count 30186 primary +src/ast/ast_infer_type.cpp 1659 invalid_argument_count invalid_invoke_argument_count 30186 primary +src/ast/ast_infer_type.cpp 1667 invalid_argument_type not_resolved_yet_invoke_argument_type 31317 follow_on +src/ast/ast_infer_type.cpp 1672 invalid_argument_type not_resolved_yet_invoke_argument_type 31317 follow_on +src/ast/ast_infer_type.cpp 1687 invalid_argument_type invalid_invoke_target_type 30189 primary +src/ast/ast_infer_type.cpp 1692 invalid_argument_count invalid_invoke_argument_count 30186 primary +src/ast/ast_infer_type.cpp 1702 invalid_argument_type not_resolved_yet_invoke_argument_type 31317 follow_on +src/ast/ast_infer_type.cpp 1709 invalid_argument_type invalid_invoke_argument_type 30187 primary +src/ast/ast_infer_type.cpp 1752 invalid_argument_count invalid_insert_argument_count 30185 primary +src/ast/ast_infer_type.cpp 1761 type_not_found not_resolved_yet_argument_type 31300 follow_on +src/ast/ast_infer_type.cpp 1767 invalid_argument_type invalid_table_key_type 30252 primary +src/ast/ast_infer_type.cpp 1771 invalid_argument_type invalid_table_argument_type 30249 primary +src/ast/ast_infer_type.cpp 1784 invalid_argument_count invalid_erase_argument_count 30150 primary +src/ast/ast_infer_type.cpp 1793 type_not_found not_resolved_yet_argument_type 31300 follow_on +src/ast/ast_infer_type.cpp 1799 invalid_argument_type invalid_table_key_type 30252 primary +src/ast/ast_infer_type.cpp 1803 invalid_argument_type invalid_table_argument_type 30249 primary +src/ast/ast_infer_type.cpp 1816 invalid_argument_count invalid_find_argument_count 30156 primary +src/ast/ast_infer_type.cpp 1825 type_not_found not_resolved_yet_argument_type 31300 follow_on +src/ast/ast_infer_type.cpp 1831 invalid_argument_type invalid_table_key_type 30252 primary +src/ast/ast_infer_type.cpp 1836 invalid_argument_type invalid_table_argument_type 30249 primary +src/ast/ast_infer_type.cpp 1850 invalid_argument_count invalid_key_exists_argument_count 30193 primary +src/ast/ast_infer_type.cpp 1859 type_not_found not_resolved_yet_argument_type 31300 follow_on +src/ast/ast_infer_type.cpp 1865 invalid_argument_type invalid_table_key_type 30252 primary +src/ast/ast_infer_type.cpp 1869 invalid_argument_type invalid_table_argument_type 30249 primary +src/ast/ast_infer_type.cpp 1884 type_not_found not_resolved_yet_is_expression_type 31318 follow_on +src/ast/ast_infer_type.cpp 1896 type_not_found not_resolved_yet_is_expression_type 31318 follow_on +src/ast/ast_infer_type.cpp 1907 type_not_found lookup_is_expression_type 30818 primary +src/ast/ast_infer_type.cpp 1913 typeinfo_auto invalid_is_expression 30191 primary +src/ast/ast_infer_type.cpp 1918 type_not_found not_resolved_yet_is_expression_type 31318 follow_on +src/ast/ast_infer_type.cpp 1942 type_not_found lookup_type 30832 primary +src/ast/ast_infer_type.cpp 1948 type_not_found not_resolved_yet_type 31330 follow_on +src/ast/ast_infer_type.cpp 1976 type_not_found not_resolved_yet_typeinfo 31332 follow_on +src/ast/ast_infer_type.cpp 1989 type_not_found lookup_typeinfo_type 30837 primary +src/ast/ast_infer_type.cpp 1995 typeinfo_auto invalid_typeinfo 30265 primary +src/ast/ast_infer_type.cpp 2000 type_not_found not_resolved_yet_typeinfo 31332 follow_on +src/ast/ast_infer_type.cpp 2011 invalid_type not_resolved_yet_typeinfo_sizeof 31336 follow_on +src/ast/ast_infer_type.cpp 2016 invalid_type exceeds_typeinfo_sizeof 30514 primary +src/ast/ast_infer_type.cpp 2026 invalid_type not_resolved_yet_typeinfo_alignof 31333 follow_on +src/ast/ast_infer_type.cpp 2037 type_not_found not_resolved_yet_typeinfo_dim 31334 follow_on +src/ast/ast_infer_type.cpp 2045 typeinfo_dim invalid_typeinfo_dim 30268 primary +src/ast/ast_infer_type.cpp 2050 type_not_found invalid_typeinfo_dim_table_type 30270 recategorize recategorize: type_not_found - actually wrong-type fault +src/ast/ast_infer_type.cpp 2055 type_not_found invalid_typeinfo_dim_table_type 30270 recategorize recategorize: type_not_found - actually wrong-type fault +src/ast/ast_infer_type.cpp 2060 type_not_found not_resolved_yet_typeinfo_dim_table 31335 follow_on +src/ast/ast_infer_type.cpp 2068 typeinfo_dim invalid_typeinfo_dim_table 30269 primary +src/ast/ast_infer_type.cpp 2078 invalid_type invalid_typeinfo_variant_index_type 30281 primary +src/ast/ast_infer_type.cpp 2090 typeinfo_undefined lookup_variant_field 30839 primary +src/ast/ast_infer_type.cpp 2096 typeinfo_undefined missing_typeinfo_subexpression 30321 primary +src/ast/ast_infer_type.cpp 2102 typeinfo_undefined lookup_function_mangled_name 30813 primary +src/ast/ast_infer_type.cpp 2109 typeinfo_undefined invalid_typeinfo_mangled_subexpression 30273 primary +src/ast/ast_infer_type.cpp 2115 typeinfo_undefined missing_typeinfo_subexpression 30321 primary +src/ast/ast_infer_type.cpp 2153 typeinfo_undefined invalid_typeinfo_struct_name 30280 primary +src/ast/ast_infer_type.cpp 2162 typeinfo_undefined invalid_typeinfo_struct_modulename 30279 primary +src/ast/ast_infer_type.cpp 2332 typeinfo_undefined invalid_typeinfo_has_field_type 30272 primary +src/ast/ast_infer_type.cpp 2346 typeinfo_undefined invalid_typeinfo_struct_has_annotation_type 30278 primary +src/ast/ast_infer_type.cpp 2358 typeinfo_undefined lookup_typeinfo_annotation 30833 primary +src/ast/ast_infer_type.cpp 2371 typeinfo_undefined invalid_typeinfo_struct_has_annotation_argument_type 30277 primary +src/ast/ast_infer_type.cpp 2381 typeinfo_undefined lookup_typeinfo_annotation 30833 primary +src/ast/ast_infer_type.cpp 2387 typeinfo_undefined lookup_typeinfo_annotation_argument 30834 primary +src/ast/ast_infer_type.cpp 2403 typeinfo_undefined invalid_typeinfo_annotation_argument_type 30267 primary +src/ast/ast_infer_type.cpp 2409 typeinfo_undefined invalid_typeinfo_struct_get_annotation_argument_type 30276 primary +src/ast/ast_infer_type.cpp 2420 typeinfo_undefined lookup_typeinfo_offsetof_type 30836 primary +src/ast/ast_infer_type.cpp 2424 typeinfo_undefined invalid_typeinfo_offsetof_type 30275 primary +src/ast/ast_infer_type.cpp 2429 typeinfo_undefined missing_typeinfo_subexpression 30321 primary +src/ast/ast_infer_type.cpp 2438 typeinfo_undefined invalid_typeinfo_function 30271 primary +src/ast/ast_infer_type.cpp 2445 typeinfo_undefined invalid_typeinfo_mangled_subexpression 30273 primary +src/ast/ast_infer_type.cpp 2451 typeinfo_undefined missing_typeinfo_subexpression 30321 primary +src/ast/ast_infer_type.cpp 2460 typeinfo_undefined invalid_typeinfo_module_subexpression 30274 primary +src/ast/ast_infer_type.cpp 2469 typeinfo_undefined invalid_typeinfo_annotation 30266 primary +src/ast/ast_infer_type.cpp 2478 typeinfo_undefined ambiguous_typeinfo_macro 30614 primary +src/ast/ast_infer_type.cpp 2481 typeinfo_undefined lookup_typeinfo_macro 30835 primary +src/ast/ast_infer_type.cpp 2491 typeinfo_macro_error runtime_typeinfo_macro 31211 primary +src/ast/ast_infer_type.cpp 2502 typeinfo_macro_error runtime_typeinfo_macro 31211 primary +src/ast/ast_infer_type.cpp 2505 typeinfo_macro_error internal_typeinfo_macro 50639 internal +src/ast/ast_infer_type.cpp 2527 bad_delete cant_delete_super 30920 primary +src/ast/ast_infer_type.cpp 2533 bad_delete invalid_delete_super_self_type 30144 primary +src/ast/ast_infer_type.cpp 2540 bad_delete lookup_super_class 30827 primary +src/ast/ast_infer_type.cpp 2576 bad_delete lookup_super_finalizer 30829 primary +src/ast/ast_infer_type.cpp 2607 type_not_found not_resolved_yet_delete_size_type 31309 follow_on +src/ast/ast_infer_type.cpp 2612 bad_delete invalid_delete_size_type 30143 primary +src/ast/ast_infer_type.cpp 2618 unsafe unsafe_delete 31009 primary +src/ast/ast_infer_type.cpp 2624 bad_delete cant_delete 30917 primary +src/ast/ast_infer_type.cpp 2627 bad_delete cant_delete 30917 primary +src/ast/ast_infer_type.cpp 2630 bad_delete cant_delete 30917 primary +src/ast/ast_infer_type.cpp 2634 unsafe unsafe_delete_pointer 31010 primary +src/ast/ast_infer_type.cpp 2638 bad_delete cant_delete_smart_pointer 30919 primary +src/ast/ast_infer_type.cpp 2655 function_already_declared ambiguous_finalizer 30606 mid_inference +src/ast/ast_infer_type.cpp 2739 type_not_found lookup_cast_type 30805 primary +src/ast/ast_infer_type.cpp 2745 type_not_found lookup_cast_type 30805 primary +src/ast/ast_infer_type.cpp 2770 unsafe unsafe_cast 31004 primary +src/ast/ast_infer_type.cpp 2777 type_not_found invalid_cast_type 30133 recategorize recategorize: type_not_found - actually a cast-mismatch +src/ast/ast_infer_type.cpp 2794 invalid_new_type cant_ascend 30909 primary +src/ast/ast_infer_type.cpp 2799 invalid_new_type invalid_ascend_array_handle_type 30114 primary +src/ast/ast_infer_type.cpp 2803 invalid_new_type invalid_ascend_handle_type 30115 primary +src/ast/ast_infer_type.cpp 2823 too_many_arguments exceeds_new_argument 30509 primary +src/ast/ast_infer_type.cpp 2833 invalid_argument_type invalid_function_argument_type_block 30162 primary +src/ast/ast_infer_type.cpp 2852 type_not_found not_resolved_yet_new_type 31323 follow_on +src/ast/ast_infer_type.cpp 2868 type_not_found lookup_new_type 30823 primary +src/ast/ast_infer_type.cpp 2876 invalid_new_type invalid_new_type 30214 primary +src/ast/ast_infer_type.cpp 2880 invalid_new_type invalid_new_class_syntax 30211 primary +src/ast/ast_infer_type.cpp 2897 invalid_new_type invalid_new_type 30214 primary +src/ast/ast_infer_type.cpp 2902 invalid_new_type invalid_new_type 30214 primary +src/ast/ast_infer_type.cpp 2913 invalid_new_type invalid_new_type 30214 primary +src/ast/ast_infer_type.cpp 2923 invalid_new_type invalid_new_type 30214 primary +src/ast/ast_infer_type.cpp 2927 invalid_new_type invalid_new_initializer_type 30213 primary +src/ast/ast_infer_type.cpp 2943 invalid_new_type invalid_new_initializer_result_type 30212 primary +src/ast/ast_infer_type.cpp 2956 invalid_new_type missing_new_default_initializer 30318 primary +src/ast/ast_infer_type.cpp 2992 type_not_found not_resolved_yet_index_type 31316 follow_on +src/ast/ast_infer_type.cpp 2998 invalid_index_type invalid_table_index_type 30251 primary +src/ast/ast_infer_type.cpp 3003 invalid_table_type cant_index_table 30934 recategorize recategorize: invalid_table_type - cant operation; should be cant_index_const_table +src/ast/ast_infer_type.cpp 3008 invalid_index_type cant_index_key 30932 primary +src/ast/ast_infer_type.cpp 3013 invalid_index_type cant_index_table 30934 primary +src/ast/ast_infer_type.cpp 3018 unsafe unsafe_table_index 31033 primary +src/ast/ast_infer_type.cpp 3026 invalid_index_type invalid_handle_index_type 30181 primary +src/ast/ast_infer_type.cpp 3034 unsafe unsafe_pointer_index 31023 primary +src/ast/ast_infer_type.cpp 3038 invalid_index_type invalid_index_type 30184 primary +src/ast/ast_infer_type.cpp 3042 invalid_index_type cant_index_pointer 30933 primary +src/ast/ast_infer_type.cpp 3061 invalid_index_type invalid_index_type 30184 primary +src/ast/ast_infer_type.cpp 3073 cant_index cant_index 30931 primary +src/ast/ast_infer_type.cpp 3077 cant_index not_resolved_yet_array_dimension 31301 follow_on +src/ast/ast_infer_type.cpp 3108 type_not_found not_resolved_yet_index_type 31316 follow_on +src/ast/ast_infer_type.cpp 3114 cant_index cant_index_pointer 30933 primary +src/ast/ast_infer_type.cpp 3121 unsafe unsafe_table_safe_index 31034 primary +src/ast/ast_infer_type.cpp 3125 invalid_index_type invalid_table_safe_index_type 30253 primary +src/ast/ast_infer_type.cpp 3135 invalid_index_type invalid_handle_safe_index_type 30182 primary +src/ast/ast_infer_type.cpp 3145 invalid_index_type invalid_index_type 30184 primary +src/ast/ast_infer_type.cpp 3154 unsafe unsafe_array_safe_index 31002 primary +src/ast/ast_infer_type.cpp 3162 cant_index not_resolved_yet_array_dimension 31301 follow_on +src/ast/ast_infer_type.cpp 3179 invalid_index_type invalid_index_type 30184 primary +src/ast/ast_infer_type.cpp 3184 unsafe unsafe_pointer_safe_index 31024 primary +src/ast/ast_infer_type.cpp 3193 unsafe unsafe_array_safe_index 31002 primary +src/ast/ast_infer_type.cpp 3197 invalid_index_type invalid_index_type 30184 primary +src/ast/ast_infer_type.cpp 3207 unsafe unsafe_table_safe_index 31034 primary +src/ast/ast_infer_type.cpp 3212 invalid_index_type invalid_table_safe_index_type 30253 primary +src/ast/ast_infer_type.cpp 3217 invalid_index_type cant_safe_index_table 30946 primary +src/ast/ast_infer_type.cpp 3226 unsafe unsafe_fixed_array_safe_index 31011 primary +src/ast/ast_infer_type.cpp 3230 invalid_index_type invalid_index_type 30184 primary +src/ast/ast_infer_type.cpp 3236 cant_index not_resolved_yet_array_dimension 31301 follow_on +src/ast/ast_infer_type.cpp 3248 invalid_index_type invalid_index_type 30184 primary +src/ast/ast_infer_type.cpp 3257 cant_index cant_safe_index 30945 primary +src/ast/ast_infer_type.cpp 3274 malformed_ast internal_block_missing_return_type 50604 internal +src/ast/ast_infer_type.cpp 3288 return_or_break_in_finally invalid_block_finally 30127 primary +src/ast/ast_infer_type.cpp 3298 variable_not_found already_declared_block_argument 30701 recategorize recategorize: variable_not_found - shadowing not lookup miss; should be already_declared_block_argument +src/ast/ast_infer_type.cpp 3308 variable_not_found already_declared_block_argument 30701 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 3315 variable_not_found already_declared_block_argument 30701 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 3321 variable_not_found already_declared_block_argument 30701 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 3331 type_not_found lookup_block_argument_type 30803 primary +src/ast/ast_infer_type.cpp 3336 cant_infer_missing_initializer missing_block_argument_init 30303 primary +src/ast/ast_infer_type.cpp 3345 invalid_type invalid_block_argument_type 30124 primary +src/ast/ast_infer_type.cpp 3352 invalid_type not_resolved_yet_block_argument_init 31306 follow_on +src/ast/ast_infer_type.cpp 3359 cant_infer_mismatching_restrictions invalid_block_argument_init_type 30123 primary +src/ast/ast_infer_type.cpp 3371 invalid_argument_type invalid_block_argument_init_type 30123 primary +src/ast/ast_infer_type.cpp 3375 invalid_argument_type invalid_block_argument_init_type 30123 primary +src/ast/ast_infer_type.cpp 3418 invalid_block invalid_block_break 30125 primary +src/ast/ast_infer_type.cpp 3422 invalid_block invalid_block_continue 30126 primary +src/ast/ast_infer_type.cpp 3441 type_not_found lookup_block_result_type 30804 primary +src/ast/ast_infer_type.cpp 3462 invalid_swizzle_mask invalid_swizzle_type 30247 primary +src/ast/ast_infer_type.cpp 3468 invalid_swizzle_mask invalid_swizzle_mask 30246 primary +src/ast/ast_infer_type.cpp 3515 invalid_type invalid_as 30113 recategorize recategorize: invalid_type - actually wrong-construct; should be invalid_as_non_variant +src/ast/ast_infer_type.cpp 3521 cant_get_field lookup_variant_field 30839 primary +src/ast/ast_infer_type.cpp 3565 unsafe unsafe_variant_safe_as 31036 primary +src/ast/ast_infer_type.cpp 3570 invalid_type invalid_safe_as 30223 recategorize recategorize: invalid_type - actually wrong-construct +src/ast/ast_infer_type.cpp 3579 cant_get_field lookup_variant_field 30839 primary +src/ast/ast_infer_type.cpp 3625 invalid_type invalid_is 30190 recategorize recategorize: invalid_type - actually wrong-construct +src/ast/ast_infer_type.cpp 3631 cant_get_field lookup_variant_field 30839 primary +src/ast/ast_infer_type.cpp 3660 cant_get_field ambiguous_field_lookup 30605 primary +src/ast/ast_infer_type.cpp 3699 cant_get_field missing_bitfield_init 30302 primary +src/ast/ast_infer_type.cpp 3702 cant_get_field invalid_bitfield 30119 primary +src/ast/ast_infer_type.cpp 3720 cant_get_field ambiguous_bitfield 30601 mid_inference +src/ast/ast_infer_type.cpp 3725 cant_get_field lookup_bitfield 30802 primary +src/ast/ast_infer_type.cpp 3743 cant_get_field ambiguous_field 30604 mid_inference +src/ast/ast_infer_type.cpp 3746 cant_get_field lookup_field 30808 mid_inference vague: clarify what 'X' means +src/ast/ast_infer_type.cpp 3755 cant_get_field invalid_field_syntax 30153 primary +src/ast/ast_infer_type.cpp 3770 cant_get_field cant_get_field_pointer 30929 primary +src/ast/ast_infer_type.cpp 3792 cant_get_field lookup_tuple_field 30831 primary +src/ast/ast_infer_type.cpp 3799 unsafe unsafe_variant_field 31035 primary +src/ast/ast_infer_type.cpp 3805 cant_get_field lookup_variant_field 30839 primary +src/ast/ast_infer_type.cpp 3819 type_not_found not_resolved_yet_bitfield_type 31303 follow_on +src/ast/ast_infer_type.cpp 3825 cant_get_field lookup_bitfield 30802 primary +src/ast/ast_infer_type.cpp 3847 cant_get_field lookup_tuple_field 30831 primary +src/ast/ast_infer_type.cpp 3854 unsafe unsafe_variant_field 31035 primary +src/ast/ast_infer_type.cpp 3860 cant_get_field lookup_variant_field 30839 primary +src/ast/ast_infer_type.cpp 3866 cant_get_field cant_get_field 30928 primary +src/ast/ast_infer_type.cpp 3878 type_not_found lookup_field_type 30809 primary +src/ast/ast_infer_type.cpp 3898 cant_get_field invalid_field_type 30154 primary +src/ast/ast_infer_type.cpp 3916 cant_get_field lookup_field 30808 mid_inference +src/ast/ast_infer_type.cpp 3920 cant_get_field lookup_field 30808 primary +src/ast/ast_infer_type.cpp 3950 cant_get_field invalid_safe_dereference_type 30224 mid_inference +src/ast/ast_infer_type.cpp 3954 cant_get_field invalid_safe_dereference_type 30224 primary +src/ast/ast_infer_type.cpp 3964 cant_get_field lookup_variant_field 30839 primary +src/ast/ast_infer_type.cpp 3974 cant_get_field cant_safe_get_field 30944 primary +src/ast/ast_infer_type.cpp 3978 type_not_found lookup_safe_field_type 30824 primary +src/ast/ast_infer_type.cpp 3987 cant_get_field cant_safe_get_field 30944 primary +src/ast/ast_infer_type.cpp 3994 cant_get_field lookup_tuple_field 30831 primary +src/ast/ast_infer_type.cpp 4001 cant_get_field invalid_safe_field_type 30225 primary +src/ast/ast_infer_type.cpp 4007 cant_get_field invalid_safe_dereference_type 30224 primary +src/ast/ast_infer_type.cpp 4025 unbound_macro_tag invalid_macro_tag 30205 primary +src/ast/ast_infer_type.cpp 4126 variable_not_found invalid_global_self_init 30177 wording_fix typo: cant't -> can't +src/ast/ast_infer_type.cpp 4146 variable_not_found invalid_variable_private 30283 mid_inference +src/ast/ast_infer_type.cpp 4149 variable_not_found lookup_variable 30838 mid_inference +src/ast/ast_infer_type.cpp 4153 variable_not_found lookup_variable 30838 primary +src/ast/ast_infer_type.cpp 4166 variable_not_found ambiguous_variable 30615 mid_inference +src/ast/ast_infer_type.cpp 4169 variable_not_found ambiguous_variable 30615 primary +src/ast/ast_infer_type.cpp 4212 invalid_return_semantics invalid_return_semantics 30222 primary +src/ast/ast_infer_type.cpp 4220 invalid_return_type unsafe_return_reference 31027 recategorize recategorize: invalid_return_type - actually unsafe; should be unsafe_return_reference +src/ast/ast_infer_type.cpp 4224 invalid_return_type unsafe_return_block 31025 recategorize recategorize: invalid_return_type - actually unsafe +src/ast/ast_infer_type.cpp 4228 unsafe unsafe_return_smart_pointer 31028 primary +src/ast/ast_infer_type.cpp 4252 invalid_return_semantics invalid_return_semantics 30222 primary +src/ast/ast_infer_type.cpp 4260 invalid_return_type unsafe_return_reference 31027 recategorize recategorize: invalid_return_type - actually unsafe +src/ast/ast_infer_type.cpp 4264 invalid_return_type unsafe_return_function 31026 recategorize recategorize: invalid_return_type - actually unsafe +src/ast/ast_infer_type.cpp 4268 unsafe unsafe_return_smart_pointer 31028 primary +src/ast/ast_infer_type.cpp 4285 invalid_yield invalid_yield_in_block 30295 primary +src/ast/ast_infer_type.cpp 4289 invalid_yield invalid_yield 30294 primary +src/ast/ast_infer_type.cpp 4307 invalid_loop invalid_break 30128 primary +src/ast/ast_infer_type.cpp 4313 invalid_loop invalid_continue 30140 primary +src/ast/ast_infer_type.cpp 4354 condition_must_be_bool invalid_if_condition_type 30183 primary +src/ast/ast_infer_type.cpp 4372 condition_must_be_static invalid_static_if_condition 30229 primary +src/ast/ast_infer_type.cpp 4392 invalid_yield invalid_finally_in_generator_if 30155 primary +src/ast/ast_infer_type.cpp 4400 invalid_yield invalid_finally_in_generator_if 30155 primary +src/ast/ast_infer_type.cpp 4420 invalid_assume already_declared_assume_alias 30700 primary +src/ast/ast_infer_type.cpp 4428 invalid_assume already_declared_assume_alias 30700 primary +src/ast/ast_infer_type.cpp 4435 invalid_assume already_declared_assume_alias 30700 primary +src/ast/ast_infer_type.cpp 4443 invalid_assume already_declared_assume_alias 30700 primary +src/ast/ast_infer_type.cpp 4453 invalid_assume already_declared_assume_alias 30700 primary +src/ast/ast_infer_type.cpp 4463 invalid_assume already_declared_assume_alias 30700 primary +src/ast/ast_infer_type.cpp 4466 invalid_assume already_declared_assume_alias 30700 primary +src/ast/ast_infer_type.cpp 4481 invalid_assume already_declared_assume_alias 30700 primary +src/ast/ast_infer_type.cpp 4486 invalid_assume missing_assume_type 30301 primary +src/ast/ast_infer_type.cpp 4551 invalid_assume recursion_assume_alias 31101 primary +src/ast/ast_infer_type.cpp 4569 invalid_with_type invalid_with_array_type 30292 primary +src/ast/ast_infer_type.cpp 4576 invalid_with_type invalid_with_type 30293 primary +src/ast/ast_infer_type.cpp 4583 variable_not_found already_declared_with_shadow 30709 recategorize recategorize: variable_not_found - shadowing not lookup miss +src/ast/ast_infer_type.cpp 4606 invalid_loop invalid_while_condition_type 30291 primary +src/ast/ast_infer_type.cpp 4640 invalid_loop missing_for_iterator 30307 primary +src/ast/ast_infer_type.cpp 4644 invalid_loop invalid_for_iterator_count 30157 primary +src/ast/ast_infer_type.cpp 4669 invalid_iteration_source cant_iterate_iterator 30939 primary +src/ast/ast_infer_type.cpp 4687 invalid_iteration_source invalid_iteration_source_type 30192 primary +src/ast/ast_infer_type.cpp 4697 variable_not_found already_declared_variable 30708 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4705 variable_not_found already_declared_variable 30708 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4713 variable_not_found already_declared_variable 30708 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4720 variable_not_found already_declared_variable 30708 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4726 variable_not_found already_declared_variable 30708 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4734 invalid_iteration_source invalid_for_iterator_tuple 30158 primary +src/ast/ast_infer_type.cpp 4862 type_not_found lookup_local_type 30820 primary +src/ast/ast_infer_type.cpp 4867 cant_infer_missing_initializer missing_local_init 30316 primary +src/ast/ast_infer_type.cpp 4872 variable_not_found already_declared_local_variable 30704 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4880 variable_not_found already_declared_local_variable 30704 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4888 variable_not_found already_declared_local_variable 30704 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4895 variable_not_found already_declared_local_variable 30704 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4901 variable_not_found already_declared_local_variable 30704 recategorize recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4917 invalid_variable_type missing_local_reference_init 30317 primary +src/ast/ast_infer_type.cpp 4921 unsafe unsafe_local_reference 31019 primary +src/ast/ast_infer_type.cpp 4926 invalid_variable_type invalid_local_type 30202 primary +src/ast/ast_infer_type.cpp 4931 invalid_variable_type missing_local_block_init 30315 primary +src/ast/ast_infer_type.cpp 4935 invalid_variable_type unsafe_local_type 31020 recategorize recategorize: invalid_variable_type - actually unsafe +src/ast/ast_infer_type.cpp 4940 unsafe unsafe_local_class 31017 primary +src/ast/ast_infer_type.cpp 4946 invalid_variable_type missing_local_init 30316 primary +src/ast/ast_infer_type.cpp 4971 invalid_variable_type invalid_local_in_scope_finally 30196 primary +src/ast/ast_infer_type.cpp 4977 invalid_variable_type invalid_local_in_scope 30195 primary +src/ast/ast_infer_type.cpp 4993 invalid_generator_finalizer internal_generator_finalizer 50616 internal +src/ast/ast_infer_type.cpp 4998 invalid_generator_finalizer internal_generator_finalizer_multiple 50617 internal +src/ast/ast_infer_type.cpp 5004 invalid_variable_type internal_lambda_in_scope_conversion 50625 internal +src/ast/ast_infer_type.cpp 5012 bad_delete cant_delete_local 30918 primary +src/ast/ast_infer_type.cpp 5018 invalid_variable_type unsafe_local_in_scope_required 31018 recategorize recategorize: invalid_variable_type - actually unsafe +src/ast/ast_infer_type.cpp 5024 unsafe unsafe_local 31016 wording_fix inconsistent: uses [safe_when_uninitialized]; lines 295/370 use @safe_when_uninitialized +src/ast/ast_infer_type.cpp 5062 cant_infer_mismatching_restrictions invalid_local_init_type 30200 primary +src/ast/ast_infer_type.cpp 5065 cant_infer_mismatching_restrictions invalid_local_init_type 30200 primary +src/ast/ast_infer_type.cpp 5082 invalid_initialization_type invalid_local_init_type 30200 primary +src/ast/ast_infer_type.cpp 5085 invalid_initialization_type invalid_local_init_type 30200 primary +src/ast/ast_infer_type.cpp 5089 invalid_initialization_type invalid_local_init_block 30198 primary +src/ast/ast_infer_type.cpp 5093 invalid_initialization_type invalid_local_init_constructor 30199 primary +src/ast/ast_infer_type.cpp 5096 invalid_initialization_type invalid_local_init 30197 primary +src/ast/ast_infer_type.cpp 5099 invalid_initialization_type invalid_local_init 30197 primary +src/ast/ast_infer_type.cpp 5102 invalid_initialization_type invalid_local_init 30197 primary +src/ast/ast_infer_type.cpp 5109 cant_move cant_local 30940 primary +src/ast/ast_infer_type.cpp 5143 not_resolved_yet_local_type 31321 follow_on current cerr unspecified - should be not_resolved_yet_local_type; vague: clarify which type isn't ready +src/ast/ast_infer_type.cpp 5173 invalid_type invalid_local_tuple_expansion 30201 primary +src/ast/ast_infer_type.cpp 5195 unsupported_call_macro runtime_call_macro 31201 primary +src/ast/ast_infer_type.cpp 5202 too_many_infer_passes exceeds_call_depth 30503 recategorize recategorize: too_many_infer_passes - actually call depth not infer passes +src/ast/ast_infer_type.cpp 5213 too_many_arguments exceeds_function_argument 30505 primary +src/ast/ast_infer_type.cpp 5231 too_many_infer_passes exceeds_call_depth 30503 recategorize recategorize: too_many_infer_passes - actually call depth +src/ast/ast_infer_type.cpp 5242 too_many_arguments exceeds_function_argument 30505 primary +src/ast/ast_infer_type.cpp 5264 invalid_argument_type not_resolved_yet_argument_type 31300 follow_on +src/ast/ast_infer_type.cpp 5353 recursion_function_argument 31103 primary current cerr unspecified - should be recursion_function_argument +src/ast/ast_infer_type.cpp 5363 too_many_infer_passes exceeds_call_depth 30503 recategorize recategorize: too_many_infer_passes - actually call depth +src/ast/ast_infer_type.cpp 5374 too_many_arguments exceeds_function_argument 30505 primary +src/ast/ast_infer_type.cpp 5378 result_discarded invalid_function_result_discarded 30166 primary +src/ast/ast_infer_type.cpp 5434 function_not_found ambiguous_super_constructor 30611 mid_inference +src/ast/ast_infer_type.cpp 5441 function_not_found lookup_super_constructor 30828 primary +src/ast/ast_infer_type.cpp 5445 function_not_found invalid_super_call 30245 primary +src/ast/ast_infer_type.cpp 5467 invalid_cast invalid_bitfield_cast_argument_count 30120 primary +src/ast/ast_infer_type.cpp 5602 unsafe unsafe_function_call 31013 primary +src/ast/ast_infer_type.cpp 5605 unsafe unsafe_function_call 31013 primary +src/ast/ast_infer_type.cpp 5608 unsafe unsafe_function_call 31013 primary +src/ast/ast_infer_type.cpp 5640 annotation_failed runtime_annotation_transform 31200 primary +src/ast/ast_infer_type.cpp 5652 unsafe unsafe_class_stack_construction 31008 primary +src/ast/ast_infer_type.cpp 5663 expecting_return_value invalid_string_builder_argument 30231 recategorize recategorize: expecting_return_value - misnamed; actual fault is void argument +src/ast/ast_infer_type.cpp 5666 invalid_type invalid_string_builder_argument 30231 primary +src/ast/ast_infer_type.cpp 5702 unspecified runtime_macro 50503 primary current cerr unspecified - should be runtime_macro +src/ast/ast_infer_type.cpp 5710 unspecified runtime_macro_infer 31207 primary current cerr unspecified - should be runtime_macro_infer +src/ast/ast_infer_type.cpp 5732 unspecified internal_relocate_infer 50631 internal current cerr unspecified - should be internal_relocate_infer +src/ast/ast_infer_type.cpp 5743 unspecified internal_pod_analysis_infer 50630 internal current cerr unspecified - should be internal_pod_analysis_infer +src/ast/ast_infer_type.cpp 5755 too_many_infer_passes exceeds_infer_passes 30507 primary +src/ast/ast_infer_type.cpp 5791 unspecified internal_function_refresh 50614 internal current cerr unspecified - should be internal_function_refresh +src/ast/ast_infer_type.cpp 5822 too_many_infer_passes exceeds_infer_passes 30507 primary +src/ast/ast_infer_type_function.cpp 607 function_not_found ambiguous_function 30607 primary +src/ast/ast_infer_type_function.cpp 610 function_not_found ambiguous_function 30607 primary +src/ast/ast_infer_type_function.cpp 617 function_not_found ambiguous_function 30607 primary +src/ast/ast_infer_type_function.cpp 620 function_not_found ambiguous_function 30607 primary +src/ast/ast_infer_type_function.cpp 1064 invalid_argument_type 30107 recategorize missing cerr; assign invalid_argument_type +src/ast/ast_infer_type_function.cpp 1088 too_many_infer_passes exceeds_expression_recursion 30504 primary +src/ast/ast_infer_type_function.cpp 1109 recursion_argument 31100 recategorize missing cerr; assign recursion-related code +src/ast/ast_infer_type_function.cpp 1114 invalid_type invalid_function_result 30165 primary +src/ast/ast_infer_type_function.cpp 1119 recursion_function 31102 recategorize missing cerr; assign recursion-related code +src/ast/ast_infer_type_function.cpp 1138 invalid_type mismatching_function_argument 30404 primary +src/ast/ast_infer_type_function.cpp 1153 internal_array_type 50602 internal missing cerr; internal invariant +src/ast/ast_infer_type_function.cpp 1162 internal_array_type 50602 internal typo: strcut -> struct; missing cerr; internal invariant +src/ast/ast_infer_type_function.cpp 1212 internal_function 50609 internal missing cerr; internal invariant +src/ast/ast_infer_type_function.cpp 1303 invalid_type lookup_argument_type 30801 primary +src/ast/ast_infer_type_function.cpp 1350 function_already_declared already_declared_function 30702 primary +src/ast/ast_infer_type_function.cpp 1362 invalid_annotation invalid_annotation_macro 30102 primary +src/ast/ast_infer_type_function.cpp 1391 function_not_found cant_access_private_structure 30901 recategorize recategorize from function_not_found to invalid_private/cant_access_private +src/ast/ast_infer_type_function.cpp 1395 function_not_found lookup_function 30810 primary +src/ast/ast_infer_type_function.cpp 1400 invalid_argument_count invalid_function_argument_count 30160 primary +src/ast/ast_infer_type_helper.cpp 89 invalid_array_dimension invalid_array_dimension 30109 primary +src/ast/ast_infer_type_helper.cpp 94 invalid_array_dimension exceeds_array 50300 primary +src/ast/ast_infer_type_helper.cpp 106 invalid_type invalid_type 30262 primary +src/ast/ast_infer_type_helper.cpp 112 invalid_type invalid_array 30108 primary +src/ast/ast_infer_type_helper.cpp 116 invalid_type invalid_type 30262 primary +src/ast/ast_infer_type_helper.cpp 122 invalid_type invalid_type 30262 primary +src/ast/ast_infer_type_helper.cpp 127 invalid_type invalid_type 30262 primary +src/ast/ast_infer_type_helper.cpp 130 invalid_type invalid_annotation_type 30103 primary +src/ast/ast_infer_type_helper.cpp 137 invalid_type invalid_type 30262 primary +src/ast/ast_infer_type_helper.cpp 148 invalid_array_type not_resolved_yet_array_type 31302 follow_on +src/ast/ast_infer_type_helper.cpp 152 invalid_array_type invalid_array 30108 primary +src/ast/ast_infer_type_helper.cpp 156 invalid_array_type invalid_array 30108 primary +src/ast/ast_infer_type_helper.cpp 160 invalid_type invalid_array_type 30112 primary +src/ast/ast_infer_type_helper.cpp 168 invalid_array_type not_resolved_yet_table_type 31328 follow_on recategorize: cerr is invalid_array_type but it's a table key +src/ast/ast_infer_type_helper.cpp 172 invalid_table_type invalid_table 30248 primary +src/ast/ast_infer_type_helper.cpp 176 invalid_table_type invalid_table_type 30254 primary typo: declare -> declared +src/ast/ast_infer_type_helper.cpp 183 invalid_array_type not_resolved_yet_table_type 31328 follow_on recategorize: cerr is invalid_array_type but it's a table value +src/ast/ast_infer_type_helper.cpp 187 invalid_table_type invalid_table 30248 primary +src/ast/ast_infer_type_helper.cpp 191 invalid_type invalid_table_type 30254 primary +src/ast/ast_infer_type_helper.cpp 199 invalid_return_type invalid_result_type 30221 primary +src/ast/ast_infer_type_helper.cpp 206 invalid_argument_type invalid_argument_type 30107 primary +src/ast/ast_infer_type_helper.cpp 214 invalid_type invalid_tuple 30255 primary +src/ast/ast_infer_type_helper.cpp 218 invalid_type invalid_tuple 30255 primary +src/ast/ast_infer_type_helper.cpp 222 invalid_type invalid_tuple_type 30260 primary +src/ast/ast_infer_type_helper.cpp 230 invalid_type invalid_variant 30284 primary +src/ast/ast_infer_type_helper.cpp 234 invalid_type invalid_variant 30284 primary +src/ast/ast_infer_type_helper.cpp 238 invalid_type invalid_variant_type 30289 primary +src/ast/ast_infer_type_helper.cpp 649 invalid_array_dimension invalid_array_dimension 30109 primary +src/ast/ast_infer_type_helper.cpp 653 invalid_array_dimension invalid_array_dimension_type 30110 primary +src/ast/ast_infer_type_helper.cpp 657 invalid_array_dimension invalid_array_dimension 30109 primary +src/ast/ast_infer_type_helper.cpp 661 invalid_array_dimension invalid_array_dimension 30109 primary +src/ast/ast_infer_type_helper.cpp 668 invalid_type invalid_type_dimension 30263 primary +src/ast/ast_infer_type_helper.cpp 678 invalid_type not_resolved_yet_type 31330 follow_on +src/ast/ast_infer_type_helper.cpp 682 invalid_type not_resolved_yet_type 31330 follow_on +src/ast/ast_infer_type_helper.cpp 689 invalid_type lookup_macro 30821 primary +src/ast/ast_infer_type_helper.cpp 692 invalid_type ambiguous_macro 30608 primary +src/ast/ast_infer_type_helper.cpp 697 invalid_type invalid_macro_type 30206 primary +src/ast/ast_infer_type_helper.cpp 770 invalid_cast invalid_cast_structure 30131 primary +src/ast/ast_infer_type_helper.cpp 774 invalid_cast invalid_cast_structure 30131 primary +src/ast/ast_infer_type_helper.cpp 791 invalid_cast invalid_cast_structure_pointer 30132 primary +src/ast/ast_infer_type_helper.cpp 795 invalid_cast invalid_cast_structure_pointer 30132 primary +src/ast/ast_infer_type_helper.cpp 805 invalid_cast mismatching_function_argument_count 30405 primary +src/ast/ast_infer_type_helper.cpp 842 invalid_cast invalid_cast_function 30130 primary +src/ast/ast_infer_type_helper.cpp 872 invalid_return_type invalid_result_type 30221 primary +src/ast/ast_infer_type_helper.cpp 892 cant_get_field cant_access_private_field 30900 recategorize recategorize from cant_get_field to invalid_private/cant_access_private +src/ast/ast_infer_type_helper.cpp 959 invalid_return_type invalid_result 30220 primary +src/ast/ast_infer_type_helper.cpp 966 not_resolved_yet_expression_type 31312 follow_on typo: subexpresion -> subexpression; missing cerr +src/ast/ast_infer_type_helper.cpp 969 not_resolved_yet_expression_type 31312 follow_on typo: subexpresion -> subexpression; missing cerr +src/ast/ast_infer_type_helper.cpp 974 cant_infer_mismatching_restrictions mismatching_result_type 30407 primary +src/ast/ast_infer_type_helper.cpp 995 not_expecting_return_value not_expecting_result 31402 primary +src/ast/ast_infer_type_helper.cpp 1000 expecting_return_value missing_result 30319 primary +src/ast/ast_infer_type_helper.cpp 1007 invalid_return_type invalid_result_type 30221 primary +src/ast/ast_infer_type_helper.cpp 1011 invalid_return_type invalid_result_type 30221 primary +src/ast/ast_infer_type_helper.cpp 1018 invalid_return_type invalid_result_type 30221 primary +src/ast/ast_infer_type_helper.cpp 1023 cant_move cant_result 30943 primary +src/ast/ast_infer_type_make.cpp 32 type_not_found lookup_generator_type 30816 primary +src/ast/ast_infer_type_make.cpp 38 type_not_found lookup_generator_type 30816 primary +src/ast/ast_infer_type_make.cpp 42 type_not_found invalid_generator 30169 recategorize recategorize: not a lookup miss; cerr should be invalid_type +src/ast/ast_infer_type_make.cpp 47 invalid_argument_count invalid_generator_argument_count 30170 primary +src/ast/ast_infer_type_make.cpp 50 invalid_argument_type invalid_generator_argument_type 30171 primary +src/ast/ast_infer_type_make.cpp 57 invalid_block not_resolved_yet_generator_block 31315 follow_on +src/ast/ast_infer_type_make.cpp 60 invalid_argument_type invalid_generator_result_type 30172 primary +src/ast/ast_infer_type_make.cpp 63 invalid_argument_type invalid_generator_argument_count 30170 primary +src/ast/ast_infer_type_make.cpp 136 invalid_block internal_generator_finalizer_name 50618 internal +src/ast/ast_infer_type_make.cpp 140 invalid_block internal_generator_function_name 50619 internal +src/ast/ast_infer_type_make.cpp 144 invalid_block internal_generator_structure_name 50620 internal +src/ast/ast_infer_type_make.cpp 169 invalid_capture invalid_capture_variable 30129 wording_fix typo: captured -> capture +src/ast/ast_infer_type_make.cpp 173 invalid_capture unsafe_capture_variable 31003 primary +src/ast/ast_infer_type_make.cpp 177 invalid_capture cant_capture_variable 30912 primary +src/ast/ast_infer_type_make.cpp 183 invalid_capture unsafe_capture_variable 31003 primary +src/ast/ast_infer_type_make.cpp 189 invalid_capture cant_capture_variable 30912 primary +src/ast/ast_infer_type_make.cpp 193 invalid_capture cant_capture_variable 30912 primary +src/ast/ast_infer_type_make.cpp 199 invalid_capture cant_capture_variable 30912 primary +src/ast/ast_infer_type_make.cpp 205 invalid_capture cant_capture_variable 30912 primary +src/ast/ast_infer_type_make.cpp 217 invalid_block not_resolved_yet_lambda_block 31320 follow_on +src/ast/ast_infer_type_make.cpp 260 invalid_block internal_lambda_finalizer_name 50623 internal +src/ast/ast_infer_type_make.cpp 264 invalid_block internal_lambda_function_name 50624 internal +src/ast/ast_infer_type_make.cpp 268 invalid_block internal_lambda_structure_name 50626 internal +src/ast/ast_infer_type_make.cpp 281 invalid_block not_resolved_yet_function_block 31314 follow_on +src/ast/ast_infer_type_make.cpp 295 invalid_block internal_function_name 50612 internal +src/ast/ast_infer_type_make.cpp 307 invalid_argument_type invalid_argument_type 30107 primary +src/ast/ast_infer_type_make.cpp 322 invalid_block not_resolved_yet_block 31304 follow_on +src/ast/ast_infer_type_make.cpp 340 invalid_block not_resolved_yet_block 31304 follow_on +src/ast/ast_infer_type_make.cpp 359 invalid_type invalid_variant_type 30289 primary +src/ast/ast_infer_type_make.cpp 363 invalid_type invalid_variant_array 30285 primary +src/ast/ast_infer_type_make.cpp 366 invalid_type mismatching_variant_dimension 30412 primary +src/ast/ast_infer_type_make.cpp 371 invalid_type invalid_variant 30284 primary +src/ast/ast_infer_type_make.cpp 385 cant_pass_temporary cant_initialize_variant_field 30938 primary +src/ast/ast_infer_type_make.cpp 389 invalid_type cant_variant_field 30951 recategorize recategorize: cerr is invalid_type but error is about copy semantics +src/ast/ast_infer_type_make.cpp 396 cant_move cant_variant_field 30951 primary +src/ast/ast_infer_type_make.cpp 400 cant_get_field lookup_variant_field 30839 primary +src/ast/ast_infer_type_make.cpp 417 type_not_found lookup_variant_type 30840 primary +src/ast/ast_infer_type_make.cpp 423 type_not_found lookup_variant_type 30840 primary +src/ast/ast_infer_type_make.cpp 427 type_not_found invalid_variant 30284 recategorize recategorize: not a lookup miss; cerr should be invalid_type +src/ast/ast_infer_type_make.cpp 493 too_many_infer_passes exceeds_expression_recursion 30504 primary +src/ast/ast_infer_type_make.cpp 509 invalid_type invalid_structure_type 30243 primary +src/ast/ast_infer_type_make.cpp 514 invalid_type invalid_structure_array 30234 primary +src/ast/ast_infer_type_make.cpp 517 invalid_type mismatching_structure_dimension 30408 primary +src/ast/ast_infer_type_make.cpp 522 invalid_type invalid_structure 30232 primary +src/ast/ast_infer_type_make.cpp 526 invalid_type invalid_class_local 30135 primary +src/ast/ast_infer_type_make.cpp 531 invalid_type invalid_structure_local 30239 primary typo: can`t -> can't (backtick instead of apostrophe) +src/ast/ast_infer_type_make.cpp 538 invalid_type invalid_structure_initializer_required 30238 primary +src/ast/ast_infer_type_make.cpp 543 unsafe unsafe_class_local 31007 primary +src/ast/ast_infer_type_make.cpp 548 unsafe unsafe_structure_uninitialized 31031 primary +src/ast/ast_infer_type_make.cpp 557 invalid_type internal_structure_block 50633 internal +src/ast/ast_infer_type_make.cpp 563 invalid_type internal_block 50603 internal +src/ast/ast_infer_type_make.cpp 603 cant_pass_temporary cant_capture_variable 30912 primary +src/ast/ast_infer_type_make.cpp 606 cant_pass_temporary cant_initialize_structure_field 30937 primary +src/ast/ast_infer_type_make.cpp 611 invalid_type cant_structure_field 30947 recategorize recategorize: cerr is invalid_type but error is about copy semantics +src/ast/ast_infer_type_make.cpp 618 cant_move cant_structure_field 30947 primary +src/ast/ast_infer_type_make.cpp 622 cant_get_field cant_initialize_private_field 30936 recategorize recategorize: cerr is cant_get_field; should be invalid_private +src/ast/ast_infer_type_make.cpp 672 cant_get_field lookup_structure_field 30825 primary +src/ast/ast_infer_type_make.cpp 678 cant_get_field invalid_annotation_field 30101 primary +src/ast/ast_infer_type_make.cpp 685 invalid_type cant_annotation_field 30904 recategorize recategorize: cerr is invalid_type but error is about copy semantics +src/ast/ast_infer_type_make.cpp 692 cant_move cant_annotation_field 30904 primary +src/ast/ast_infer_type_make.cpp 699 cant_get_field lookup_annotation_field 30800 primary +src/ast/ast_infer_type_make.cpp 707 invalid_type not_resolved_yet_tuple_type 31329 follow_on +src/ast/ast_infer_type_make.cpp 717 cant_get_field lookup_tuple_field 30831 primary +src/ast/ast_infer_type_make.cpp 721 field_already_initialized already_declared_tuple_field 30707 primary +src/ast/ast_infer_type_make.cpp 743 unsafe unsafe_structure_visibility 31032 primary +src/ast/ast_infer_type_make.cpp 751 type_not_found lookup_expression_type 30807 primary +src/ast/ast_infer_type_make.cpp 774 function_not_found lookup_constructor 30806 primary +src/ast/ast_infer_type_make.cpp 788 invalid_block invalid_structure_block_pipe 30235 primary +src/ast/ast_infer_type_make.cpp 796 invalid_block invalid_block_argument_count 30122 primary +src/ast/ast_infer_type_make.cpp 814 invalid_block not_resolved_yet_block_argument 31305 follow_on +src/ast/ast_infer_type_make.cpp 819 invalid_block mismatching_block_argument_type 30402 primary +src/ast/ast_infer_type_make.cpp 824 invalid_block invalid_block_argument 30121 primary +src/ast/ast_infer_type_make.cpp 835 invalid_type invalid_class_variant 30137 primary +src/ast/ast_infer_type_make.cpp 839 invalid_type invalid_structure_variant 30244 primary +src/ast/ast_infer_type_make.cpp 843 invalid_type invalid_tuple_variant 30261 primary +src/ast/ast_infer_type_make.cpp 848 invalid_block invalid_variant_block 30286 primary +src/ast/ast_infer_type_make.cpp 857 field_already_initialized invalid_variant_initializer_count 30287 primary +src/ast/ast_infer_type_make.cpp 872 invalid_type invalid_class_tuple 30136 primary +src/ast/ast_infer_type_make.cpp 876 invalid_type invalid_structure_tuple 30242 primary +src/ast/ast_infer_type_make.cpp 880 invalid_type invalid_variant_tuple 30288 primary +src/ast/ast_infer_type_make.cpp 885 invalid_block invalid_tuple_block 30257 primary +src/ast/ast_infer_type_make.cpp 917 invalid_type invalid_structure_template 30241 primary +src/ast/ast_infer_type_make.cpp 926 field_already_initialized already_declared_structure_field_init 30705 primary +src/ast/ast_infer_type_make.cpp 941 not_resolved_yet_structure 31325 follow_on missing cerr +src/ast/ast_infer_type_make.cpp 1035 invalid_type missing_enumeration_zero 30305 primary +src/ast/ast_infer_type_make.cpp 1060 invalid_type not_resolved_yet_structure_type 31327 follow_on +src/ast/ast_infer_type_make.cpp 1064 unsafe unsafe_class_initializer 31006 primary +src/ast/ast_infer_type_make.cpp 1068 invalid_type invalid_class 30134 primary +src/ast/ast_infer_type_make.cpp 1072 invalid_type invalid_structure 30232 primary +src/ast/ast_infer_type_make.cpp 1076 invalid_type invalid_variant 30284 primary +src/ast/ast_infer_type_make.cpp 1080 invalid_type invalid_tuple 30255 primary +src/ast/ast_infer_type_make.cpp 1097 invalid_type exceeds_tuple_index 30511 primary +src/ast/ast_infer_type_make.cpp 1106 cant_move cant_tuple 30949 primary +src/ast/ast_infer_type_make.cpp 1119 invalid_type not_resolved_yet_tuple_type 31329 follow_on +src/ast/ast_infer_type_make.cpp 1126 invalid_type internal_tuple_type 50636 internal +src/ast/ast_infer_type_make.cpp 1132 invalid_type mismatching_tuple_argument_count 30409 primary +src/ast/ast_infer_type_make.cpp 1142 invalid_type invalid_tuple_argument_type 30256 primary +src/ast/ast_infer_type_make.cpp 1162 invalid_type invalid_tuple 30255 primary +src/ast/ast_infer_type_make.cpp 1172 invalid_type mismatching_tuple_field_names 30410 primary +src/ast/ast_infer_type_make.cpp 1187 invalid_table_type invalid_tuple_key 30258 primary +src/ast/ast_infer_type_make.cpp 1191 invalid_table_type invalid_tuple_key_type 30259 primary typo: declare -> declared +src/ast/ast_infer_type_make.cpp 1197 invalid_type invalid_tuple_type 30260 primary +src/ast/ast_infer_type_make.cpp 1214 invalid_type invalid_array 30108 primary +src/ast/ast_infer_type_make.cpp 1220 invalid_type invalid_array_dimension 30109 primary +src/ast/ast_infer_type_make.cpp 1223 invalid_type mismatching_array_dimension 30400 primary +src/ast/ast_infer_type_make.cpp 1228 invalid_type invalid_array 30108 primary +src/ast/ast_infer_type_make.cpp 1259 invalid_array_type not_resolved_yet_array_type 31302 follow_on +src/ast/ast_infer_type_make.cpp 1266 invalid_array_type invalid_array 30108 primary +src/ast/ast_infer_type_make.cpp 1275 invalid_array_type not_resolved_yet_array_type 31302 follow_on +src/ast/ast_infer_type_make.cpp 1296 invalid_type invalid_variant_unique 30290 primary +src/ast/ast_infer_type_make.cpp 1306 invalid_type invalid_variant_unique 30290 mid_inference verbose-gated branch with describe candidates +src/ast/ast_infer_type_make.cpp 1310 invalid_type invalid_variant_unique 30290 primary +src/ast/ast_infer_type_make.cpp 1331 cant_move cant_array_element 30908 primary +src/ast/ast_infer_type_make.cpp 1334 cant_pass_temporary cant_initialize_array_element 30935 primary +src/ast/ast_infer_type_make.cpp 1386 invalid_type invalid_array_element_type 30111 primary +src/ast/ast_infer_type_make.cpp 1400 invalid_type not_resolved_yet_type 31330 follow_on +src/ast/ast_infer_type_make.cpp 1404 invalid_type mismatching_array_element_type 30401 primary +src/ast/ast_infer_type_make.cpp 1426 invalid_type not_resolved_yet_array_type 31302 follow_on +src/ast/ast_infer_type_make.cpp 1444 invalid_type invalid_comprehension_element_type 30139 primary +src/ast/ast_infer_type_make.cpp 1447 invalid_type not_resolved_yet_comprehension_type 31308 follow_on +src/ast/ast_infer_type_op.cpp 34 invalid_type cant_type 30950 primary +src/ast/ast_infer_type_op.cpp 47 invalid_type not_resolved_yet_array_type 31302 follow_on +src/ast/ast_infer_type_op.cpp 58 operator_not_found invalid_pointer_arithmetic 30218 primary +src/ast/ast_infer_type_op.cpp 66 operator_not_found cant_apply_op 30905 primary +src/ast/ast_infer_type_op.cpp 70 operator_not_found cant_apply_op 30905 primary +src/ast/ast_infer_type_op.cpp 104 unsafe unsafe_operator 31022 primary +src/ast/ast_infer_type_op.cpp 270 invalid_type cant_type 30950 primary +src/ast/ast_infer_type_op.cpp 295 operator_not_found invalid_pointer_arithmetic 30218 primary +src/ast/ast_infer_type_op.cpp 303 invalid_type invalid_type 30262 primary +src/ast/ast_infer_type_op.cpp 310 invalid_type cant_type 30950 primary +src/ast/ast_infer_type_op.cpp 327 invalid_type invalid_enumeration 30145 primary +src/ast/ast_infer_type_op.cpp 360 unsafe unsafe_operator 31022 primary +src/ast/ast_infer_type_op.cpp 379 operator_not_found invalid_op3_expression 30216 wording_fix reword: 'Op3 currently only supports ?:' (code uses ?, not 'is') +src/ast/ast_infer_type_op.cpp 385 condition_must_be_bool condition_must_be_bool 31401 primary +src/ast/ast_infer_type_op.cpp 388 operator_not_found mismatching_type 30411 primary +src/ast/ast_infer_type_op.cpp 392 invalid_type invalid_type 30262 primary +src/ast/ast_infer_type_op.cpp 426 cant_pointer 30942 primary +src/ast/ast_infer_type_op.cpp 433 cant_copy 30915 primary +src/ast/ast_infer_type_op.cpp 439 mismatching_type 30411 primary +src/ast/ast_infer_type_op.cpp 455 mismatching_type 30411 primary +src/ast/ast_infer_type_op.cpp 479 cant_write_to_non_reference cant_move 30941 primary +src/ast/ast_infer_type_op.cpp 482 cant_write_to_non_reference cant_move 30941 wording_fix typo: 'move to from' -> 'move from' +src/ast/ast_infer_type_op.cpp 485 cant_move_to_const cant_move 30941 primary +src/ast/ast_infer_type_op.cpp 488 cant_move cant_type 30950 primary +src/ast/ast_infer_type_op.cpp 491 cant_move cant_move 30941 primary +src/ast/ast_infer_type_op.cpp 494 cant_pass_temporary cant_move 30941 primary +src/ast/ast_infer_type_op.cpp 497 unsafe unsafe_smart_pointer 31029 primary +src/ast/ast_infer_type_op.cpp 502 unsafe unsafe_move 31021 primary +src/ast/ast_infer_type_op.cpp 508 unsafe unsafe_class 31005 primary +src/ast/ast_infer_type_op.cpp 589 cant_write_to_non_reference cant_copy 30915 primary +src/ast/ast_infer_type_op.cpp 592 cant_write_to_const cant_write 30952 primary +src/ast/ast_infer_type_op.cpp 595 cant_pass_temporary cant_copy 30915 primary +src/ast/ast_infer_type_op.cpp 598 unsafe unsafe_class 31005 primary +src/ast/ast_infer_type_op.cpp 602 cant_copy cant_type 30950 primary +src/ast/ast_infer_type_op.cpp 710 operator_not_found mismatching_clone_type 30403 recategorize recategorize: cerror operator_not_found wrong; this is type-mismatch on clone (use mismatching_type) +src/ast/ast_infer_type_op.cpp 713 cant_write_to_non_reference cant_clone 30913 primary +src/ast/ast_infer_type_op.cpp 716 cant_write_to_const cant_clone 30913 primary +src/ast/ast_infer_type_op.cpp 736 invalid_type invalid_clone_smart_pointer_type 30138 primary +src/ast/ast_infer_type_report.cpp 358 lookup_function 30810 mid_inference gated by verbose; emits expensive describe()/candidate dump every infer pass +src/ast/ast_infer_type_report.cpp 360 lookup_function 30810 primary +src/ast/ast_infer_type_report.cpp 441 lookup_function 30810 mid_inference gated by verbose; emits expensive describe()/candidate dump every infer pass +src/ast/ast_infer_type_report.cpp 443 lookup_function 30810 primary +src/ast/ast_infer_type_report.cpp 506 lookup_function 30810 mid_inference gated by verbose; emits expensive describe()/candidate dump every infer pass +src/ast/ast_infer_type_report.cpp 508 lookup_function 30810 primary +src/ast/ast_infer_type_report.cpp 520 cant_copy cant_clone_type 30914 mid_inference gated by verbose; emits trait-walk for clonable subtypes +src/ast/ast_infer_type_report.cpp 522 cant_copy cant_clone_type 30914 primary +src/ast/ast_infer_type_report.cpp 534 cant_clone 30913 mid_inference gated by verbose; emits trait-walk for non-clonable-from-const subtypes +src/ast/ast_infer_type_report.cpp 536 cant_clone 30913 primary +src/ast/ast_infer_type_report.cpp 591 function_not_found lookup_function 30810 mid_inference gated by verbose; emits library-wide candidate scan +src/ast/ast_infer_type_report.cpp 594 function_not_found lookup_function 30810 primary +src/ast/ast_infer_type_report.cpp 607 function_already_declared missing_finalizer 30306 recategorize recategorize: function_already_declared wrong cerr for missing finalizer (verbose path uses reportMissing which keeps it; non-verbose path emits as-is) +src/ast/ast_infer_type_report.cpp 659 lookup_function 30810 primary +src/ast/ast_infer_type_report.cpp 669 ambiguous_function 30607 primary +src/ast/ast_infer_type_report.cpp 723 lookup_function 30810 primary +src/ast/ast_infer_type_report.cpp 735 ambiguous_function 30607 primary +src/ast/ast_infer_type_report.cpp 745 operator_not_found cant_assign_op 30910 primary reword: drop trailing period for consistency +src/ast/ast_infer_type_report.cpp 749 operator_not_found cant_assign_op 30910 primary reword: drop trailing period for consistency +src/ast/ast_infer_type_report.cpp 756 operator_not_found mismatching_numeric_type 30406 mid_inference gated by verbose; expensive describe of try-the-following hint +src/ast/ast_infer_type_report.cpp 762 operator_not_found mismatching_numeric_type 30406 primary +src/ast/ast_infer_type_report.cpp 773 operator_not_found mismatching_numeric_type 30406 mid_inference gated by verbose; expensive describe of try-one-of-the-following hint +src/ast/ast_infer_type_report.cpp 779 operator_not_found invalid_storage_type_op 30230 primary +src/ast/ast_infer_type_report.cpp 784 operator_not_found mismatching_numeric_type 30406 mid_inference gated by verbose; emits describe of left/right baseTypes +src/ast/ast_infer_type_report.cpp 790 operator_not_found mismatching_numeric_type 30406 primary +src/ast/ast.cpp 3033 invalid_annotation cant_create_structure_annotation 30916 primary +src/ast/ast.cpp 3037 invalid_annotation invalid_structure_annotation 30233 primary +src/ast/ast.cpp 3066 type_not_found ambiguous_type 30612 ambiguous wording: 'undefined' contradicts ambiguous semantics; cerr says type_not_found but multiple matches exist +src/ast/ast.cpp 3076 structure_not_found ambiguous_structure 30609 recategorize recategorize: structure_not_found when multiple found is wrong; should be ambiguous_structure +src/ast/ast.cpp 3088 handle_not_found invalid_annotation 30100 recategorize recategorize: handle_not_found is misleading; this is a type-mismatch on the resolved annotation +src/ast/ast.cpp 3094 handle_not_found ambiguous_annotation 30600 recategorize recategorize: handle_not_found should be ambiguous_annotation when multiple found +src/ast/ast.cpp 3106 enumeration_not_found ambiguous_enumeration 30603 recategorize recategorize: enumeration_not_found should be ambiguous_enumeration when multiple found +src/ast/ast.cpp 3117 type_alias_not_found ambiguous_type_alias 30613 recategorize recategorize: type_alias_not_found should be ambiguous_type_alias when multiple found +src/ast/ast.cpp 3146 function_not_found ambiguous_function 30607 recategorize recategorize: function_not_found should be ambiguous_function when multiple found +src/ast/ast.cpp 3527 runtime_macro 50503 primary missing cerr; suggest macro_failed +src/ast/ast_annotations.cpp 33 invalid_annotation cant_finalize_structure_annotation 30926 primary +src/ast/ast_annotations.cpp 45 invalid_annotation cant_finalize_function_annotation 30925 primary +src/ast/ast_annotations.cpp 57 invalid_annotation cant_finalize_block_annotation 30924 primary +src/ast/ast_annotations.cpp 65 invalid_annotation internal_annotation 50600 internal +src/ast/ast_annotations.cpp 117 annotation_failed runtime_function_annotation 50501 primary +src/ast/ast_annotations.cpp 131 annotation_failed runtime_structure_annotation 31210 primary +src/ast/ast_annotations.cpp 179 annotation_failed runtime_function_annotation 50501 primary +src/ast/ast_const_folding.cpp 86 missing_node internal_function_not_resolved_yet 50613 internal +src/ast/ast_const_folding.cpp 851 invalid_expression 30151 primary missing cerr; suggest static_assert_failed or new not_constexpr +src/ast/ast_const_folding.cpp 859 runtime_expression 31202 primary missing cerr; suggest static_assert_failed +src/ast/ast_const_folding.cpp 872 runtime_expression 31202 primary missing cerr; suggest static_assert_failed +src/ast/ast_const_folding.cpp 888 concept_failed missing_annotation 30300 primary message is user-supplied; concept_failed cerr stays +src/ast/ast_const_folding.cpp 894 static_assert_failed missing_annotation 30300 primary message is user-supplied; static_assert_failed cerr stays +src/ast/ast_const_folding.cpp 904 run_failed runtime_function 50500 primary +src/ast/ast_const_folding.cpp 907 run_failed runtime_function 50500 primary +src/ast/ast_const_folding.cpp 962 run_failed internal_function 50609 internal +src/ast/ast_derive_alias.cpp 355 make_local_aliasing invalid_expression 30151 primary +src/ast/ast_derive_alias.cpp 375 make_local_aliasing invalid_expression 30151 primary +src/ast/ast_derive_alias.cpp 383 make_local_aliasing invalid_expression 30151 primary +src/ast/ast_derive_alias.cpp 447 argument_aliasing invalid_argument 30104 primary +src/ast/ast_derive_alias.cpp 471 argument_aliasing invalid_argument 30104 primary +src/ast/ast_derive_alias.cpp 480 argument_aliasing invalid_argument 30104 primary +src/ast/ast_derive_alias.cpp 502 argument_aliasing invalid_argument_global 30105 primary +src/ast/ast_derive_alias.cpp 506 argument_aliasing invalid_argument_global 30105 primary +src/ast/ast_derive_alias.cpp 534 argument_aliasing invalid_argument 30104 primary +src/ast/ast_derive_alias.cpp 555 argument_aliasing invalid_argument 30104 primary +src/ast/ast_derive_alias.cpp 564 argument_aliasing invalid_argument 30104 primary +src/ast/ast_derive_alias.cpp 578 argument_aliasing invalid_argument_global 30105 primary +src/ast/ast_derive_alias.cpp 593 argument_aliasing invalid_argument_global 30105 primary +src/ast/ast_export.cpp 126 internal_function 50609 internal missing cerr; suggest internal_error +src/ast/ast_export.cpp 133 internal_variable 50640 internal missing cerr; suggest internal_error +src/ast/ast_lint.cpp 231 invalid_type invalid_type_expression 30264 primary +src/ast/ast_lint.cpp 247 only_fast_aot_no_cpp_name missing_function_name 30309 primary +src/ast/ast_lint.cpp 258 invalid_name invalid_module_name 30210 primary +src/ast/ast_lint.cpp 271 invalid_name invalid_argument_name 30106 primary +src/ast/ast_lint.cpp 287 invalid_type exceeds_type_alias 30513 primary +src/ast/ast_lint.cpp 295 invalid_name invalid_enumeration_name 30146 primary +src/ast/ast_lint.cpp 302 invalid_name invalid_enumerator_name 30148 primary +src/ast/ast_lint.cpp 315 invalid_name invalid_structure_name 30240 primary +src/ast/ast_lint.cpp 319 invalid_type exceeds_structure 30510 primary +src/ast/ast_lint.cpp 329 unsafe_function unsafe_global 31014 primary +src/ast/ast_lint.cpp 341 unsafe_function unsafe_function 31012 primary +src/ast/ast_lint.cpp 354 invalid_name invalid_field_name 30152 primary +src/ast/ast_lint.cpp 359 invalid_structure_field_type cant_field_class 30923 primary +src/ast/ast_lint.cpp 367 invalid_name invalid_variable_name 30282 primary +src/ast/ast_lint.cpp 372 no_global_variables cant_global 30930 primary +src/ast/ast_lint.cpp 375 no_global_variables cant_global 30930 primary +src/ast/ast_lint.cpp 381 no_global_heap cant_global 30930 primary +src/ast/ast_lint.cpp 387 cant_be_null missing_global 30311 primary +src/ast/ast_lint.cpp 392 cant_be_null cant_global 30930 primary +src/ast/ast_lint.cpp 397 invalid_variable_type exceeds_global 50301 primary +src/ast/ast_lint.cpp 417 variable_not_found recursion_global 31104 recategorize recategorize: variable_not_found is wrong; this is initialization-recursion +src/ast/ast_lint.cpp 425 no_init cant_global 30930 primary +src/ast/ast_lint.cpp 437 variable_not_found invalid_global 30173 recategorize recategorize: variable_not_found is wrong; this is initialization-order +src/ast/ast_lint.cpp 451 invalid_name invalid_variable_name 30282 primary +src/ast/ast_lint.cpp 459 cant_be_null cant_expression 30922 primary +src/ast/ast_lint.cpp 470 invalid_name invalid_variable_name 30282 primary +src/ast/ast_lint.cpp 475 cant_be_null missing_local 30314 primary +src/ast/ast_lint.cpp 480 cant_be_null cant_local 30940 primary +src/ast/ast_lint.cpp 485 invalid_variable_type exceeds_local 30508 primary +src/ast/ast_lint.cpp 493 cant_be_null cant_result 30943 primary +src/ast/ast_lint.cpp 514 duplicate_key already_declared_table 30706 primary +src/ast/ast_lint.cpp 532 duplicate_key already_declared_table 30706 primary +src/ast/ast_lint.cpp 549 duplicate_key already_declared_table 30706 primary +src/ast/ast_lint.cpp 562 duplicate_key already_declared_table 30706 primary +src/ast/ast_lint.cpp 575 no_writing_to_nameless cant_expression 30922 primary +src/ast/ast_lint.cpp 594 missing_node internal_function_not_resolved_yet 50613 internal +src/ast/ast_lint.cpp 618 deprecated_function cant_function 30927 primary +src/ast/ast_lint.cpp 627 annotation_failed runtime_function_annotation 50501 primary +src/ast/ast_lint.cpp 636 aot_side_effects invalid_function_argument 30159 primary +src/ast/ast_lint.cpp 649 invalid_argument_type invalid_function_argument 30159 primary +src/ast/ast_lint.cpp 653 not_expecting_return_value cant_result 30943 primary +src/ast/ast_lint.cpp 663 cant_be_null cant_argument 30906 primary +src/ast/ast_lint.cpp 722 aot_side_effects invalid_expression 30151 primary +src/ast/ast_lint.cpp 732 aot_side_effects invalid_expression 30151 primary +src/ast/ast_lint.cpp 783 cant_be_null cant_expression 30922 primary +src/ast/ast_lint.cpp 787 no_writing_to_nameless cant_expression 30922 primary +src/ast/ast_lint.cpp 797 aot_side_effects invalid_expression 30151 primary +src/ast/ast_lint.cpp 802 cant_be_null cant_expression 30922 primary +src/ast/ast_lint.cpp 806 no_writing_to_nameless cant_expression 30922 primary +src/ast/ast_lint.cpp 816 aot_side_effects invalid_expression 30151 primary +src/ast/ast_lint.cpp 824 invalid_new_type exceeds_type 30512 primary +src/ast/ast_lint.cpp 828 invalid_new_type invalid_type 30262 primary +src/ast/ast_lint.cpp 835 invalid_new_type exceeds_type 30512 primary +src/ast/ast_lint.cpp 839 invalid_new_type invalid_type 30262 primary +src/ast/ast_lint.cpp 846 assert_with_side_effects invalid_expression 30151 primary +src/ast/ast_lint.cpp 860 unsafe_function unsafe_function 31012 primary +src/ast/ast_lint.cpp 882 invalid_name invalid_function_name 30163 primary +src/ast/ast_lint.cpp 887 not_all_paths_return_value missing_function_result 30310 primary +src/ast/ast_lint.cpp 899 unsafe_function unsafe_argument 31001 primary +src/ast/ast_lint.cpp 911 annotation_failed runtime_function_annotation 50501 primary +src/ast/ast_lint.cpp 916 no_init cant_function 30927 primary +src/ast/ast_lint.cpp 925 invalid_member_function missing_function_body 30308 primary +src/ast/ast_lint.cpp 936 invalid_name invalid_argument_name 30106 primary +src/ast/ast_lint.cpp 941 unused_function_argument invalid_function_argument 30159 primary +src/ast/ast_lint.cpp 947 invalid_variable_type exceeds_argument 30500 primary +src/ast/ast_lint.cpp 956 not_all_paths_return_value missing_block_result 30304 primary +src/ast/ast_lint.cpp 962 invalid_label cant_block 30911 primary +src/ast/ast_lint.cpp 969 invalid_name invalid_argument_name 30106 primary +src/ast/ast_lint.cpp 974 unused_block_argument invalid_block_argument 30121 primary +src/ast/ast_lint.cpp 980 invalid_variable_type exceeds_argument 30500 primary +src/ast/ast_lint.cpp 987 unspecified cant_argument_structure 30907 primary wording: 'its not yet implemented' belongs in fixme or extra; cerr=unspecified should be invalid_argument_type or new +src/ast/ast_lint.cpp 1002 top_level_no_sideeffect_operation invalid_expression 30151 primary +src/ast/ast_lint.cpp 1018 top_level_no_sideeffect_operation invalid_expression 30151 primary +src/ast/ast_lint.cpp 1039 table_lookup_collision invalid_table_expression 30250 primary +src/ast/ast_lint.cpp 1145 internal_error internal_options 50629 internal +src/ast/ast_lint.cpp 1154 internal_error internal_options 50629 internal +src/ast/ast_lint.cpp 1175 invalid_option invalid_options 50100 primary +src/ast/ast_lint.cpp 1181 invalid_option invalid_options 50100 primary +src/ast/ast_lint.cpp 1216 internal_error internal_type 50637 internal +src/ast/ast_simulate.cpp 620 missing_node internal_function_annotation 50610 internal +src/ast/ast_simulate.cpp 916 internal_structure 50632 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1124 internal_array 50601 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1225 internal_tuple 50635 internal missing cerr; wording 'array' wrong context (tuple); suggest internal_error +src/ast/ast_simulate.cpp 1252 internal_macro 50627 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1260 internal_label 50622 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1303 internal_function 50609 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1307 internal_function 50609 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1352 internal_expression 50607 internal missing cerr; typo: simluate -> simulate; suggest internal_error +src/ast/ast_simulate.cpp 1445 internal_generator 50615 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1453 internal_generator 50615 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1461 internal_array 50601 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1505 internal_field 50608 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1590 internal_table 50634 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1613 internal_table 50634 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1636 internal_table 50634 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1659 internal_table 50634 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1668 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1683 internal_macro 50627 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1689 typeinfo_macro_error runtime_macro 50503 primary +src/ast/ast_simulate.cpp 1719 missing_node internal_expression 50607 internal +src/ast/ast_simulate.cpp 1739 missing_node internal_expression 50607 internal +src/ast/ast_simulate.cpp 1749 missing_node internal_expression 50607 internal +src/ast/ast_simulate.cpp 1758 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1811 missing_node internal_expression 50607 internal +src/ast/ast_simulate.cpp 1819 missing_node internal_expression 50607 internal +src/ast/ast_simulate.cpp 1859 missing_node internal_expression 50607 internal +src/ast/ast_simulate.cpp 1865 missing_node internal_expression 50607 internal +src/ast/ast_simulate.cpp 1890 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1900 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 1912 index_out_of_range exceeds_array 50300 primary +src/ast/ast_simulate.cpp 1961 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 2237 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 2669 internal_macro 50627 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 2683 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 2705 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 2720 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 2943 internal_block 50603 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3052 missing_node internal_expression 50607 internal +src/ast/ast_simulate.cpp 3071 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3117 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3154 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3190 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3275 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3286 internal_expression 50607 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3305 internal_class 50605 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3309 internal_variable 50640 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3465 internal_global 50621 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3484 internal_function 50609 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3503 internal_annotation 50600 internal missing cerr; suggest internal_error +src/ast/ast_simulate.cpp 3572 invalid_options 50100 primary missing cerr +src/ast/ast_simulate.cpp 3619 internal_variable 50640 internal missing cerr; wording: 'errors.' should be 'error,' and missing space before ; suggest internal_error +src/ast/ast_simulate.cpp 3643 exceeds_global 50301 primary missing cerr +src/ast/ast_simulate.cpp 3647 exceeds_global 50301 primary missing cerr +src/ast/ast_simulate.cpp 3653 runtime_global 50502 primary missing cerr +src/ast/ast_simulate.cpp 3657 runtime_global 50502 primary missing cerr +src/ast/ast_simulate.cpp 3680 no_init internal_function 50609 internal extra-msg says 'made it all the way to simulate somehow' — this is a should-not-reach lint-bypass invariant, not a primary user-facing error +src/ast/ast_simulate.cpp 3727 no_init internal_global 50621 internal extra-msg says 'made it all the way to simulate somehow' — should-not-reach invariant, not primary +src/ast/ast_simulate.cpp 3796 cant_initialize runtime_function_annotation 50501 primary +src/ast/ast_simulate.cpp 3913 cant_initialize runtime_function 50500 primary +src/ast/ast_simulate.cpp 3937 runtime_macro 50503 primary missing cerr; suggest macro_failed +src/ast/ast_simulate.cpp 3971 runtime_macro 50503 primary missing cerr; suggest macro_failed +src/ast/ast_typedecl.cpp 3785 internal_name 50628 internal DAS_VERIFY-only; not Program::error +src/ast/ast_typedecl.cpp 3788 internal_name 50628 internal DAS_VERIFY-only; not Program::error +src/ast/ast_typedecl.cpp 3807 internal_type 50637 internal DAS_VERIFY-only; typo: missing closing apostrophe in 'expecting '\]' +src/ast/ast_typedecl.cpp 3817 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 3820 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 3828 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 3831 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 3859 internal_annotation 50600 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 3861 internal_annotation 50600 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 3874 internal_structure 50632 internal DAS_VERIFY-only; logic-bug: condition is `stt.size()==1` but message says 'unknown' — should be ==0 +src/ast/ast_typedecl.cpp 3885 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 3887 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 3901 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 3930 internal_enumeration 50606 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 3945 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 4065 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 4072 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_typedecl.cpp 4107 internal_type 50637 internal DAS_VERIFY-only +src/ast/ast_validate.cpp 71 unspecified internal_type 50637 internal +src/ast/ast_validate.cpp 82 unspecified internal_expression 50607 internal +src/ast/ast_validate.cpp 294 unspecified internal_type 50637 internal +src/ast/ast_validate.cpp 302 unspecified internal_expression 50607 internal +src/ast/ast_parse.cpp 777 lookup_file 20603 primary +src/ast/ast_parse.cpp 870 module_does_not_have_a_name missing_module_name 20201 primary +src/ast/ast_parse.cpp 975 module_does_not_have_a_name missing_module_name 20201 primary +src/ast/ast_parse.cpp 998 module_required_from_shared invalid_module_require 20115 primary +src/ast/ast_parse.cpp 1149 module_not_found lookup_module 20605 primary +src/ast/ast_parse.cpp 1241 syntax_error internal_module 20901 internal recategorize: not a syntax error +src/ast/ast_parse.cpp 1249 syntax_error internal_module 20901 internal recategorize: not a syntax error; vague text — name the failing module +src/ast/ast_parse.cpp 1258 module_not_found already_declared_module 20510 primary recategorize: collision not lookup +src/ast/ast_parse.cpp 1267 module_not_found already_declared_module 20510 primary recategorize: collision not lookup +src/parser/ds2_lexer.lpp 89 syntax_error lookup_file 20603 primary +src/parser/ds2_lexer.lpp 97 invalid_line_directive invalid_line 10100 primary +src/parser/ds2_lexer.lpp 101 unexpected_close_comment invalid_line 10100 primary UNCLASSIFIED:comment subject — propose 'comment' +src/parser/ds2_lexer.lpp 158 comment_contains_eof exceeds_file 10301 primary +src/parser/ds2_lexer.lpp 162 string_constant_exceeds_file exceeds_file 10301 primary +src/parser/ds2_lexer.lpp 182 nested_string_constant invalid_string 10101 primary UNCLASSIFIED:string subject +src/parser/ds2_lexer.lpp 191 string_constant_exceeds_file exceeds_file 10301 primary +src/parser/ds2_lexer.lpp 217 string_constant_exceeds_file exceeds_file 10301 primary +src/parser/ds2_lexer.lpp 244 syntax_error lookup_file 20603 primary +src/parser/ds2_lexer.lpp 420 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 431 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 443 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 455 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 466 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 481 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 492 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 503 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 516 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 525 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 537 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 546 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 555 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 565 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 574 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 583 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 592 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 601 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 610 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds2_lexer.lpp 618 mismatching_parentheses mismatching_parens 10202 primary +src/parser/ds2_lexer.lpp 630 mismatching_parentheses mismatching_parens 10202 primary recategorize: square braces are not parens; propose mismatching_square_brackets +src/parser/ds2_lexer.lpp 651 mismatching_curly_bracers mismatching_curly_bracers 10200 primary wording: 'bracers' -> 'brackets' (also rename enum) +src/parser/ds2_lexer.lpp 809 mismatching_module_name 10201 primary UNCLASSIFIED:keyword subject; missing cerr — defaults to unspecified +src/parser/ds2_lexer.lpp 819 mismatching_module_name 10201 primary UNCLASSIFIED:keyword/type_function subject; missing cerr — defaults to unspecified +src/parser/ds2_parser.ypp 569 syntax_error invalid_module 20114 primary recategorize: ordering not syntax_error +src/parser/ds2_parser.ypp 628 module_already_has_a_name already_declared_module_name 20511 primary +src/parser/ds2_parser.ypp 669 invalid_escape_sequence invalid_escape 20105 primary +src/parser/ds2_parser.ypp 722 unsupported_read_macro lookup_macro 30821 primary +src/parser/ds2_parser.ypp 729 unsupported_read_macro ambiguous_macro 30608 primary +src/parser/ds2_parser.ypp 732 syntax_error invalid_macro 20113 primary +src/parser/ds2_parser.ypp 763 invalid_option invalid_options 50100 primary +src/parser/ds2_parser.ypp 1161 invalid_annotation lookup_annotation 20600 primary recategorize: it's a lookup miss not invalid +src/parser/ds2_parser.ypp 1166 invalid_annotation invalid_annotation 30100 primary +src/parser/ds2_parser.ypp 1179 invalid_annotation lookup_annotation 20600 primary recategorize: it's a lookup miss not invalid +src/parser/ds2_parser.ypp 1184 invalid_annotation invalid_annotation 30100 primary +src/parser/ds2_parser.ypp 1199 invalid_annotation invalid_annotation 30100 primary +src/parser/ds2_parser.ypp 1209 invalid_annotation invalid_annotation 30100 primary +src/parser/ds2_parser.ypp 1214 invalid_annotation invalid_annotation 30100 primary +src/parser/ds2_parser.ypp 1224 invalid_annotation invalid_annotation 30100 primary +src/parser/ds2_parser.ypp 1229 invalid_annotation invalid_annotation 30100 primary +src/parser/ds2_parser.ypp 1239 invalid_annotation invalid_annotation 30100 primary +src/parser/ds2_parser.ypp 1244 invalid_annotation invalid_annotation 30100 primary +src/parser/ds2_parser.ypp 1440 function_already_declared already_declared_function 30702 primary +src/parser/ds2_parser.ypp 2798 enumeration_value_already_declared already_declared_enumerator 20502 primary wording: 'enumeration already declared' -> 'enumeration value already declared' +src/parser/ds2_parser.ypp 2810 enumeration_value_already_declared already_declared_enumerator 20502 primary wording: 'enumeration already declared' -> 'enumeration value already declared' +src/parser/ds2_parser.ypp 2841 invalid_type invalid_type_alias 20121 primary +src/parser/ds2_parser.ypp 2846 type_alias_already_declared already_declared_type_alias 20513 primary +src/parser/ds2_parser.ypp 3191 invalid_type exceeds_bitfield 20300 primary recategorize: it's exceeds not invalid_type +src/parser/ds2_parser.ypp 3240 invalid_type invalid_array_type 30112 primary +src/parser/ds2_parser.ypp 3243 invalid_type invalid_array_type 30112 primary +src/parser/ds2_parser.ypp 3513 type_alias_already_declared already_declared_type_alias 20513 primary +src/parser/ds2_parser.ypp 3552 type_alias_already_declared already_declared_type_alias 20513 primary +src/parser/ds2_parser.ypp 3594 invalid_type exceeds_bitfield 20300 primary recategorize: it's exceeds not invalid_type +src/parser/ds2_parser.ypp 3603 type_alias_already_declared already_declared_type_alias 20513 primary +src/parser/ds2_parser.ypp 4036 invalid_expression 30151 primary UNCLASSIFIED:dispatcher — cerr passed through from caller +src/parser/ds2_parser.ypp 4042 syntax_error invalid_expression 30151 primary UNCLASSIFIED:dispatcher — defaults to syntax_error when caller passes none +src/parser/ds_lexer.lpp 89 syntax_error lookup_file 20603 primary +src/parser/ds_lexer.lpp 97 invalid_line_directive invalid_line 10100 primary +src/parser/ds_lexer.lpp 101 unexpected_close_comment invalid_line 10100 primary UNCLASSIFIED:comment subject — propose 'comment' +src/parser/ds_lexer.lpp 111 unexpected_close_comment invalid_line 10100 primary UNCLASSIFIED:comment subject — propose 'comment' +src/parser/ds_lexer.lpp 182 comment_contains_eof exceeds_file 10301 primary +src/parser/ds_lexer.lpp 186 string_constant_exceeds_file exceeds_file 10301 primary +src/parser/ds_lexer.lpp 206 nested_string_constant invalid_string 10101 primary UNCLASSIFIED:string subject +src/parser/ds_lexer.lpp 215 string_constant_exceeds_file exceeds_file 10301 primary +src/parser/ds_lexer.lpp 242 string_constant_exceeds_file exceeds_file 10301 primary +src/parser/ds_lexer.lpp 297 syntax_error invalid_line 10100 primary UNCLASSIFIED:indentation subject; missing cerr — defaults to syntax_error +src/parser/ds_lexer.lpp 304 syntax_error invalid_line 10100 primary UNCLASSIFIED:indentation subject; missing cerr — defaults to syntax_error +src/parser/ds_lexer.lpp 365 syntax_error lookup_file 20603 primary +src/parser/ds_lexer.lpp 553 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 564 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 576 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 588 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 599 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 614 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 625 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 636 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 649 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 658 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 670 integer_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 679 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 688 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 698 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 707 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 716 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 725 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 734 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 743 floating_point_constant_out_of_range exceeds_constant 10300 primary +src/parser/ds_lexer.lpp 751 mismatching_parentheses mismatching_parens 10202 primary +src/parser/ds_lexer.lpp 763 mismatching_parentheses mismatching_parens 10202 primary recategorize: square braces are not parens; propose mismatching_square_brackets +src/parser/ds_lexer.lpp 784 mismatching_curly_bracers mismatching_curly_bracers 10200 primary wording: 'bracers' -> 'brackets' (also rename enum) +src/parser/ds_lexer.lpp 989 mismatching_parentheses mismatching_curly_bracers 10200 primary recategorize: text says curly but cerr is mismatching_parentheses +src/parser/ds_lexer.lpp 1005 mismatching_parentheses mismatching_curly_bracers 10200 primary recategorize: text says curly but cerr is mismatching_parentheses +src/parser/ds_lexer.lpp 1009 mismatching_parentheses mismatching_parens 10202 primary recategorize: square braces; propose mismatching_square_brackets +src/parser/ds_lexer.lpp 1026 mismatching_parentheses mismatching_curly_bracers 10200 primary recategorize: text says curly but cerr is mismatching_parentheses +src/parser/ds_lexer.lpp 1030 mismatching_parentheses mismatching_parens 10202 primary recategorize: square braces; propose mismatching_square_brackets +src/parser/ds_lexer.lpp 1047 mismatching_parentheses mismatching_parens 10202 primary recategorize: square braces; propose mismatching_square_brackets +src/parser/ds_lexer.lpp 1064 mismatching_parentheses mismatching_parens 10202 primary recategorize: square braces; propose mismatching_square_brackets +src/parser/ds_lexer.lpp 1171 mismatching_module_name 10201 primary UNCLASSIFIED:keyword subject; missing cerr — defaults to unspecified +src/parser/ds_lexer.lpp 1181 mismatching_module_name 10201 primary UNCLASSIFIED:keyword/type_function subject; missing cerr — defaults to unspecified +src/parser/ds_parser.ypp 572 syntax_error invalid_module 20114 primary recategorize: ordering not syntax_error +src/parser/ds_parser.ypp 621 module_already_has_a_name already_declared_module_name 20511 primary +src/parser/ds_parser.ypp 662 invalid_escape_sequence invalid_escape 20105 primary +src/parser/ds_parser.ypp 715 unsupported_read_macro lookup_macro 30821 primary +src/parser/ds_parser.ypp 722 unsupported_read_macro ambiguous_macro 30608 primary +src/parser/ds_parser.ypp 725 syntax_error invalid_macro 20113 primary +src/parser/ds_parser.ypp 768 invalid_option invalid_options 50100 primary +src/parser/ds_parser.ypp 1043 invalid_annotation lookup_annotation 20600 primary recategorize: it's a lookup miss not invalid +src/parser/ds_parser.ypp 1047 invalid_annotation invalid_annotation 30100 primary +src/parser/ds_parser.ypp 1060 invalid_annotation lookup_annotation 20600 primary recategorize: it's a lookup miss not invalid +src/parser/ds_parser.ypp 1064 invalid_annotation invalid_annotation 30100 primary +src/parser/ds_parser.ypp 1079 invalid_annotation invalid_annotation 30100 primary +src/parser/ds_parser.ypp 1089 invalid_annotation invalid_annotation 30100 primary +src/parser/ds_parser.ypp 1094 invalid_annotation invalid_annotation 30100 primary +src/parser/ds_parser.ypp 1104 invalid_annotation invalid_annotation 30100 primary +src/parser/ds_parser.ypp 1109 invalid_annotation invalid_annotation 30100 primary +src/parser/ds_parser.ypp 1119 invalid_annotation invalid_annotation 30100 primary +src/parser/ds_parser.ypp 1124 invalid_annotation invalid_annotation 30100 primary +src/parser/ds_parser.ypp 1307 function_already_declared already_declared_function 30702 primary +src/parser/ds_parser.ypp 1507 cant_pipe cant_expression 30922 primary UNCLASSIFIED:pipe subject; wording: drop '[[ ]]' once gen2 is canonical +src/parser/ds_parser.ypp 1515 cant_pipe cant_expression 30922 primary UNCLASSIFIED:pipe subject; wording: drop '[[ ]]' once gen2 is canonical +src/parser/ds_parser.ypp 2466 syntax_error invalid_annotation 30100 primary recategorize: not syntax_error +src/parser/ds_parser.ypp 2778 enumeration_value_already_declared already_declared_enumerator 20502 primary wording: 'enumeration already declared' -> 'enumeration value already declared' +src/parser/ds_parser.ypp 2793 enumeration_value_already_declared already_declared_enumerator 20502 primary +src/parser/ds_parser.ypp 2825 invalid_type invalid_type_alias 20121 primary +src/parser/ds_parser.ypp 2830 type_alias_already_declared already_declared_type_alias 20513 primary +src/parser/ds_parser.ypp 3151 invalid_type exceeds_bitfield 20300 primary recategorize: it's exceeds not invalid_type +src/parser/ds_parser.ypp 3193 invalid_type invalid_array_type 30112 primary +src/parser/ds_parser.ypp 3196 invalid_type invalid_array_type 30112 primary +src/parser/ds_parser.ypp 3442 type_alias_already_declared already_declared_type_alias 20513 primary +src/parser/ds_parser.ypp 3478 type_alias_already_declared already_declared_type_alias 20513 primary +src/parser/ds_parser.ypp 3517 invalid_type exceeds_bitfield 20300 primary recategorize: it's exceeds not invalid_type +src/parser/ds_parser.ypp 3526 type_alias_already_declared already_declared_type_alias 20513 primary +src/parser/ds_parser.ypp 4098 invalid_expression 30151 primary UNCLASSIFIED:dispatcher — cerr passed through from caller +src/parser/ds_parser.ypp 4104 syntax_error invalid_expression 30151 primary UNCLASSIFIED:dispatcher — defaults to syntax_error when caller passes none +src/parser/parser_impl.cpp 18 invalid_expression 30151 primary UNCLASSIFIED:dispatcher — passes cerr through +src/parser/parser_impl.cpp 22 invalid_expression 30151 primary UNCLASSIFIED:dispatcher — passes cerr through +src/parser/parser_impl.cpp 27 invalid_name invalid_name 20116 primary +src/parser/parser_impl.cpp 123 cant_initialize cant_type 30950 primary UNCLASSIFIED:type-decl-default subject +src/parser/parser_impl.cpp 129 invalid_aka invalid_type_aka 20120 primary UNCLASSIFIED:aka modifier +src/parser/parser_impl.cpp 157 annotation_not_found lookup_annotation 20600 primary +src/parser/parser_impl.cpp 161 annotation_not_found ambiguous_annotation 30600 primary recategorize: ambiguous not lookup +src/parser/parser_impl.cpp 179 invalid_annotation runtime_annotation 20800 primary +src/parser/parser_impl.cpp 189 invalid_annotation invalid_annotation 30100 primary +src/parser/parser_impl.cpp 213 invalid_aka invalid_aka 20100 primary UNCLASSIFIED:aka subject +src/parser/parser_impl.cpp 244 invalid_override cant_structure 20701 primary recategorize: sealed-derive not override +src/parser/parser_impl.cpp 252 structure_not_found lookup_structure 20606 primary +src/parser/parser_impl.cpp 256 structure_not_found ambiguous_structure 30609 primary recategorize: ambiguous not lookup +src/parser/parser_impl.cpp 266 structure_already_declared already_declared_structure 20512 primary +src/parser/parser_impl.cpp 279 invalid_type already_declared_type_alias 20513 primary recategorize: already-declared not invalid_type +src/parser/parser_impl.cpp 288 invalid_type invalid_type_alias 20121 primary +src/parser/parser_impl.cpp 294 invalid_type already_declared_type_alias 20513 primary recategorize: already-declared not invalid_type +src/parser/parser_impl.cpp 310 invalid_override invalid_class 30134 primary recategorize: derive-mismatch not override +src/parser/parser_impl.cpp 313 invalid_override invalid_structure 30232 primary recategorize: derive-mismatch not override +src/parser/parser_impl.cpp 324 function_already_declared internal_function 50609 internal +src/parser/parser_impl.cpp 344 invalid_static invalid_field_static 20108 primary +src/parser/parser_impl.cpp 348 invalid_static invalid_field_static 20108 primary +src/parser/parser_impl.cpp 354 invalid_override invalid_field 20107 primary +src/parser/parser_impl.cpp 376 invalid_static already_declared_global 20507 primary recategorize: already-declared not invalid_static +src/parser/parser_impl.cpp 393 invalid_static already_declared_field_static 20504 primary recategorize: already-declared not invalid_static +src/parser/parser_impl.cpp 398 invalid_override invalid_field 20107 primary +src/parser/parser_impl.cpp 414 invalid_override already_declared_field 20503 primary recategorize: already-declared not invalid_override +src/parser/parser_impl.cpp 447 invalid_annotation runtime_annotation 20800 primary +src/parser/parser_impl.cpp 452 invalid_annotation invalid_annotation 30100 primary +src/parser/parser_impl.cpp 457 structure_already_declared already_declared_structure 20512 primary +src/parser/parser_impl.cpp 483 enumeration_already_declared already_declared_enumeration 20501 primary +src/parser/parser_impl.cpp 505 invalid_annotation runtime_annotation 20800 primary +src/parser/parser_impl.cpp 524 invalid_aka invalid_global_aka 20112 primary UNCLASSIFIED:aka modifier +src/parser/parser_impl.cpp 550 global_variable_already_declared already_declared_global 20507 primary +src/parser/parser_impl.cpp 568 global_variable_already_declared already_declared_global_bitfield 20508 primary +src/parser/parser_impl.cpp 582 invalid_aka invalid_global_aka 20112 primary UNCLASSIFIED:aka modifier +src/parser/parser_impl.cpp 614 global_variable_already_declared already_declared_global 20507 primary +src/parser/parser_impl.cpp 629 invalid_member_function invalid_function 20109 primary +src/parser/parser_impl.cpp 632 invalid_member_function invalid_function 20109 primary +src/parser/parser_impl.cpp 635 invalid_member_function invalid_function 20109 primary +src/parser/parser_impl.cpp 638 invalid_member_function invalid_function_annotation 20110 primary +src/parser/parser_impl.cpp 642 invalid_member_function missing_function_result 30310 primary recategorize: missing-return-type not invalid_member_function +src/parser/parser_impl.cpp 645 invalid_member_function invalid_function 20109 primary +src/parser/parser_impl.cpp 687 invalid_type ambiguous_function_argument_type 20402 primary recategorize: ambiguous not invalid_type +src/parser/parser_impl.cpp 694 function_already_declared already_declared_function 30702 primary +src/parser/parser_impl.cpp 707 invalid_member_function internal_function 50609 internal recategorize: internal not invalid_member_function +src/parser/parser_impl.cpp 710 invalid_member_function invalid_function 20109 primary +src/parser/parser_impl.cpp 713 invalid_member_function invalid_function 20109 primary +src/parser/parser_impl.cpp 717 invalid_member_function invalid_function 20109 primary +src/parser/parser_impl.cpp 731 function_already_declared already_declared_function 30702 primary +src/parser/parser_impl.cpp 771 invalid_member_function invalid_function 20109 primary +src/parser/parser_impl.cpp 775 invalid_member_function invalid_function 20109 primary +src/parser/parser_impl.cpp 781 invalid_member_function invalid_function_static 20111 primary +src/parser/parser_impl.cpp 791 function_already_declared already_declared_function 30702 primary wording: typo 'intializer' -> 'initializer' +src/parser/parser_impl.cpp 811 function_already_declared already_declared_function 30702 primary +src/parser/parser_impl.cpp 829 type_not_found ambiguous_enumeration 30603 primary recategorize: ambiguous not lookup +src/parser/parser_impl.cpp 832 type_not_found lookup_enumeration 20602 primary +src/parser/parser_impl.cpp 850 bitfield_not_found lookup_bitfield 30802 primary +src/parser/parser_impl.cpp 854 syntax_error invalid_type 30262 primary recategorize: kind-mismatch not syntax_error +src/parser/parser_impl.cpp 910 argument_already_declared already_declared_block_argument 30701 primary +src/parser/parser_impl.cpp 922 invalid_capture invalid_capture 20103 primary +src/parser/parser_impl.cpp 933 invalid_annotation runtime_annotation 20800 primary +src/parser/parser_impl.cpp 937 invalid_annotation invalid_annotation 30100 primary +src/parser/parser_impl.cpp 985 local_variable_already_declared already_declared_local 20509 primary +src/parser/parser_impl.cpp 1034 local_variable_already_declared already_declared_local 20509 primary +src/parser/parser_impl.cpp 1078 argument_already_declared already_declared_function_argument 20506 primary +src/parser/parser_impl.cpp 1110 module_not_found already_declared_module 20510 primary recategorize: alias-conflict not lookup +src/parser/parser_impl.cpp 1119 module_not_found lookup_module 20605 primary +src/parser/parser_impl.cpp 1180 cant_pipe cant_expression 30922 primary UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp 1183 cant_pipe cant_expression 30922 primary UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp 1188 cant_pipe cant_expression 30922 primary UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp 1195 cant_pipe cant_expression 30922 primary UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp 1204 cant_pipe cant_expression 30922 primary UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp 1235 cant_pipe cant_expression 30922 primary UNCLASSIFIED:pipe subject +src/parser/parser_impl.cpp 1289 syntax_error invalid_capture 20103 primary recategorize: not syntax_error +src/builtin/module_builtin_ast.cpp 352 macro_failed runtime_macro 50503 primary +src/builtin/module_builtin_ast.cpp 357 performance_lint runtime_macro_performance 31208 primary UNCLASSIFIED:performance_lint is a lint-warning facet not in taxonomy; needs `lint` facet or dedicated `performance` tag +src/builtin/module_builtin_ast.cpp 362 style_lint runtime_macro_style 31209 primary UNCLASSIFIED:style_lint is a lint-warning facet not in taxonomy; needs `lint` facet or dedicated `style` tag +src/builtin/module_builtin_ast_adapters.cpp 24 exception_during_macro runtime_macro_exception 31206 primary +src/builtin/module_builtin_math.cpp 257 index_out_of_range exceeds_array_index 30502 primary +src/builtin/module_builtin_runtime.cpp 188 invalid_macro_context 30203 primary UNCLASSIFIED:no current_cerr; site needs an enum value (likely `unsupported_call_macro` or new `invalid_macro_context`) +src/simulate/bin_serializer.cpp 40 exceeds_runtime_buffer 50302 primary UNCLASSIFIED:runtime guard via DataWalker::error; no compile-time enum; subject `buffer` not in taxonomy +src/simulate/bin_serializer.cpp 76 mismatching_runtime_type 50200 primary UNCLASSIFIED:runtime guard; runtime-mismatch facet not modeled +src/simulate/bin_serializer.cpp 89 mismatching_runtime_type_hash 50201 primary UNCLASSIFIED:runtime guard; runtime-mismatch facet not modeled +src/simulate/bin_serializer.cpp 122 cant_serialize_table 50407 primary UNCLASSIFIED:runtime guard via DataWalker::error; verb `serialize` not modeled in taxonomy +src/simulate/bin_serializer.cpp 125 cant_serialize_pointer 50406 primary UNCLASSIFIED:subject `pointer` not in taxonomy; runtime guard +src/simulate/bin_serializer.cpp 250 cant_serialize_null_pointer 50405 primary UNCLASSIFIED:subject `pointer` not in taxonomy; runtime guard +src/simulate/bin_serializer.cpp 253 cant_serialize_pointer 50406 primary UNCLASSIFIED:subject `pointer` not in taxonomy; runtime guard +src/simulate/bin_serializer.cpp 256 cant_serialize_iterator 50404 primary UNCLASSIFIED:subject `iterator` not in taxonomy; runtime guard +src/simulate/bin_serializer.cpp 259 cant_serialize_block 50403 primary UNCLASSIFIED:runtime guard; verb `serialize` not modeled +src/simulate/hash.cpp 56 cant_hash_iterator 50402 primary UNCLASSIFIED:subject `iterator` not in taxonomy; runtime guard +src/simulate/hash.cpp 57 cant_hash_block 50400 primary UNCLASSIFIED:runtime guard; verb `hash` not modeled +src/simulate/hash.cpp 58 cant_hash_context 50401 primary UNCLASSIFIED:subject `context` not in taxonomy; runtime guard diff --git a/doc/internal/error_audit_recategorize.tsv b/doc/internal/error_audit_recategorize.tsv new file mode 100644 index 0000000000..6fb54db107 --- /dev/null +++ b/doc/internal/error_audit_recategorize.tsv @@ -0,0 +1,62 @@ +file line old_cerr new_name note +src/ast/ast_infer_type.cpp 570 cant_infer_generic already_declared_function recategorize: cant_infer_generic - actually a name collision; should be already_declared_function +src/ast/ast_infer_type.cpp 936 invalid_type cant_dereference recategorize: invalid_type - actually a deref fault; should be cant_dereference +src/ast/ast_infer_type.cpp 940 invalid_type cant_dereference recategorize: invalid_type - should be cant_dereference +src/ast/ast_infer_type.cpp 977 type_not_found invalid_function_type recategorize: type_not_found - actually wrong-type fault; should be invalid_function_type +src/ast/ast_infer_type.cpp 997 function_not_found cant_address_template_function recategorize: function_not_found - actually a forbidden-op; should be cant_address_template_function +src/ast/ast_infer_type.cpp 1036 type_not_found cant_address_function recategorize: type_not_found - actually forbidden; should be cant_address_builtin_function +src/ast/ast_infer_type.cpp 1165 cant_dereference invalid_null_coalescing_type recategorize: cant_dereference - actually type-mismatch; should be invalid_null_coalescing_type +src/ast/ast_infer_type.cpp 1168 cant_dereference invalid_null_coalescing_type recategorize: cant_dereference - actually type-mismatch +src/ast/ast_infer_type.cpp 2050 type_not_found invalid_typeinfo_dim_table_type recategorize: type_not_found - actually wrong-type fault +src/ast/ast_infer_type.cpp 2055 type_not_found invalid_typeinfo_dim_table_type recategorize: type_not_found - actually wrong-type fault +src/ast/ast_infer_type.cpp 2777 type_not_found invalid_cast_type recategorize: type_not_found - actually a cast-mismatch +src/ast/ast_infer_type.cpp 3003 invalid_table_type cant_index_table recategorize: invalid_table_type - cant operation; should be cant_index_const_table +src/ast/ast_infer_type.cpp 3298 variable_not_found already_declared_block_argument recategorize: variable_not_found - shadowing not lookup miss; should be already_declared_block_argument +src/ast/ast_infer_type.cpp 3308 variable_not_found already_declared_block_argument recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 3315 variable_not_found already_declared_block_argument recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 3321 variable_not_found already_declared_block_argument recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 3515 invalid_type invalid_as recategorize: invalid_type - actually wrong-construct; should be invalid_as_non_variant +src/ast/ast_infer_type.cpp 3570 invalid_type invalid_safe_as recategorize: invalid_type - actually wrong-construct +src/ast/ast_infer_type.cpp 3625 invalid_type invalid_is recategorize: invalid_type - actually wrong-construct +src/ast/ast_infer_type.cpp 4220 invalid_return_type unsafe_return_reference recategorize: invalid_return_type - actually unsafe; should be unsafe_return_reference +src/ast/ast_infer_type.cpp 4224 invalid_return_type unsafe_return_block recategorize: invalid_return_type - actually unsafe +src/ast/ast_infer_type.cpp 4260 invalid_return_type unsafe_return_reference recategorize: invalid_return_type - actually unsafe +src/ast/ast_infer_type.cpp 4264 invalid_return_type unsafe_return_function recategorize: invalid_return_type - actually unsafe +src/ast/ast_infer_type.cpp 4583 variable_not_found already_declared_with_shadow recategorize: variable_not_found - shadowing not lookup miss +src/ast/ast_infer_type.cpp 4697 variable_not_found already_declared_variable recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4705 variable_not_found already_declared_variable recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4713 variable_not_found already_declared_variable recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4720 variable_not_found already_declared_variable recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4726 variable_not_found already_declared_variable recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4872 variable_not_found already_declared_local_variable recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4880 variable_not_found already_declared_local_variable recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4888 variable_not_found already_declared_local_variable recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4895 variable_not_found already_declared_local_variable recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4901 variable_not_found already_declared_local_variable recategorize: variable_not_found - shadowing +src/ast/ast_infer_type.cpp 4935 invalid_variable_type unsafe_local_type recategorize: invalid_variable_type - actually unsafe +src/ast/ast_infer_type.cpp 5018 invalid_variable_type unsafe_local_in_scope_required recategorize: invalid_variable_type - actually unsafe +src/ast/ast_infer_type.cpp 5202 too_many_infer_passes exceeds_call_depth recategorize: too_many_infer_passes - actually call depth not infer passes +src/ast/ast_infer_type.cpp 5231 too_many_infer_passes exceeds_call_depth recategorize: too_many_infer_passes - actually call depth +src/ast/ast_infer_type.cpp 5363 too_many_infer_passes exceeds_call_depth recategorize: too_many_infer_passes - actually call depth +src/ast/ast_infer_type.cpp 5663 expecting_return_value invalid_string_builder_argument recategorize: expecting_return_value - misnamed; actual fault is void argument +src/ast/ast_infer_type_function.cpp 1064 invalid_argument_type missing cerr; assign invalid_argument_type +src/ast/ast_infer_type_function.cpp 1109 recursion_argument missing cerr; assign recursion-related code +src/ast/ast_infer_type_function.cpp 1119 recursion_function missing cerr; assign recursion-related code +src/ast/ast_infer_type_function.cpp 1391 function_not_found cant_access_private_structure recategorize from function_not_found to invalid_private/cant_access_private +src/ast/ast_infer_type_helper.cpp 892 cant_get_field cant_access_private_field recategorize from cant_get_field to invalid_private/cant_access_private +src/ast/ast_infer_type_make.cpp 42 type_not_found invalid_generator recategorize: not a lookup miss; cerr should be invalid_type +src/ast/ast_infer_type_make.cpp 389 invalid_type cant_variant_field recategorize: cerr is invalid_type but error is about copy semantics +src/ast/ast_infer_type_make.cpp 427 type_not_found invalid_variant recategorize: not a lookup miss; cerr should be invalid_type +src/ast/ast_infer_type_make.cpp 611 invalid_type cant_structure_field recategorize: cerr is invalid_type but error is about copy semantics +src/ast/ast_infer_type_make.cpp 622 cant_get_field cant_initialize_private_field recategorize: cerr is cant_get_field; should be invalid_private +src/ast/ast_infer_type_make.cpp 685 invalid_type cant_annotation_field recategorize: cerr is invalid_type but error is about copy semantics +src/ast/ast_infer_type_op.cpp 710 operator_not_found mismatching_clone_type recategorize: cerror operator_not_found wrong; this is type-mismatch on clone (use mismatching_type) +src/ast/ast_infer_type_report.cpp 607 function_already_declared missing_finalizer recategorize: function_already_declared wrong cerr for missing finalizer (verbose path uses reportMissing which keeps it; non-verbose path emits as-is) +src/ast/ast.cpp 3076 structure_not_found ambiguous_structure recategorize: structure_not_found when multiple found is wrong; should be ambiguous_structure +src/ast/ast.cpp 3088 handle_not_found invalid_annotation recategorize: handle_not_found is misleading; this is a type-mismatch on the resolved annotation +src/ast/ast.cpp 3094 handle_not_found ambiguous_annotation recategorize: handle_not_found should be ambiguous_annotation when multiple found +src/ast/ast.cpp 3106 enumeration_not_found ambiguous_enumeration recategorize: enumeration_not_found should be ambiguous_enumeration when multiple found +src/ast/ast.cpp 3117 type_alias_not_found ambiguous_type_alias recategorize: type_alias_not_found should be ambiguous_type_alias when multiple found +src/ast/ast.cpp 3146 function_not_found ambiguous_function recategorize: function_not_found should be ambiguous_function when multiple found +src/ast/ast_lint.cpp 417 variable_not_found recursion_global recategorize: variable_not_found is wrong; this is initialization-recursion +src/ast/ast_lint.cpp 437 variable_not_found invalid_global recategorize: variable_not_found is wrong; this is initialization-order diff --git a/doc/internal/error_audit_taxonomy.md b/doc/internal/error_audit_taxonomy.md new file mode 100644 index 0000000000..d5eb96721f --- /dev/null +++ b/doc/internal/error_audit_taxonomy.md @@ -0,0 +1,103 @@ +# Error-tag taxonomy for daslang error-code audit + +This is the canonical vocabulary that ALL inventory agents share. The output +column `tag_composition` MUST draw tags only from these lists. If a site +genuinely needs a tag not present here, add it to `tag_composition` AND emit +an `UNCLASSIFIED:` note in the `wording_change` column so we can +review and add to taxonomy. + +The proposed enum name is composed in fixed order: + + _[_] + +So `function | argument | type | invalid` -> `invalid_function_argument_type`. +Multi-subject errors order by importance: function > argument > type, etc. +When unsure, prefer the order shown below (more general -> more specific). + +--- + +## Facets (the kind of fault) + +| facet | meaning | examples of old codes | +|---|---|---| +| `invalid` | the construct itself is malformed | invalid_type, invalid_argument_type, invalid_swizzle_mask | +| `lookup` | identifier didn't resolve to anything (was: `_not_found`) | type_not_found, variable_not_found, function_not_found | +| `ambiguous` | identifier resolves to multiple candidates | function_not_found_ambiguous | +| `already_declared` | name collision | type_alias_already_declared, structure_already_declared | +| `cant` | operation forbidden in this context (was: `cant_`) | cant_get_field, cant_index, cant_dereference, cant_be_null | +| `mismatching` | two things expected to match don't | mismatching_parentheses, mismatching_curly_bracers | +| `not_resolved_yet` | follow-on; might resolve in a later pass | (new — replaces several "is not fully resolved yet" sites) | +| `internal` | compiler invariant violation; not user fault | (new — for current `unspecified` validate_ast / changed-fn sites) | +| `exceeds` | size/count limit busted | too_many_arguments, integer_constant_out_of_range, comment_contains_eof | +| `unsafe` | requires `unsafe()` block | (existing CompilationError::unsafe code) | +| `runtime` | exception during compile-time evaluation | exception_during_macro | +| `missing` | required thing absent (return path, init, etc) | not_all_paths_return_a_value | +| `recursion` | unbounded / forbidden recursion | (currently emitted as 4-arg uncoded errors) | +| `runtime` | exception/error during the runtime side of compile-time eval (DataWalker, hash, serializer) | (added 2026-05-06) | +| `performance_lint` | perf-lint warning — distinct output channel from primary errors | (added 2026-05-06) | +| `style_lint` | style-lint warning | (added 2026-05-06) | + +## Subjects (what construct) + +``` +type, name, function, argument, result, parameter, body, +structure, field, class, interface, +enumeration, enumerator, +variable, global, local, constant, +type_alias, bitfield, +array, table, tuple, variant, +lambda, generator, block, +macro, module, require, options, annotation, +expression, statement, label, +file, line, escape, +string, comment, indentation, // added 2026-05-06 for parser/lexer +iterator, pointer, buffer, context, // added 2026-05-06 for runtime/builtin +``` + +If a subject is missing, add it AND flag `UNCLASSIFIED:` in +`wording_change` so we can add to taxonomy on review. + +## Modifiers (rare, only when needed to disambiguate) + +``` +mix — heterogeneous types (e.g. invalid_argument_count_mix) +ref — reference variant +ambiguous, sealed, override, void, auto, +loop, redirect, +``` + +--- + +## Classification (in column `classification`) + +One of: + +- `primary` — first-fault, user-facing, should always emit +- `follow_on` — fires *because* of an earlier primary; should be `not_resolved_yet`-tagged or `verbose`-gated +- `mid_inference` — emits every infer pass; expensive describe()/candidate computation; should be `verbose`-gated +- `internal` — invariant violation / compiler-bug path; should carry an `internal_*` tag +- `wording_fix` — text needs cleanup (typos, vague phrasing) regardless of code +- `recategorize` — current cerr is wrong; needs reassignment + +A site can have ONE classification. If multiple apply, pick the most +significant in this order: `internal > mid_inference > follow_on > recategorize > wording_fix > primary`. + +## CSV format (one row per `error(...)` call site) + +Columns in order, comma-separated, fields with commas/quotes/newlines wrapped in +double-quotes (CSV standard): + +``` +file, line, current_cerr, message_template, context_function, +classification, tag_composition, proposed_enum_name, wording_change +``` + +- `file` — repo-relative path, forward slashes (e.g. `src/ast/ast_infer_type.cpp`) +- `line` — 1-based line number of the `error(` call +- `current_cerr` — enum value passed (e.g. `type_not_found`, `unspecified`); empty if not passed +- `message_template` — first ~80 chars of the error message; replace `+ var +` and string concat with ``; trim trailing punctuation +- `context_function` — surrounding C++ function name (best effort) +- `classification` — one of the six labels above +- `tag_composition` — pipe-separated tags from facets/subjects/modifiers, e.g. `invalid | function | argument | type` +- `proposed_enum_name` — the composed name, e.g. `invalid_function_argument_type` +- `wording_change` — empty if no change; else terse note (e.g. `typo: subexpresion -> subexpression`); UNCLASSIFIED markers go here too diff --git a/doc/internal/error_audit_uniques.tsv b/doc/internal/error_audit_uniques.tsv new file mode 100644 index 0000000000..35a5b54e13 --- /dev/null +++ b/doc/internal/error_audit_uniques.tsv @@ -0,0 +1,562 @@ +new_num new_name facet stage site_count sample_old_cerrs +10100 invalid_line invalid 1 7 invalid_line_directive,syntax_error,unexpected_close_comment +10101 invalid_string invalid 1 2 nested_string_constant +10200 mismatching_curly_bracers mismatching 1 5 mismatching_curly_bracers,mismatching_parentheses +10201 mismatching_module_name mismatching 1 4 (empty) +10202 mismatching_parens mismatching 1 8 mismatching_parentheses +10300 exceeds_constant exceeds 1 38 floating_point_constant_out_of_range,integer_constant_out_of_range +10301 exceeds_file exceeds 1 8 comment_contains_eof,string_constant_exceeds_file +20100 invalid_aka invalid 2 1 invalid_aka +20103 invalid_capture invalid 2 2 invalid_capture,syntax_error +20105 invalid_escape invalid 2 2 invalid_escape_sequence +20107 invalid_field invalid 2 2 invalid_override +20108 invalid_field_static invalid 2 2 invalid_static +20109 invalid_function invalid 2 9 invalid_member_function +20110 invalid_function_annotation invalid 2 1 invalid_member_function +20111 invalid_function_static invalid 2 1 invalid_member_function +20112 invalid_global_aka invalid 2 2 invalid_aka +20113 invalid_macro invalid 2 2 syntax_error +20114 invalid_module invalid 2 2 syntax_error +20115 invalid_module_require invalid 2 1 module_required_from_shared +20116 invalid_name invalid 2 1 invalid_name +20120 invalid_type_aka invalid 2 1 invalid_aka +20121 invalid_type_alias invalid 2 3 invalid_type +20201 missing_module_name missing 2 2 module_does_not_have_a_name +20300 exceeds_bitfield exceeds 2 4 invalid_type +20402 ambiguous_function_argument_type ambiguous 2 1 invalid_type +20501 already_declared_enumeration already_declared 2 1 enumeration_already_declared +20502 already_declared_enumerator already_declared 2 4 enumeration_value_already_declared +20503 already_declared_field already_declared 2 1 invalid_override +20504 already_declared_field_static already_declared 2 1 invalid_static +20506 already_declared_function_argument already_declared 2 1 argument_already_declared +20507 already_declared_global already_declared 2 3 global_variable_already_declared,invalid_static +20508 already_declared_global_bitfield already_declared 2 1 global_variable_already_declared +20509 already_declared_local already_declared 2 2 local_variable_already_declared +20510 already_declared_module already_declared 2 3 module_not_found +20511 already_declared_module_name already_declared 2 2 module_already_has_a_name +20512 already_declared_structure already_declared 2 2 structure_already_declared +20513 already_declared_type_alias already_declared 2 10 invalid_type,type_alias_already_declared +20600 lookup_annotation lookup 2 5 annotation_not_found,invalid_annotation +20602 lookup_enumeration lookup 2 1 type_not_found +20603 lookup_file lookup 2 5 (empty),syntax_error +20605 lookup_module lookup 2 2 module_not_found +20606 lookup_structure lookup 2 1 structure_not_found +20701 cant_structure cant 2 1 invalid_override +20800 runtime_annotation runtime 2 4 invalid_annotation +20901 internal_module internal 2 2 syntax_error +30100 invalid_annotation invalid 3 23 handle_not_found,invalid_annotation,syntax_error +30101 invalid_annotation_field invalid 3 1 cant_get_field +30102 invalid_annotation_macro invalid 3 1 invalid_annotation +30103 invalid_annotation_type invalid 3 1 invalid_type +30104 invalid_argument invalid 3 6 argument_aliasing +30105 invalid_argument_global invalid 3 4 argument_aliasing +30106 invalid_argument_name invalid 3 3 invalid_name +30107 invalid_argument_type invalid 3 3 (empty),invalid_argument_type +30108 invalid_array invalid 3 6 invalid_array_type,invalid_type +30109 invalid_array_dimension invalid 3 5 invalid_array_dimension,invalid_type +30110 invalid_array_dimension_type invalid 3 1 invalid_array_dimension +30111 invalid_array_element_type invalid 3 1 invalid_type +30112 invalid_array_type invalid 3 5 invalid_type +30113 invalid_as invalid 3 1 invalid_type +30114 invalid_ascend_array_handle_type invalid 3 1 invalid_new_type +30115 invalid_ascend_handle_type invalid 3 1 invalid_new_type +30116 invalid_assert_argument_count invalid 3 1 invalid_argument_count +30117 invalid_assert_comment_type invalid 3 1 invalid_argument_type +30118 invalid_assert_condition_type invalid 3 1 invalid_argument_type +30119 invalid_bitfield invalid 3 1 cant_get_field +30120 invalid_bitfield_cast_argument_count invalid 3 1 invalid_cast +30121 invalid_block_argument invalid 3 2 invalid_block,unused_block_argument +30122 invalid_block_argument_count invalid 3 1 invalid_block +30123 invalid_block_argument_init_type invalid 3 3 cant_infer_mismatching_restrictions,invalid_argument_type +30124 invalid_block_argument_type invalid 3 1 invalid_type +30125 invalid_block_break invalid 3 1 invalid_block +30126 invalid_block_continue invalid 3 1 invalid_block +30127 invalid_block_finally invalid 3 1 return_or_break_in_finally +30128 invalid_break invalid 3 1 invalid_loop +30129 invalid_capture_variable invalid 3 1 invalid_capture +30130 invalid_cast_function invalid 3 1 invalid_cast +30131 invalid_cast_structure invalid 3 2 invalid_cast +30132 invalid_cast_structure_pointer invalid 3 2 invalid_cast +30133 invalid_cast_type invalid 3 1 type_not_found +30134 invalid_class invalid 3 2 invalid_override,invalid_type +30135 invalid_class_local invalid 3 1 invalid_type +30136 invalid_class_tuple invalid 3 1 invalid_type +30137 invalid_class_variant invalid 3 1 invalid_type +30138 invalid_clone_smart_pointer_type invalid 3 1 invalid_type +30139 invalid_comprehension_element_type invalid 3 1 invalid_type +30140 invalid_continue invalid 3 1 invalid_loop +30141 invalid_debug_argument_count invalid 3 1 invalid_argument_count +30142 invalid_debug_comment_type invalid 3 1 invalid_argument_type +30143 invalid_delete_size_type invalid 3 1 bad_delete +30144 invalid_delete_super_self_type invalid 3 1 bad_delete +30145 invalid_enumeration invalid 3 1 invalid_type +30146 invalid_enumeration_name invalid 3 1 invalid_name +30147 invalid_enumerator invalid 3 1 invalid_enumeration +30148 invalid_enumerator_name invalid 3 1 invalid_name +30149 invalid_enumerator_type invalid 3 1 invalid_enumeration +30150 invalid_erase_argument_count invalid 3 1 invalid_argument_count +30151 invalid_expression invalid 3 17 (empty),aot_side_effects,assert_with_side_effects,make_local_aliasing,syntax_error,top_level_no_sideeffect_operation +30152 invalid_field_name invalid 3 1 invalid_name +30153 invalid_field_syntax invalid 3 1 cant_get_field +30154 invalid_field_type invalid 3 1 cant_get_field +30155 invalid_finally_in_generator_if invalid 3 2 invalid_yield +30156 invalid_find_argument_count invalid 3 1 invalid_argument_count +30157 invalid_for_iterator_count invalid 3 1 invalid_loop +30158 invalid_for_iterator_tuple invalid 3 1 invalid_iteration_source +30159 invalid_function_argument invalid 3 3 aot_side_effects,invalid_argument_type,unused_function_argument +30160 invalid_function_argument_count invalid 3 1 invalid_argument_count +30161 invalid_function_argument_type invalid 3 4 cant_infer_generic,invalid_type +30162 invalid_function_argument_type_block invalid 3 1 invalid_argument_type +30163 invalid_function_name invalid 3 1 invalid_name +30164 invalid_function_options invalid 3 1 no_init +30165 invalid_function_result invalid 3 1 invalid_type +30166 invalid_function_result_discarded invalid 3 1 result_discarded +30167 invalid_function_result_type invalid 3 2 invalid_return_type +30168 invalid_function_type invalid 3 1 type_not_found +30169 invalid_generator invalid 3 1 type_not_found +30170 invalid_generator_argument_count invalid 3 2 invalid_argument_count,invalid_argument_type +30171 invalid_generator_argument_type invalid 3 1 invalid_argument_type +30172 invalid_generator_result_type invalid 3 1 invalid_argument_type +30173 invalid_global invalid 3 1 variable_not_found +30174 invalid_global_init_options invalid 3 1 no_init +30175 invalid_global_init_type invalid 3 3 cant_infer_mismatching_restrictions,invalid_initialization_type +30176 invalid_global_options invalid 3 1 no_global_variables +30177 invalid_global_self_init invalid 3 1 variable_not_found +30178 invalid_global_shared invalid 3 1 invalid_variable_type +30179 invalid_global_type invalid 3 3 invalid_variable_type +30180 invalid_global_type_shared invalid 3 1 invalid_variable_type +30181 invalid_handle_index_type invalid 3 1 invalid_index_type +30182 invalid_handle_safe_index_type invalid 3 1 invalid_index_type +30183 invalid_if_condition_type invalid 3 1 condition_must_be_bool +30184 invalid_index_type invalid 3 7 invalid_index_type +30185 invalid_insert_argument_count invalid 3 1 invalid_argument_count +30186 invalid_invoke_argument_count invalid 3 3 invalid_argument_count +30187 invalid_invoke_argument_type invalid 3 2 invalid_argument_count,invalid_argument_type +30188 invalid_invoke_method_syntax invalid 3 2 invalid_argument_count +30189 invalid_invoke_target_type invalid 3 3 invalid_argument_count,invalid_argument_type +30190 invalid_is invalid 3 1 invalid_type +30191 invalid_is_expression invalid 3 1 typeinfo_auto +30192 invalid_iteration_source_type invalid 3 1 invalid_iteration_source +30193 invalid_key_exists_argument_count invalid 3 1 invalid_argument_count +30194 invalid_label_type invalid 3 1 invalid_label +30195 invalid_local_in_scope invalid 3 1 invalid_variable_type +30196 invalid_local_in_scope_finally invalid 3 1 invalid_variable_type +30197 invalid_local_init invalid 3 3 invalid_initialization_type +30198 invalid_local_init_block invalid 3 1 invalid_initialization_type +30199 invalid_local_init_constructor invalid 3 1 invalid_initialization_type +30200 invalid_local_init_type invalid 3 4 cant_infer_mismatching_restrictions,invalid_initialization_type +30201 invalid_local_tuple_expansion invalid 3 1 invalid_type +30202 invalid_local_type invalid 3 1 invalid_variable_type +30203 invalid_macro_context invalid 3 1 (empty) +30204 invalid_macro_read invalid 3 1 unsupported_read_macro +30205 invalid_macro_tag invalid 3 1 unbound_macro_tag +30206 invalid_macro_type invalid 3 1 invalid_type +30207 invalid_memzero_argument invalid 3 1 invalid_argument_type +30208 invalid_memzero_argument_count invalid 3 1 invalid_argument_count +30209 invalid_memzero_argument_type invalid 3 1 invalid_argument_type +30210 invalid_module_name invalid 3 1 invalid_name +30211 invalid_new_class_syntax invalid 3 1 invalid_new_type +30212 invalid_new_initializer_result_type invalid 3 1 invalid_new_type +30213 invalid_new_initializer_type invalid 3 1 invalid_new_type +30214 invalid_new_type invalid 3 5 invalid_new_type +30215 invalid_null_coalescing_type invalid 3 2 cant_dereference +30216 invalid_op3_expression invalid 3 1 operator_not_found +30218 invalid_pointer_arithmetic invalid 3 2 operator_not_found +30219 invalid_quote_argument_count invalid 3 1 invalid_argument_count +30220 invalid_result invalid 3 1 invalid_return_type +30221 invalid_result_type invalid 3 5 invalid_return_type +30222 invalid_return_semantics invalid 3 2 invalid_return_semantics +30223 invalid_safe_as invalid 3 1 invalid_type +30224 invalid_safe_dereference_type invalid 3 3 cant_get_field +30225 invalid_safe_field_type invalid 3 1 cant_get_field +30226 invalid_static_assert_argument_count invalid 3 1 invalid_argument_count +30227 invalid_static_assert_comment_type invalid 3 1 invalid_argument_type +30228 invalid_static_assert_condition_type invalid 3 1 invalid_argument_type +30229 invalid_static_if_condition invalid 3 1 condition_must_be_static +30230 invalid_storage_type_op invalid 3 1 operator_not_found +30231 invalid_string_builder_argument invalid 3 2 expecting_return_value,invalid_type +30232 invalid_structure invalid 3 3 invalid_override,invalid_type +30233 invalid_structure_annotation invalid 3 1 invalid_annotation +30234 invalid_structure_array invalid 3 1 invalid_type +30235 invalid_structure_block_pipe invalid 3 1 invalid_block +30236 invalid_structure_field_init invalid 3 1 invalid_initialization_type +30237 invalid_structure_field_type invalid 3 3 invalid_structure_field_type +30238 invalid_structure_initializer_required invalid 3 1 invalid_type +30239 invalid_structure_local invalid 3 1 invalid_type +30240 invalid_structure_name invalid 3 1 invalid_name +30241 invalid_structure_template invalid 3 1 invalid_type +30242 invalid_structure_tuple invalid 3 1 invalid_type +30243 invalid_structure_type invalid 3 1 invalid_type +30244 invalid_structure_variant invalid 3 1 invalid_type +30245 invalid_super_call invalid 3 2 function_not_found +30246 invalid_swizzle_mask invalid 3 1 invalid_swizzle_mask +30247 invalid_swizzle_type invalid 3 1 invalid_swizzle_mask +30248 invalid_table invalid 3 2 invalid_table_type +30249 invalid_table_argument_type invalid 3 4 invalid_argument_type +30250 invalid_table_expression invalid 3 1 table_lookup_collision +30251 invalid_table_index_type invalid 3 1 invalid_index_type +30252 invalid_table_key_type invalid 3 4 invalid_argument_type +30253 invalid_table_safe_index_type invalid 3 2 invalid_index_type +30254 invalid_table_type invalid 3 2 invalid_table_type,invalid_type +30255 invalid_tuple invalid 3 4 invalid_type +30256 invalid_tuple_argument_type invalid 3 1 invalid_type +30257 invalid_tuple_block invalid 3 1 invalid_block +30258 invalid_tuple_key invalid 3 1 invalid_table_type +30259 invalid_tuple_key_type invalid 3 1 invalid_table_type +30260 invalid_tuple_type invalid 3 2 invalid_type +30261 invalid_tuple_variant invalid 3 1 invalid_type +30262 invalid_type invalid 3 10 invalid_new_type,invalid_type,syntax_error +30263 invalid_type_dimension invalid 3 1 invalid_type +30264 invalid_type_expression invalid 3 1 invalid_type +30265 invalid_typeinfo invalid 3 1 typeinfo_auto +30266 invalid_typeinfo_annotation invalid 3 1 typeinfo_undefined +30267 invalid_typeinfo_annotation_argument_type invalid 3 1 typeinfo_undefined +30268 invalid_typeinfo_dim invalid 3 1 typeinfo_dim +30269 invalid_typeinfo_dim_table invalid 3 1 typeinfo_dim +30270 invalid_typeinfo_dim_table_type invalid 3 2 type_not_found +30271 invalid_typeinfo_function invalid 3 1 typeinfo_undefined +30272 invalid_typeinfo_has_field_type invalid 3 1 typeinfo_undefined +30273 invalid_typeinfo_mangled_subexpression invalid 3 2 typeinfo_undefined +30274 invalid_typeinfo_module_subexpression invalid 3 1 typeinfo_undefined +30275 invalid_typeinfo_offsetof_type invalid 3 1 typeinfo_undefined +30276 invalid_typeinfo_struct_get_annotation_argument_type invalid 3 1 typeinfo_undefined +30277 invalid_typeinfo_struct_has_annotation_argument_type invalid 3 1 typeinfo_undefined +30278 invalid_typeinfo_struct_has_annotation_type invalid 3 1 typeinfo_undefined +30279 invalid_typeinfo_struct_modulename invalid 3 1 typeinfo_undefined +30280 invalid_typeinfo_struct_name invalid 3 1 typeinfo_undefined +30281 invalid_typeinfo_variant_index_type invalid 3 1 invalid_type +30282 invalid_variable_name invalid 3 3 invalid_name +30283 invalid_variable_private invalid 3 1 variable_not_found +30284 invalid_variant invalid 3 5 invalid_type,type_not_found +30285 invalid_variant_array invalid 3 1 invalid_type +30286 invalid_variant_block invalid 3 1 invalid_block +30287 invalid_variant_initializer_count invalid 3 1 field_already_initialized +30288 invalid_variant_tuple invalid 3 1 invalid_type +30289 invalid_variant_type invalid 3 2 invalid_type +30290 invalid_variant_unique invalid 3 3 invalid_type +30291 invalid_while_condition_type invalid 3 1 invalid_loop +30292 invalid_with_array_type invalid 3 1 invalid_with_type +30293 invalid_with_type invalid 3 1 invalid_with_type +30294 invalid_yield invalid 3 1 invalid_yield +30295 invalid_yield_in_block invalid 3 1 invalid_yield +30300 missing_annotation missing 3 2 concept_failed,static_assert_failed +30301 missing_assume_type missing 3 1 invalid_assume +30302 missing_bitfield_init missing 3 1 cant_get_field +30303 missing_block_argument_init missing 3 1 cant_infer_missing_initializer +30304 missing_block_result missing 3 1 not_all_paths_return_value +30305 missing_enumeration_zero missing 3 1 invalid_type +30306 missing_finalizer missing 3 1 function_already_declared +30307 missing_for_iterator missing 3 1 invalid_loop +30308 missing_function_body missing 3 1 invalid_member_function +30309 missing_function_name missing 3 1 only_fast_aot_no_cpp_name +30310 missing_function_result missing 3 3 expecting_return_value,invalid_member_function,not_all_paths_return_value +30311 missing_global missing 3 1 cant_be_null +30312 missing_global_init missing 3 2 cant_infer_missing_initializer,invalid_variable_type +30313 missing_global_shared_init missing 3 1 invalid_variable_type +30314 missing_local missing 3 1 cant_be_null +30315 missing_local_block_init missing 3 1 invalid_variable_type +30316 missing_local_init missing 3 2 cant_infer_missing_initializer,invalid_variable_type +30317 missing_local_reference_init missing 3 1 invalid_variable_type +30318 missing_new_default_initializer missing 3 1 invalid_new_type +30319 missing_result missing 3 1 expecting_return_value +30320 missing_structure_field missing 3 1 cant_infer_missing_initializer +30321 missing_typeinfo_subexpression missing 3 4 typeinfo_undefined +30400 mismatching_array_dimension mismatching 3 1 invalid_type +30401 mismatching_array_element_type mismatching 3 1 invalid_type +30402 mismatching_block_argument_type mismatching 3 1 invalid_block +30403 mismatching_clone_type mismatching 3 1 operator_not_found +30404 mismatching_function_argument mismatching 3 1 invalid_type +30405 mismatching_function_argument_count mismatching 3 1 invalid_cast +30406 mismatching_numeric_type mismatching 3 5 operator_not_found +30407 mismatching_result_type mismatching 3 1 cant_infer_mismatching_restrictions +30408 mismatching_structure_dimension mismatching 3 1 invalid_type +30409 mismatching_tuple_argument_count mismatching 3 1 invalid_type +30410 mismatching_tuple_field_names mismatching 3 1 invalid_type +30411 mismatching_type mismatching 3 3 ,operator_not_found +30412 mismatching_variant_dimension mismatching 3 1 invalid_type +30500 exceeds_argument exceeds 3 2 invalid_variable_type +30502 exceeds_array_index exceeds 3 1 index_out_of_range +30503 exceeds_call_depth exceeds 3 3 too_many_infer_passes +30504 exceeds_expression_recursion exceeds 3 2 too_many_infer_passes +30505 exceeds_function_argument exceeds 3 4 too_many_arguments +30507 exceeds_infer_passes exceeds 3 2 too_many_infer_passes +30508 exceeds_local exceeds 3 1 invalid_variable_type +30509 exceeds_new_argument exceeds 3 1 too_many_arguments +30510 exceeds_structure exceeds 3 1 invalid_type +30511 exceeds_tuple_index exceeds 3 1 invalid_type +30512 exceeds_type exceeds 3 2 invalid_new_type +30513 exceeds_type_alias exceeds 3 1 invalid_type +30514 exceeds_typeinfo_sizeof exceeds 3 1 invalid_type +30600 ambiguous_annotation ambiguous 3 2 annotation_not_found,handle_not_found +30601 ambiguous_bitfield ambiguous 3 1 cant_get_field +30602 ambiguous_call_macro ambiguous 3 1 function_not_found +30603 ambiguous_enumeration ambiguous 3 2 enumeration_not_found,type_not_found +30604 ambiguous_field ambiguous 3 1 cant_get_field +30605 ambiguous_field_lookup ambiguous 3 1 cant_get_field +30606 ambiguous_finalizer ambiguous 3 1 function_already_declared +30607 ambiguous_function ambiguous 3 7 ,function_not_found +30608 ambiguous_macro ambiguous 3 3 invalid_type,unsupported_read_macro +30609 ambiguous_structure ambiguous 3 2 structure_not_found +30610 ambiguous_super_call ambiguous 3 1 function_not_found +30611 ambiguous_super_constructor ambiguous 3 1 function_not_found +30612 ambiguous_type ambiguous 3 1 type_not_found +30613 ambiguous_type_alias ambiguous 3 1 type_alias_not_found +30614 ambiguous_typeinfo_macro ambiguous 3 1 typeinfo_undefined +30615 ambiguous_variable ambiguous 3 2 variable_not_found +30700 already_declared_assume_alias already_declared 3 8 invalid_assume +30701 already_declared_block_argument already_declared 3 5 argument_already_declared,variable_not_found +30702 already_declared_function already_declared 3 8 cant_infer_generic,function_already_declared +30703 already_declared_label already_declared 3 1 invalid_label +30704 already_declared_local_variable already_declared 3 5 variable_not_found +30705 already_declared_structure_field_init already_declared 3 1 field_already_initialized +30706 already_declared_table already_declared 3 4 duplicate_key +30707 already_declared_tuple_field already_declared 3 1 field_already_initialized +30708 already_declared_variable already_declared 3 5 variable_not_found +30709 already_declared_with_shadow already_declared 3 1 variable_not_found +30800 lookup_annotation_field lookup 3 1 cant_get_field +30801 lookup_argument_type lookup 3 1 invalid_type +30802 lookup_bitfield lookup 3 3 bitfield_not_found,cant_get_field +30803 lookup_block_argument_type lookup 3 1 type_not_found +30804 lookup_block_result_type lookup 3 1 type_not_found +30805 lookup_cast_type lookup 3 2 type_not_found +30806 lookup_constructor lookup 3 1 function_not_found +30807 lookup_expression_type lookup 3 1 type_not_found +30808 lookup_field lookup 3 3 cant_get_field +30809 lookup_field_type lookup 3 1 type_not_found +30810 lookup_function lookup 3 13 ,function_not_found +30811 lookup_function_address_type lookup 3 1 type_not_found +30812 lookup_function_argument_type lookup 3 1 type_not_found +30813 lookup_function_mangled_name lookup 3 1 typeinfo_undefined +30814 lookup_function_result_type lookup 3 1 type_not_found +30815 lookup_function_type lookup 3 1 type_not_found +30816 lookup_generator_type lookup 3 2 type_not_found +30817 lookup_global_type lookup 3 1 invalid_type +30818 lookup_is_expression_type lookup 3 1 type_not_found +30819 lookup_label lookup 3 1 invalid_label +30820 lookup_local_type lookup 3 1 type_not_found +30821 lookup_macro lookup 3 3 invalid_type,unsupported_read_macro +30822 lookup_method lookup 3 1 invalid_argument_count +30823 lookup_new_type lookup 3 1 type_not_found +30824 lookup_safe_field_type lookup 3 1 type_not_found +30825 lookup_structure_field lookup 3 1 cant_get_field +30826 lookup_structure_field_type lookup 3 1 invalid_structure_field_type +30827 lookup_super_class lookup 3 1 bad_delete +30828 lookup_super_constructor lookup 3 1 function_not_found +30829 lookup_super_finalizer lookup 3 1 bad_delete +30830 lookup_super_method lookup 3 1 function_not_found +30831 lookup_tuple_field lookup 3 4 cant_get_field +30832 lookup_type lookup 3 1 type_not_found +30833 lookup_typeinfo_annotation lookup 3 2 typeinfo_undefined +30834 lookup_typeinfo_annotation_argument lookup 3 1 typeinfo_undefined +30835 lookup_typeinfo_macro lookup 3 1 typeinfo_undefined +30836 lookup_typeinfo_offsetof_type lookup 3 1 typeinfo_undefined +30837 lookup_typeinfo_type lookup 3 1 type_not_found +30838 lookup_variable lookup 3 2 variable_not_found +30839 lookup_variant_field lookup 3 8 cant_get_field,typeinfo_undefined +30840 lookup_variant_type lookup 3 2 type_not_found +30900 cant_access_private_field cant 3 1 cant_get_field +30901 cant_access_private_structure cant 3 1 function_not_found +30902 cant_address_function cant 3 1 type_not_found +30903 cant_address_template_function cant 3 1 function_not_found +30904 cant_annotation_field cant 3 2 cant_move,invalid_type +30905 cant_apply_op cant 3 2 operator_not_found +30906 cant_argument cant 3 1 cant_be_null +30907 cant_argument_structure cant 3 1 unspecified +30908 cant_array_element cant 3 1 cant_move +30909 cant_ascend cant 3 1 invalid_new_type +30910 cant_assign_op cant 3 2 operator_not_found +30911 cant_block cant 3 1 invalid_label +30912 cant_capture_variable cant 3 6 cant_pass_temporary,invalid_capture +30913 cant_clone cant 3 4 ,cant_write_to_const,cant_write_to_non_reference +30914 cant_clone_type cant 3 2 cant_copy +30915 cant_copy cant 3 3 ,cant_pass_temporary,cant_write_to_non_reference +30916 cant_create_structure_annotation cant 3 1 invalid_annotation +30917 cant_delete cant 3 3 bad_delete +30918 cant_delete_local cant 3 1 bad_delete +30919 cant_delete_smart_pointer cant 3 1 bad_delete +30920 cant_delete_super cant 3 1 bad_delete +30921 cant_dereference cant 3 6 cant_dereference,invalid_type +30922 cant_expression cant 3 14 cant_be_null,cant_pipe,no_writing_to_nameless +30923 cant_field_class cant 3 1 invalid_structure_field_type +30924 cant_finalize_block_annotation cant 3 1 invalid_annotation +30925 cant_finalize_function_annotation cant 3 1 invalid_annotation +30926 cant_finalize_structure_annotation cant 3 1 invalid_annotation +30927 cant_function cant 3 2 deprecated_function,no_init +30928 cant_get_field cant 3 1 cant_get_field +30929 cant_get_field_pointer cant 3 1 cant_get_field +30930 cant_global cant 3 8 cant_be_null,cant_copy,cant_move,no_global_heap,no_global_variables,no_init +30931 cant_index cant 3 1 cant_index +30932 cant_index_key cant 3 1 invalid_index_type +30933 cant_index_pointer cant 3 2 cant_index,invalid_index_type +30934 cant_index_table cant 3 2 invalid_index_type,invalid_table_type +30935 cant_initialize_array_element cant 3 1 cant_pass_temporary +30936 cant_initialize_private_field cant 3 1 cant_get_field +30937 cant_initialize_structure_field cant 3 1 cant_pass_temporary +30938 cant_initialize_variant_field cant 3 1 cant_pass_temporary +30939 cant_iterate_iterator cant 3 1 invalid_iteration_source +30940 cant_local cant 3 2 cant_be_null,cant_move +30941 cant_move cant 3 5 cant_move,cant_move_to_const,cant_pass_temporary,cant_write_to_non_reference +30942 cant_pointer cant 3 1 +30943 cant_result cant 3 3 cant_be_null,cant_move,not_expecting_return_value +30944 cant_safe_get_field cant 3 2 cant_get_field +30945 cant_safe_index cant 3 1 cant_index +30946 cant_safe_index_table cant 3 1 invalid_index_type +30947 cant_structure_field cant 3 4 cant_move,invalid_initialization_type,invalid_type +30948 cant_take_pointer cant 3 1 cant_dereference +30949 cant_tuple cant 3 1 cant_move +30950 cant_type cant 3 6 cant_copy,cant_initialize,cant_move,invalid_type +30951 cant_variant_field cant 3 2 cant_move,invalid_type +30952 cant_write cant 3 1 cant_write_to_const +31000 unsafe_address unsafe 3 1 unsafe +31001 unsafe_argument unsafe 3 1 unsafe_function +31002 unsafe_array_safe_index unsafe 3 2 unsafe +31003 unsafe_capture_variable unsafe 3 2 invalid_capture +31004 unsafe_cast unsafe 3 1 unsafe +31005 unsafe_class unsafe 3 2 unsafe +31006 unsafe_class_initializer unsafe 3 1 unsafe +31007 unsafe_class_local unsafe 3 1 unsafe +31008 unsafe_class_stack_construction unsafe 3 1 unsafe +31009 unsafe_delete unsafe 3 1 unsafe +31010 unsafe_delete_pointer unsafe 3 1 unsafe +31011 unsafe_fixed_array_safe_index unsafe 3 1 unsafe +31012 unsafe_function unsafe 3 2 unsafe_function +31013 unsafe_function_call unsafe 3 3 unsafe +31014 unsafe_global unsafe 3 2 unsafe,unsafe_function +31015 unsafe_global_pointer unsafe 3 1 unsafe +31016 unsafe_local unsafe 3 1 unsafe +31017 unsafe_local_class unsafe 3 1 unsafe +31018 unsafe_local_in_scope_required unsafe 3 1 invalid_variable_type +31019 unsafe_local_reference unsafe 3 1 unsafe +31020 unsafe_local_type unsafe 3 1 invalid_variable_type +31021 unsafe_move unsafe 3 1 unsafe +31022 unsafe_operator unsafe 3 2 unsafe +31023 unsafe_pointer_index unsafe 3 1 unsafe +31024 unsafe_pointer_safe_index unsafe 3 1 unsafe +31025 unsafe_return_block unsafe 3 1 invalid_return_type +31026 unsafe_return_function unsafe 3 1 invalid_return_type +31027 unsafe_return_reference unsafe 3 2 invalid_return_type +31028 unsafe_return_smart_pointer unsafe 3 2 unsafe +31029 unsafe_smart_pointer unsafe 3 1 unsafe +31030 unsafe_structure_field unsafe 3 1 unsafe +31031 unsafe_structure_uninitialized unsafe 3 1 unsafe +31032 unsafe_structure_visibility unsafe 3 1 unsafe +31033 unsafe_table_index unsafe 3 1 unsafe +31034 unsafe_table_safe_index unsafe 3 2 unsafe +31035 unsafe_variant_field unsafe 3 2 unsafe +31036 unsafe_variant_safe_as unsafe 3 1 unsafe +31100 recursion_argument recursion 3 1 (empty) +31101 recursion_assume_alias recursion 3 1 invalid_assume +31102 recursion_function recursion 3 1 (empty) +31103 recursion_function_argument recursion 3 2 (empty),invalid_argument_count +31104 recursion_global recursion 3 1 variable_not_found +31105 recursion_structure recursion 3 1 invalid_type +31106 recursion_type_alias recursion 3 1 invalid_type +31200 runtime_annotation_transform runtime 3 1 annotation_failed +31201 runtime_call_macro runtime 3 1 unsupported_call_macro +31202 runtime_expression runtime 3 2 (empty) +31206 runtime_macro_exception runtime 3 1 exception_during_macro +31207 runtime_macro_infer runtime 3 1 unspecified +31208 runtime_macro_performance runtime 3 1 performance_lint +31209 runtime_macro_style runtime 3 1 style_lint +31210 runtime_structure_annotation runtime 3 1 annotation_failed +31211 runtime_typeinfo_macro runtime 3 2 typeinfo_macro_error +31300 not_resolved_yet_argument_type not_resolved_yet 3 7 invalid_argument_type,type_not_found +31301 not_resolved_yet_array_dimension not_resolved_yet 3 3 cant_index +31302 not_resolved_yet_array_type not_resolved_yet 3 5 invalid_array_type,invalid_type +31303 not_resolved_yet_bitfield_type not_resolved_yet 3 1 type_not_found +31304 not_resolved_yet_block not_resolved_yet 3 2 invalid_block +31305 not_resolved_yet_block_argument not_resolved_yet 3 1 invalid_block +31306 not_resolved_yet_block_argument_init not_resolved_yet 3 1 invalid_type +31307 not_resolved_yet_class_type not_resolved_yet 3 1 invalid_argument_count +31308 not_resolved_yet_comprehension_type not_resolved_yet 3 1 invalid_type +31309 not_resolved_yet_delete_size_type not_resolved_yet 3 1 type_not_found +31310 not_resolved_yet_dereference_type not_resolved_yet 3 1 type_not_found +31311 not_resolved_yet_enumerator not_resolved_yet 3 3 (empty),invalid_enumeration +31312 not_resolved_yet_expression_type not_resolved_yet 3 2 (empty) +31313 not_resolved_yet_function not_resolved_yet 3 2 cant_infer_generic,invalid_argument_count +31314 not_resolved_yet_function_block not_resolved_yet 3 1 invalid_block +31315 not_resolved_yet_generator_block not_resolved_yet 3 1 invalid_block +31316 not_resolved_yet_index_type not_resolved_yet 3 2 type_not_found +31317 not_resolved_yet_invoke_argument_type not_resolved_yet 3 3 invalid_argument_type +31318 not_resolved_yet_is_expression_type not_resolved_yet 3 3 type_not_found +31319 not_resolved_yet_label_type not_resolved_yet 3 1 type_not_found +31320 not_resolved_yet_lambda_block not_resolved_yet 3 1 invalid_block +31321 not_resolved_yet_local_type not_resolved_yet 3 1 (empty) +31322 not_resolved_yet_method_call not_resolved_yet 3 1 function_not_found +31323 not_resolved_yet_new_type not_resolved_yet 3 1 type_not_found +31324 not_resolved_yet_null_coalescing_type not_resolved_yet 3 1 type_not_found +31325 not_resolved_yet_structure not_resolved_yet 3 1 (empty) +31326 not_resolved_yet_structure_field not_resolved_yet 3 1 (empty) +31327 not_resolved_yet_structure_type not_resolved_yet 3 1 invalid_type +31328 not_resolved_yet_table_type not_resolved_yet 3 2 invalid_array_type +31329 not_resolved_yet_tuple_type not_resolved_yet 3 2 invalid_type +31330 not_resolved_yet_type not_resolved_yet 3 4 invalid_type,type_not_found +31331 not_resolved_yet_type_alias not_resolved_yet 3 1 invalid_type +31332 not_resolved_yet_typeinfo not_resolved_yet 3 2 type_not_found +31333 not_resolved_yet_typeinfo_alignof not_resolved_yet 3 1 invalid_type +31334 not_resolved_yet_typeinfo_dim not_resolved_yet 3 1 type_not_found +31335 not_resolved_yet_typeinfo_dim_table not_resolved_yet 3 1 type_not_found +31336 not_resolved_yet_typeinfo_sizeof not_resolved_yet 3 1 invalid_type +31400 concept_failed unspecified 3 1 concept_failed +31401 condition_must_be_bool unspecified 3 1 condition_must_be_bool +31402 not_expecting_result unspecified 3 1 not_expecting_return_value +31403 static_assert_failed unspecified 3 1 static_assert_failed +50100 invalid_options invalid 5 5 (empty),invalid_option +50200 mismatching_runtime_type mismatching 5 1 (empty) +50201 mismatching_runtime_type_hash mismatching 5 1 (empty) +50300 exceeds_array exceeds 5 2 index_out_of_range,invalid_array_dimension +50301 exceeds_global exceeds 5 3 (empty),invalid_variable_type +50302 exceeds_runtime_buffer exceeds 5 1 (empty) +50400 cant_hash_block cant 5 1 (empty) +50401 cant_hash_context cant 5 1 (empty) +50402 cant_hash_iterator cant 5 1 (empty) +50403 cant_serialize_block cant 5 1 (empty) +50404 cant_serialize_iterator cant 5 1 (empty) +50405 cant_serialize_null_pointer cant 5 1 (empty) +50406 cant_serialize_pointer cant 5 2 (empty) +50407 cant_serialize_table cant 5 1 (empty) +50500 runtime_function runtime 5 3 cant_initialize,run_failed +50501 runtime_function_annotation runtime 5 5 annotation_failed,cant_initialize +50502 runtime_global runtime 5 2 (empty) +50503 runtime_macro runtime 5 6 (empty),macro_failed,typeinfo_macro_error,unspecified +50600 internal_annotation internal 5 4 (empty),invalid_annotation +50601 internal_array internal 5 2 (empty) +50602 internal_array_type internal 5 2 (empty) +50603 internal_block internal 5 2 (empty),invalid_type +50604 internal_block_missing_return_type internal 5 1 malformed_ast +50605 internal_class internal 5 1 (empty) +50606 internal_enumeration internal 5 1 (empty) +50607 internal_expression internal 5 26 (empty),missing_node,unspecified +50608 internal_field internal 5 1 (empty) +50609 internal_function internal 5 9 (empty),function_already_declared,invalid_member_function,no_init,run_failed +50610 internal_function_annotation internal 5 1 missing_node +50611 internal_function_changed internal 5 1 unspecified +50612 internal_function_name internal 5 1 invalid_block +50613 internal_function_not_resolved_yet internal 5 2 missing_node +50614 internal_function_refresh internal 5 1 unspecified +50615 internal_generator internal 5 2 (empty) +50616 internal_generator_finalizer internal 5 1 invalid_generator_finalizer +50617 internal_generator_finalizer_multiple internal 5 1 invalid_generator_finalizer +50618 internal_generator_finalizer_name internal 5 1 invalid_block +50619 internal_generator_function_name internal 5 1 invalid_block +50620 internal_generator_structure_name internal 5 1 invalid_block +50621 internal_global internal 5 2 (empty),no_init +50622 internal_label internal 5 1 (empty) +50623 internal_lambda_finalizer_name internal 5 1 invalid_block +50624 internal_lambda_function_name internal 5 1 invalid_block +50625 internal_lambda_in_scope_conversion internal 5 1 invalid_variable_type +50626 internal_lambda_structure_name internal 5 1 invalid_block +50627 internal_macro internal 5 3 (empty) +50628 internal_name internal 5 2 (empty) +50629 internal_options internal 5 2 internal_error +50630 internal_pod_analysis_infer internal 5 1 unspecified +50631 internal_relocate_infer internal 5 1 unspecified +50632 internal_structure internal 5 2 (empty) +50633 internal_structure_block internal 5 1 invalid_type +50634 internal_table internal 5 4 (empty) +50635 internal_tuple internal 5 1 (empty) +50636 internal_tuple_type internal 5 1 invalid_type +50637 internal_type internal 5 15 (empty),internal_error,unspecified +50638 internal_type_alias internal 5 1 invalid_type +50639 internal_typeinfo_macro internal 5 1 typeinfo_macro_error +50640 internal_variable internal 5 3 (empty) diff --git a/doc/internal/error_audit_verbose_gate.tsv b/doc/internal/error_audit_verbose_gate.tsv new file mode 100644 index 0000000000..b3255cf60b --- /dev/null +++ b/doc/internal/error_audit_verbose_gate.tsv @@ -0,0 +1,89 @@ +file line context norm_name classification +src/ast/ast_infer_type.cpp 91 InferTypes::visitAlias not_resolved_yet_type_alias follow_on +src/ast/ast_infer_type.cpp 155 InferTypes::visitEnumerationValue not_resolved_yet_enumerator follow_on +src/ast/ast_infer_type.cpp 167 InferTypes::visitEnumerationValue not_resolved_yet_enumerator follow_on +src/ast/ast_infer_type.cpp 255 InferTypes::visitStructureField not_resolved_yet_structure_field follow_on +src/ast/ast_infer_type.cpp 783 InferTypes::visit(ExprConst*) not_resolved_yet_enumerator follow_on +src/ast/ast_infer_type.cpp 843 InferTypes::visit(ExprGoto*) not_resolved_yet_label_type follow_on +src/ast/ast_infer_type.cpp 1012 InferTypes::visit(ExprAddr*) lookup_function mid_inference +src/ast/ast_infer_type.cpp 1054 InferTypes::visit(ExprPtr2Ref*) not_resolved_yet_dereference_type follow_on +src/ast/ast_infer_type.cpp 1153 InferTypes::visit(ExprNullCoalescing*) not_resolved_yet_null_coalescing_type follow_on +src/ast/ast_infer_type.cpp 1199 InferTypes::visit(ExprStaticAssert*) not_resolved_yet_argument_type follow_on +src/ast/ast_infer_type.cpp 1233 InferTypes::visit(ExprStaticAssert*) concept_failed mid_inference +src/ast/ast_infer_type.cpp 1239 InferTypes::visit(ExprStaticAssert*) static_assert_failed mid_inference +src/ast/ast_infer_type.cpp 1267 InferTypes::visit(ExprAssert*) not_resolved_yet_argument_type follow_on +src/ast/ast_infer_type.cpp 1433 InferTypes::visit(ExprInvoke*) ambiguous_super_call mid_inference +src/ast/ast_infer_type.cpp 1450 InferTypes::visit(ExprInvoke*) not_resolved_yet_method_call follow_on +src/ast/ast_infer_type.cpp 1601 InferTypes::visit(ExprInvoke*) not_resolved_yet_function follow_on +src/ast/ast_infer_type.cpp 1632 InferTypes::visit(ExprInvoke*) not_resolved_yet_class_type follow_on +src/ast/ast_infer_type.cpp 1667 InferTypes::visit(ExprInvoke*) not_resolved_yet_invoke_argument_type follow_on +src/ast/ast_infer_type.cpp 1672 InferTypes::visit(ExprInvoke*) not_resolved_yet_invoke_argument_type follow_on +src/ast/ast_infer_type.cpp 1702 InferTypes::visit(ExprInvoke*) not_resolved_yet_invoke_argument_type follow_on +src/ast/ast_infer_type.cpp 1761 InferTypes::visit(ExprSetInsert*) not_resolved_yet_argument_type follow_on +src/ast/ast_infer_type.cpp 1793 InferTypes::visit(ExprErase*) not_resolved_yet_argument_type follow_on +src/ast/ast_infer_type.cpp 1825 InferTypes::visit(ExprFind*) not_resolved_yet_argument_type follow_on +src/ast/ast_infer_type.cpp 1859 InferTypes::visit(ExprKeyExists*) not_resolved_yet_argument_type follow_on +src/ast/ast_infer_type.cpp 1884 InferTypes::visit(ExprIs*) not_resolved_yet_is_expression_type follow_on +src/ast/ast_infer_type.cpp 1896 InferTypes::visit(ExprIs*) not_resolved_yet_is_expression_type follow_on +src/ast/ast_infer_type.cpp 1918 InferTypes::visit(ExprIs*) not_resolved_yet_is_expression_type follow_on +src/ast/ast_infer_type.cpp 1948 InferTypes::visit(ExprTypeDecl*) not_resolved_yet_type follow_on +src/ast/ast_infer_type.cpp 1976 InferTypes::visit(ExprTypeInfo*) not_resolved_yet_typeinfo follow_on +src/ast/ast_infer_type.cpp 2000 InferTypes::visit(ExprTypeInfo*) not_resolved_yet_typeinfo follow_on +src/ast/ast_infer_type.cpp 2011 InferTypes::visit(ExprTypeInfo*) not_resolved_yet_typeinfo_sizeof follow_on +src/ast/ast_infer_type.cpp 2026 InferTypes::visit(ExprTypeInfo*) not_resolved_yet_typeinfo_alignof follow_on +src/ast/ast_infer_type.cpp 2037 InferTypes::visit(ExprTypeInfo*) not_resolved_yet_typeinfo_dim follow_on +src/ast/ast_infer_type.cpp 2060 InferTypes::visit(ExprTypeInfo*) not_resolved_yet_typeinfo_dim_table follow_on +src/ast/ast_infer_type.cpp 2607 InferTypes::visit(ExprDelete*) not_resolved_yet_delete_size_type follow_on +src/ast/ast_infer_type.cpp 2655 InferTypes::visit(ExprDelete*) ambiguous_finalizer mid_inference +src/ast/ast_infer_type.cpp 2852 InferTypes::visit(ExprNew*) not_resolved_yet_new_type follow_on +src/ast/ast_infer_type.cpp 2992 InferTypes::visit(ExprAt*) not_resolved_yet_index_type follow_on +src/ast/ast_infer_type.cpp 3077 InferTypes::visit(ExprAt*) not_resolved_yet_array_dimension follow_on +src/ast/ast_infer_type.cpp 3108 InferTypes::visit(ExprSafeAt*) not_resolved_yet_index_type follow_on +src/ast/ast_infer_type.cpp 3162 InferTypes::visit(ExprSafeAt*) not_resolved_yet_array_dimension follow_on +src/ast/ast_infer_type.cpp 3236 InferTypes::visit(ExprSafeAt*) not_resolved_yet_array_dimension follow_on +src/ast/ast_infer_type.cpp 3352 InferTypes::visitBlockArgumentInit not_resolved_yet_block_argument_init follow_on +src/ast/ast_infer_type.cpp 3720 InferTypes::visit(ExprField*) ambiguous_bitfield mid_inference +src/ast/ast_infer_type.cpp 3743 InferTypes::visit(ExprField*) ambiguous_field mid_inference +src/ast/ast_infer_type.cpp 3746 InferTypes::visit(ExprField*) lookup_field mid_inference +src/ast/ast_infer_type.cpp 3819 InferTypes::visit(ExprField*) not_resolved_yet_bitfield_type follow_on +src/ast/ast_infer_type.cpp 3916 InferTypes::visit(ExprField*) lookup_field mid_inference +src/ast/ast_infer_type.cpp 3950 InferTypes::visit(ExprSafeField*) invalid_safe_dereference_type mid_inference +src/ast/ast_infer_type.cpp 4146 InferTypes::visit(ExprVar*) invalid_variable_private mid_inference +src/ast/ast_infer_type.cpp 4149 InferTypes::visit(ExprVar*) lookup_variable mid_inference +src/ast/ast_infer_type.cpp 4166 InferTypes::visit(ExprVar*) ambiguous_variable mid_inference +src/ast/ast_infer_type.cpp 5143 InferTypes::visit(ExprLet*) not_resolved_yet_local_type follow_on +src/ast/ast_infer_type.cpp 5264 InferTypes::visit(ExprNamedCall*) not_resolved_yet_argument_type follow_on +src/ast/ast_infer_type.cpp 5434 InferTypes::visit(ExprCall*) ambiguous_super_constructor mid_inference +src/ast/ast_infer_type_helper.cpp 148 InferTypes::verifyType not_resolved_yet_array_type follow_on +src/ast/ast_infer_type_helper.cpp 168 InferTypes::verifyType not_resolved_yet_table_type follow_on +src/ast/ast_infer_type_helper.cpp 183 InferTypes::verifyType not_resolved_yet_table_type follow_on +src/ast/ast_infer_type_helper.cpp 678 InferTypes::inferTypeExpr not_resolved_yet_type follow_on +src/ast/ast_infer_type_helper.cpp 682 InferTypes::inferTypeExpr not_resolved_yet_type follow_on +src/ast/ast_infer_type_helper.cpp 966 InferTypes::inferReturnType not_resolved_yet_expression_type follow_on +src/ast/ast_infer_type_helper.cpp 969 InferTypes::inferReturnType not_resolved_yet_expression_type follow_on +src/ast/ast_infer_type_make.cpp 57 InferTypes::visit(ExprMakeGenerator) not_resolved_yet_generator_block follow_on +src/ast/ast_infer_type_make.cpp 217 InferTypes::convertBlockToLambda not_resolved_yet_lambda_block follow_on +src/ast/ast_infer_type_make.cpp 281 InferTypes::convertBlockToLocalFunction not_resolved_yet_function_block follow_on +src/ast/ast_infer_type_make.cpp 322 InferTypes::visit(ExprMakeBlock) not_resolved_yet_block follow_on +src/ast/ast_infer_type_make.cpp 340 InferTypes::visit(ExprMakeBlock) not_resolved_yet_block follow_on +src/ast/ast_infer_type_make.cpp 707 InferTypes::structToTuple not_resolved_yet_tuple_type follow_on +src/ast/ast_infer_type_make.cpp 814 InferTypes::visit(ExprMakeStruct) not_resolved_yet_block_argument follow_on +src/ast/ast_infer_type_make.cpp 941 InferTypes::visit(ExprMakeStruct) not_resolved_yet_structure follow_on +src/ast/ast_infer_type_make.cpp 1060 InferTypes::visit(ExprMakeStruct) not_resolved_yet_structure_type follow_on +src/ast/ast_infer_type_make.cpp 1119 InferTypes::visit(ExprMakeTuple) not_resolved_yet_tuple_type follow_on +src/ast/ast_infer_type_make.cpp 1259 InferTypes::visitMakeArrayIndex not_resolved_yet_array_type follow_on +src/ast/ast_infer_type_make.cpp 1275 InferTypes::visitMakeArrayIndex not_resolved_yet_array_type follow_on +src/ast/ast_infer_type_make.cpp 1306 InferTypes::visitMakeArrayIndex invalid_variant_unique mid_inference +src/ast/ast_infer_type_make.cpp 1400 InferTypes::visit(ExprMakeArray) not_resolved_yet_type follow_on +src/ast/ast_infer_type_make.cpp 1426 InferTypes::visit(ExprMakeArray) not_resolved_yet_array_type follow_on +src/ast/ast_infer_type_make.cpp 1447 InferTypes::visit(ExprArrayComprehension) not_resolved_yet_comprehension_type follow_on +src/ast/ast_infer_type_op.cpp 47 InferTypes::visit(ExprOp1*) not_resolved_yet_array_type follow_on +src/ast/ast_infer_type_report.cpp 358 InferTypes::reportDualFunctionNotFound lookup_function mid_inference +src/ast/ast_infer_type_report.cpp 441 InferTypes::reportFunctionNotFound lookup_function mid_inference +src/ast/ast_infer_type_report.cpp 506 InferTypes::reportFunctionNotFound lookup_function mid_inference +src/ast/ast_infer_type_report.cpp 520 InferTypes::reportCantClone cant_clone_type mid_inference +src/ast/ast_infer_type_report.cpp 534 InferTypes::reportCantCloneFromConst cant_clone mid_inference +src/ast/ast_infer_type_report.cpp 591 InferTypes::reportFunctionNotFound(ExprAddr*) lookup_function mid_inference +src/ast/ast_infer_type_report.cpp 756 InferTypes::reportOp2Errors mismatching_numeric_type mid_inference +src/ast/ast_infer_type_report.cpp 773 InferTypes::reportOp2Errors mismatching_numeric_type mid_inference +src/ast/ast_infer_type_report.cpp 784 InferTypes::reportOp2Errors mismatching_numeric_type mid_inference diff --git a/doc/internal/error_audit_wording.tsv b/doc/internal/error_audit_wording.tsv new file mode 100644 index 0000000000..0477d64315 --- /dev/null +++ b/doc/internal/error_audit_wording.tsv @@ -0,0 +1,22 @@ +file line classification current_msg_template wording_change +src/ast/ast_infer_type.cpp 255 follow_on not fully resolved yet current cerr unspecified - should be not_resolved_yet_structure_field; vague: clarify what is not resolved +src/ast/ast_infer_type.cpp 312 wording_fix field can't be initialized at all typo: missing space, 'can't' -> ' can't' +src/ast/ast_infer_type.cpp 1620 wording_fix '->.' expecting function duplicate error call - line 1617 already emitted same error; remove duplicate +src/ast/ast_infer_type.cpp 3746 mid_inference Don't know what '' is vague: clarify what 'X' means +src/ast/ast_infer_type.cpp 4126 wording_fix global variable '' cant't be initialized with itself typo: cant't -> can't +src/ast/ast_infer_type.cpp 5024 wording_fix Uninitialized variable is unsafe inconsistent: uses [safe_when_uninitialized]; lines 295/370 use @safe_when_uninitialized +src/ast/ast_infer_type.cpp 5143 follow_on type not ready yet current cerr unspecified - should be not_resolved_yet_local_type; vague: clarify which type isn't ready +src/ast/ast_infer_type_function.cpp 1162 internal internal compiler error: unknown array type not under make strcut typo: strcut -> struct; missing cerr; internal invariant +src/ast/ast_infer_type_helper.cpp 176 primary table key has to be declare as a basic 'hashable' type: '' typo: declare -> declared +src/ast/ast_infer_type_helper.cpp 966 follow_on subexpresion type is not resolved yet typo: subexpresion -> subexpression; missing cerr +src/ast/ast_infer_type_helper.cpp 969 follow_on subexpresion type is not fully resolved yet typo: subexpresion -> subexpression; missing cerr +src/ast/ast_infer_type_make.cpp 169 wording_fix can't captured variable typo: captured -> capture +src/ast/ast_infer_type_make.cpp 531 primary () can`t be allocated locally (on the stack...) typo: can`t -> can't (backtick instead of apostrophe) +src/ast/ast_infer_type_make.cpp 1191 primary a => b tuple key has to be declare as a basic 'hashable' type typo: declare -> declared +src/ast/ast_infer_type_op.cpp 379 wording_fix Op3 currently only supports 'is' reword: 'Op3 currently only supports ?:' (code uses ?, not 'is') +src/ast/ast_infer_type_op.cpp 482 wording_fix can only move to from a reference typo: 'move to from' -> 'move from' +src/ast/ast_simulate.cpp 1352 internal internal compilation error simluateNullCoalescing returned null missing cerr; typo: simluate -> simulate; suggest internal_error +src/ast/ast_simulate.cpp 3619 internal Internal compiler errors. Simulating variable which is not used missing cerr; wording: 'errors.' should be 'error,' and missing space before ; suggest internal_error +src/ast/ast_typedecl.cpp 3807 internal expecting ']' DAS_VERIFY-only; typo: missing closing apostrophe in 'expecting '\]' +src/ast/ast_parse.cpp 1249 internal internal error recategorize: not a syntax error; vague text — name the failing module +src/parser/parser_impl.cpp 791 primary intializer is already defined wording: typo 'intializer' -> 'initializer' diff --git a/doc/source/stdlib/handmade/enumeration-rtti-CompilationError.rst b/doc/source/stdlib/handmade/enumeration-rtti-CompilationError.rst index c66ecac1d2..aeea62b500 100644 --- a/doc/source/stdlib/handmade/enumeration-rtti-CompilationError.rst +++ b/doc/source/stdlib/handmade/enumeration-rtti-CompilationError.rst @@ -1,108 +1,579 @@ -Enumeration which represents error type for each of the errors which compiler returns and various stages. +Enumeration which represents error type for each of the errors which compiler returns at various stages. Unspecified error. -Mismatching parentheses. +Invalid line. +Invalid string. Mismatching curly braces. -String constant exceeds file. -String constant exceeds line. -Unexpected close comment. -Integer constant out of range. -Comment contains EOF (end of file). -Invalid escape sequence. -Invalid line directive. -Syntax error, usually invalid grammar. -Malformed AST. -Invalid type. -Invalid return type. +Mismatching module name. +Mismatching parens. +Constant size exceeds limit. +File size exceeds limit. +Invalid aka. +Invalid capture. +Invalid escape. +Invalid field. +Invalid field static. +Invalid function. +Invalid function annotation. +Invalid function static. +Invalid global aka. +Invalid macro. +Invalid module. +Invalid module require. +Invalid name. +Invalid type aka. +Invalid type alias. +Missing module name. +Bitfield size exceeds limit. +Ambiguous function argument type. +Enumeration already declared. +Enumerator already declared. +Field already declared. +Field static already declared. +Function argument already declared. +Global already declared. +Global bitfield already declared. +Local already declared. +Module already declared. +Module name already declared. +Structure already declared. +Type alias already declared. +Annotation not found. +Enumeration not found. +File not found. +Module not found. +Structure not found. +Can't structure. +Runtime failure in annotation. +Internal compiler error in module. +Invalid annotation. +Invalid annotation field. +Invalid annotation macro. +Invalid annotation type. +Invalid argument. +Invalid argument global. +Invalid argument name. Invalid argument type. -Invalid structure field type. +Invalid array. +Invalid array dimension. +Invalid array dimension type. +Invalid array element type. Invalid array type. -Invalid table type. -Invalid argument count. -Invalid variable type. -Invalid new type. +Invalid as. +Invalid ascend array handle type. +Invalid ascend handle type. +Invalid assert argument count. +Invalid assert comment type. +Invalid assert condition type. +Invalid bitfield. +Invalid bitfield cast argument count. +Invalid block argument. +Invalid block argument count. +Invalid block argument init type. +Invalid block argument type. +Invalid block break. +Invalid block continue. +Invalid block finally. +Invalid break. +Invalid capture variable. +Invalid cast function. +Invalid cast structure. +Invalid cast structure pointer. +Invalid cast type. +Invalid class. +Invalid class local. +Invalid class tuple. +Invalid class variant. +Invalid clone smart pointer type. +Invalid comprehension element type. +Invalid continue. +Invalid debug argument count. +Invalid debug comment type. +Invalid delete size type. +Invalid delete super self type. +Invalid enumeration. +Invalid enumeration name. +Invalid enumerator. +Invalid enumerator name. +Invalid enumerator type. +Invalid erase argument count. +Invalid expression. +Invalid field name. +Invalid field syntax. +Invalid field type. +Invalid finally in generator if. +Invalid find argument count. +Invalid for iterator count. +Invalid for iterator tuple. +Invalid function argument. +Invalid function argument count. +Invalid function argument type. +Invalid function argument type block. +Invalid function name. +Invalid function options. +Invalid function result. +Invalid function result discarded. +Invalid function result type. +Invalid function type. +Invalid generator. +Invalid generator argument count. +Invalid generator argument type. +Invalid generator result type. +Invalid global. +Invalid global init options. +Invalid global init type. +Invalid global options. +Invalid global self init. +Invalid global shared. +Invalid global type. +Invalid global type shared. +Invalid handle index type. +Invalid handle safe index type. +Invalid if condition type. Invalid index type. -Invalid annotation. +Invalid insert argument count. +Invalid invoke argument count. +Invalid invoke argument type. +Invalid invoke method syntax. +Invalid invoke target type. +Invalid is. +Invalid is expression. +Invalid iteration source type. +Invalid key exists argument count. +Invalid label type. +Invalid local in scope. +Invalid local in scope finally. +Invalid local init. +Invalid local init block. +Invalid local init constructor. +Invalid local init type. +Invalid local tuple expansion. +Invalid local type. +Invalid macro context. +Invalid macro read. +Invalid macro tag. +Invalid macro type. +Invalid memzero argument. +Invalid memzero argument count. +Invalid memzero argument type. +Invalid module name. +Invalid new class syntax. +Invalid new initializer result type. +Invalid new initializer type. +Invalid new type. +Invalid null coalescing type. +Invalid op3 expression. +Invalid pointer arithmetic. +Invalid quote argument count. +Invalid result. +Invalid result type. +Invalid return semantics. +Invalid safe as. +Invalid safe dereference type. +Invalid safe field type. +Invalid static assert argument count. +Invalid static assert comment type. +Invalid static assert condition type. +Invalid static if condition. +Invalid storage type op. +Invalid string builder argument. +Invalid structure. +Invalid structure annotation. +Invalid structure array. +Invalid structure block pipe. +Invalid structure field init. +Invalid structure field type. +Invalid structure initializer required. +Invalid structure local. +Invalid structure name. +Invalid structure template. +Invalid structure tuple. +Invalid structure type. +Invalid structure variant. +Invalid super call. Invalid swizzle mask. -Invalid initialization type. +Invalid swizzle type. +Invalid table. +Invalid table argument type. +Invalid table expression. +Invalid table index type. +Invalid table key type. +Invalid table safe index type. +Invalid table type. +Invalid tuple. +Invalid tuple argument type. +Invalid tuple block. +Invalid tuple key. +Invalid tuple key type. +Invalid tuple type. +Invalid tuple variant. +Invalid type. +Invalid type dimension. +Invalid type expression. +Invalid typeinfo. +Invalid typeinfo annotation. +Invalid typeinfo annotation argument type. +Invalid typeinfo dim. +Invalid typeinfo dim table. +Invalid typeinfo dim table type. +Invalid typeinfo function. +Invalid typeinfo has field type. +Invalid typeinfo mangled subexpression. +Invalid typeinfo module subexpression. +Invalid typeinfo offsetof type. +Invalid typeinfo struct get annotation argument type. +Invalid typeinfo struct has annotation argument type. +Invalid typeinfo struct has annotation type. +Invalid typeinfo struct modulename. +Invalid typeinfo struct name. +Invalid typeinfo variant index type. +Invalid variable name. +Invalid variable private. +Invalid variant. +Invalid variant array. +Invalid variant block. +Invalid variant initializer count. +Invalid variant tuple. +Invalid variant type. +Invalid variant unique. +Invalid while condition type. +Invalid with array type. Invalid with type. -Invalid override. -Invalid name. -Invalid array dimension. -Invalid iteration source. -Invalid loop. -Invalid label. -Invalid enumeration. -Invalid or unsupported option. -Invalid member function. +Invalid yield. +Invalid yield in block. +Missing annotation. +Missing assume type. +Missing bitfield init. +Missing block argument init. +Missing block result. +Missing enumeration zero. +Missing finalizer. +Missing for iterator. +Missing function body. +Missing function name. +Missing function result. +Missing global. +Missing global init. +Missing global shared init. +Missing local. +Missing local block init. +Missing local init. +Missing local reference init. +Missing new default initializer. +Missing result. +Missing structure field. +Missing typeinfo subexpression. +Mismatching array dimension. +Mismatching array element type. +Mismatching block argument type. +Mismatching clone type. +Mismatching function argument. +Mismatching function argument count. +Mismatching numeric type. +Mismatching result type. +Mismatching structure dimension. +Mismatching tuple argument count. +Mismatching tuple field names. +Mismatching type. +Mismatching variant dimension. +Argument size exceeds limit. +Array index size exceeds limit. +Call depth size exceeds limit. +Expression recursion size exceeds limit. +Function argument size exceeds limit. +Infer passes size exceeds limit. +Local size exceeds limit. +New argument size exceeds limit. +Structure size exceeds limit. +Tuple index size exceeds limit. +Type size exceeds limit. +Type alias size exceeds limit. +Typeinfo sizeof size exceeds limit. +Ambiguous annotation. +Ambiguous bitfield. +Ambiguous call macro. +Ambiguous enumeration. +Ambiguous field. +Ambiguous field lookup. +Ambiguous finalizer. +Ambiguous function. +Ambiguous macro. +Ambiguous structure. +Ambiguous super call. +Ambiguous super constructor. +Ambiguous type. +Ambiguous type alias. +Ambiguous typeinfo macro. +Ambiguous variable. +Assume alias already declared. +Block argument already declared. Function already declared. -Argument already declared. +Label already declared. Local variable already declared. -Global variable already declared. -Structure field already declared. -Structure already declared. -Structure already has initializer. -Enumeration already declared. -Enumeration value already declared. -Type alias already declared. -Field already initialized. -Type not found. -Structure not found. -Operator not found. +Structure field init already declared. +Table already declared. +Tuple field already declared. +Variable already declared. +With shadow already declared. +Annotation field not found. +Argument type not found. +Bitfield not found. +Block argument type not found. +Block result type not found. +Cast type not found. +Constructor not found. +Expression type not found. +Field not found. +Field type not found. Function not found. +Function address type not found. +Function argument type not found. +Function mangled name not found. +Function result type not found. +Function type not found. +Generator type not found. +Global type not found. +Is expression type not found. +Label not found. +Local type not found. +Macro not found. +Method not found. +New type not found. +Safe field type not found. +Structure field not found. +Structure field type not found. +Super class not found. +Super constructor not found. +Super finalizer not found. +Super method not found. +Tuple field not found. +Type not found. +Typeinfo annotation not found. +Typeinfo annotation argument not found. +Typeinfo macro not found. +Typeinfo offsetof type not found. +Typeinfo type not found. Variable not found. -Handle not found. -Annotation not found. -Enumeration not found. -Enumeration value not found. -Type alias not found. -Bitfield not found. -Can't initialize. -Can't dereference (not a pointer or dereferencable type). -Can't index (not an array, table, or indexable type). -Can't get field (not a structure or table type). -Can't write to const. -Can't move to const. -Can't write to non-reference. +Variant field not found. +Variant type not found. +Can't access private field. +Can't access private structure. +Can't address function. +Can't address template function. +Can't annotation field. +Can't apply op. +Can't argument. +Can't argument structure. +Can't array element. +Can't ascend. +Can't assign op. +Can't block. +Can't capture variable. +Can't clone. +Can't clone type. Can't copy. +Can't create structure annotation. +Can't delete. +Can't delete local. +Can't delete smart pointer. +Can't delete super. +Can't dereference. +Can't expression. +Can't field class. +Can't finalize block annotation. +Can't finalize function annotation. +Can't finalize structure annotation. +Can't function. +Can't get field. +Can't get field pointer. +Can't global. +Can't index. +Can't index key. +Can't index pointer. +Can't index table. +Can't initialize array element. +Can't initialize private field. +Can't initialize structure field. +Can't initialize variant field. +Can't iterate iterator. +Can't local. Can't move. -Can't pass temporary value to non-temporary parameter. -Condition must be boolean. -Condition must be static (for 'static_if' and 'static_elif') -Can't pipe (invalid left-hand side or right-hand side). -Invalid block. -Return or break in finally section is not allowed. -Module not found. -Module already has a name. -Can't new handled type. -Bad delete. -Can't infer generic. -Can't infer missing initializer. -Can't infer mismatching restrictions. -Invalid cast. -Incompatible cast. -Unsafe operation. -Index out of range. -Expecting return value. -Not expecting return value (void function or block). -Invalid return semantics. -Invalid yield. -'typeinfo' error, the type is a reference. -'typeinfo' error, the type is auto. -'typeinfo' error, the type is undefined. -'typeinfo' error, the type is not a static array. -Macro returned error. +Can't pointer. +Can't result. +Can't safe get field. +Can't safe index. +Can't safe index table. +Can't structure field. +Can't take pointer. +Can't tuple. +Can't type. +Can't variant field. +Can't write. +Unsafe address. +Unsafe argument. +Unsafe array safe index. +Unsafe capture variable. +Unsafe cast. +Unsafe class. +Unsafe class initializer. +Unsafe class local. +Unsafe class stack construction. +Unsafe delete. +Unsafe delete pointer. +Unsafe fixed array safe index. +Unsafe function. +Unsafe function call. +Unsafe global. +Unsafe global pointer. +Unsafe local. +Unsafe local class. +Unsafe local in scope required. +Unsafe local reference. +Unsafe local type. +Unsafe move. +Unsafe operator. +Unsafe pointer index. +Unsafe pointer safe index. +Unsafe return block. +Unsafe return function. +Unsafe return reference. +Unsafe return smart pointer. +Unsafe smart pointer. +Unsafe structure field. +Unsafe structure uninitialized. +Unsafe structure visibility. +Unsafe table index. +Unsafe table safe index. +Unsafe variant field. +Unsafe variant safe as. +Disallowed recursion in argument. +Disallowed recursion in assume alias. +Disallowed recursion in function. +Disallowed recursion in function argument. +Disallowed recursion in global. +Disallowed recursion in structure. +Disallowed recursion in type alias. +Runtime failure in annotation transform. +Runtime failure in call macro. +Runtime failure in expression. +Runtime failure in macro exception. +Runtime failure in macro infer. +Runtime failure in macro performance. +Runtime failure in macro style. +Runtime failure in structure annotation. +Runtime failure in typeinfo macro. +Argument type not resolved yet. +Array dimension not resolved yet. +Array type not resolved yet. +Bitfield type not resolved yet. +Block not resolved yet. +Block argument not resolved yet. +Block argument init not resolved yet. +Class type not resolved yet. +Comprehension type not resolved yet. +Delete size type not resolved yet. +Dereference type not resolved yet. +Enumerator not resolved yet. +Expression type not resolved yet. +Function not resolved yet. +Function block not resolved yet. +Generator block not resolved yet. +Index type not resolved yet. +Invoke argument type not resolved yet. +Is expression type not resolved yet. +Label type not resolved yet. +Lambda block not resolved yet. +Local type not resolved yet. +Method call not resolved yet. +New type not resolved yet. +Null coalescing type not resolved yet. +Structure not resolved yet. +Structure field not resolved yet. +Structure type not resolved yet. +Table type not resolved yet. +Tuple type not resolved yet. +Type not resolved yet. +Type alias not resolved yet. +Typeinfo not resolved yet. +Typeinfo alignof not resolved yet. +Typeinfo dim not resolved yet. +Typeinfo dim table not resolved yet. +Typeinfo sizeof not resolved yet. +Concept failed. +Condition must be bool. +Not expecting result. Static assert failed. -Run failed (attempt of folding constant function without side-effects failed) -Annotation throw panic during compile time. -Concept throw panic during compile time. -Not all paths return value. -Assert with side effects. -Only fast AOT no C++ name. +Invalid options. +Mismatching runtime type. +Mismatching runtime type hash. +Array size exceeds limit. +Global size exceeds limit. +Runtime buffer size exceeds limit. +Can't hash block. +Can't hash context. +Can't hash iterator. +Can't serialize block. +Can't serialize iterator. +Can't serialize null pointer. +Can't serialize pointer. +Can't serialize table. +Runtime failure in function. +Runtime failure in function annotation. +Runtime failure in global. +Runtime failure in macro. +Internal compiler error in annotation. +Internal compiler error in array. +Internal compiler error in array type. +Internal compiler error in block. +Internal compiler error in block missing return type. +Internal compiler error in class. +Internal compiler error in enumeration. +Internal compiler error in expression. +Internal compiler error in field. +Internal compiler error in function. +Internal compiler error in function annotation. +Internal compiler error in function changed. +Internal compiler error in function name. +Internal compiler error in function not resolved yet. +Internal compiler error in function refresh. +Internal compiler error in generator. +Internal compiler error in generator finalizer. +Internal compiler error in generator finalizer multiple. +Internal compiler error in generator finalizer name. +Internal compiler error in generator function name. +Internal compiler error in generator structure name. +Internal compiler error in global. +Internal compiler error in label. +Internal compiler error in lambda finalizer name. +Internal compiler error in lambda function name. +Internal compiler error in lambda in scope conversion. +Internal compiler error in lambda structure name. +Internal compiler error in macro. +Internal compiler error in name. +Internal compiler error in options. +Internal compiler error in pod analysis infer. +Internal compiler error in relocate infer. +Internal compiler error in structure. +Internal compiler error in structure block. +Internal compiler error in table. +Internal compiler error in tuple. +Internal compiler error in tuple type. +Internal compiler error in type. +Internal compiler error in type alias. +Internal compiler error in typeinfo macro. +Internal compiler error in variable. +Missing AOT generated code for the function. +Syntax error, usually invalid grammar. +Function not found. +Function already declared. +Invalid return type. +Invalid initialization type. +Invalid private. +Invalid static. AOT side effects. -No global heap is specified, but program requests it. -No global variables are allowed in this context. -Unused function argument. -Unsafe function. -Performance lint warning. -Too many infer passes. -Missing simulation node. \ No newline at end of file +Can't pipe. +Enumeration value already declared. +Invalid escape sequence. +Invalid option. +Module already has a name. +Type alias already declared. +Unsupported read macro. diff --git a/include/daScript/ast/ast.h b/include/daScript/ast/ast.h index 69811f8c95..f1771edafb 100644 --- a/include/daScript/ast/ast.h +++ b/include/daScript/ast/ast.h @@ -1701,6 +1701,7 @@ namespace das bool simulate ( Context & context, TextWriter & logs, StackAllocator * sharedStack = nullptr ); uint64_t getInitSemanticHashWithDep( uint64_t initHash ); void error ( const string & str, const string & extra, const string & fixme, const LineInfo & at, CompilationError cerr = CompilationError::unspecified ); + void deduplicateErrors (); bool failed() const { return failToCompile || macroException; } static ExpressionPtr makeConst ( const LineInfo & at, const TypeDeclPtr & type, vec4f value ); ExprLooksLikeCall * makeCall ( const LineInfo & at, const string & name ); diff --git a/include/daScript/ast/compilation_errors.h b/include/daScript/ast/compilation_errors.h index b74bef361f..4e60134999 100644 --- a/include/daScript/ast/compilation_errors.h +++ b/include/daScript/ast/compilation_errors.h @@ -4,178 +4,692 @@ namespace das { enum class CompilationError : int { - unspecified - -// lexer errors - - , mismatching_parentheses = 10001 - , mismatching_curly_bracers = 10002 - , string_constant_exceeds_file = 10003 - , string_constant_exceeds_line = 10004 - , unexpected_close_comment = 10005 // */ out of the bule - , integer_constant_out_of_range = 10006 - , comment_contains_eof = 10007 - , invalid_escape_sequence = 10008 // blah/yblah - , invalid_line_directive = 10009 // #row,col,"filename" is bad somehow - , floating_point_constant_out_of_range = 10010 - , nested_string_constant = 10011 // nested string constants are not allowed - -// parser errors - - , syntax_error = 20000 - , malformed_ast = 20001 // macro generated something, which is not a valid ast - -// semantic erros - - , invalid_type = 30101 // int & a[], int&&, int&* - , invalid_return_type = 30102 // func():blah& - , invalid_argument_type = 30103 // func(a:boxed&) - , invalid_structure_field_type = 30104 // struct a:void - , invalid_array_type = 30105 // array - , invalid_table_type = 30106 // table table table - , invalid_argument_count = 30107 // assert(), assert(blah,....) - , invalid_variable_type = 30108 // a:void - , invalid_new_type = 30109 // new int&, new int - , invalid_index_type = 30110 // a[wtf] - , invalid_annotation = 30111 // [wtf] a - , invalid_swizzle_mask = 30112 // vec.xxxxx or vec.xAz or vec.wtf - , invalid_initialization_type = 30113 // int a = "b" - , invalid_with_type = 30114 // with int - , invalid_override = 30115 // override new_field:blah, or old_field:blah without override - , invalid_name = 30116 // __anything - , invalid_array_dimension = 30117 // int blah[non-const] - , invalid_iteration_source = 30118 // for x in 10 - , invalid_loop = 30119 // for x, y in a etc - , invalid_label = 30120 // label not found etc - , invalid_enumeration = 30121 // enum foo = "blah" etc - , invalid_option = 30122 // option wtf = wth - , invalid_member_function = 30123 // member function in struct - , invalid_capture = 30124 // capture section in non-lambda, capture on non-variable, unused catpure, etc - , invalid_private = 30125 // struct member private, etc - , invalid_aka = 30126 // aka with global let, typedecl, etc - , invalid_assume = 30127 // assume with name collision - , invalid_static = 30128 // struct member static, override static, sealed static, things like that - - , function_already_declared = 30201 // func x .... func x - , argument_already_declared = 30202 // func(...,a,...,a,....) - , local_variable_already_declared = 30203 // let(...,x,...,x,...) - , global_variable_already_declared = 30204 // let(...,x,...,x,...) - , structure_field_already_declared = 30205 // struct ... x ... x - , structure_already_declared = 30206 // ... struct x ... struct x ... - , structure_already_has_initializer = 30207 // struct Foo x = 5; def Foo() ... - , enumeration_already_declared = 30208 // enum A; enumA - , enumeration_value_already_declared = 30209 // enum A { x; x } - , type_alias_already_declared = 30210 // typdef A = b; typedef A = ...; - , field_already_initialized = 30211 // typdef A = b; typedef A = ...; - , too_many_arguments = 30212 // func(x,y,z,....) with more than DAS_MAX_FUNCTION_ARGUMENTS arguments - , result_discarded = 30213 // func() returns something, but result is not used. function is marked as [nodiscard] - - , type_not_found = 30301 // a:wtf - , structure_not_found = 30302 // new wtf - , operator_not_found = 30303 // 1 + 1.0 - , function_not_found = 30304 // wtf(x) - , variable_not_found = 30305 // wtf - , handle_not_found = 30306 // external type has colliding name - , annotation_not_found = 30307 // [wtf] struct or [wtf] function - , enumeration_not_found = 30308 // WTF WTF enum - , enumeration_value_not_found = 30309 // enumt WTF - , type_alias_not_found = 30310 // typedef A =; typedef A =; ... - , bitfield_not_found = 30311 // bitfield a; a.three - - , cant_initialize = 30401 // block type declaration, default values - , cant_be_null = 30402 // expression can't be null - , exception_during_macro = 30403 // exception during macro - - , cant_dereference = 30501 - , cant_index = 30502 // wtf[a] - , cant_get_field = 30503 // wtf.field - , cant_write_to_const = 30504 // const int & a = 5 - , cant_move_to_const = 30505 // const array & a <- b - , cant_write_to_non_reference = 30506 // 1 = blah - , cant_copy = 30507 // a = array(x), expecting <- - , cant_move = 30508 // int a; a <- 1 - , cant_pass_temporary = 30509 // let t : int? = q // where q is int?# - - , condition_must_be_bool = 30601 // if ( 10 ) ... - , condition_must_be_static = 30602 // if ( constexpr ) only - - , cant_pipe = 30701 // wtf <| arg - - , invalid_block = 30801 // fn({ return; }), fn ({ break; }) - , return_or_break_in_finally = 30802 // if a {} finally { return blah; } - - , module_not_found = 30901 // require wtf - , module_already_has_a_name = 30902 // module a; module aa - , module_does_not_export_unused_symbols = 30903 // options remove_unused_symbols = false is missing from the module - , module_does_not_have_a_name = 30904 // missing module name for AOT module - , module_required_from_shared = 30905 // require non shared foo from shared bar - - , cant_new_handle = 31001 // new Handle - , bad_delete = 31002 // delete ; - - , cant_infer_generic = 31100 // TEMPORARY, REMOVE ONCE GENERICS ARE SUPPORTED - , cant_infer_missing_initializer = 31101 // let x = 5 - , cant_infer_mismatching_restrictions = 31102 // let x : auto [5] = int[4][3] - - , invalid_cast = 31200 // cast ... - , incompatible_cast = 31201 // cast bar - - , unsafe = 31300 // unsafe operation in safe function - - , index_out_of_range = 31400 // a:int[3] a[4] - - , expecting_return_value = 32101 // def blah:int without return - , not_expecting_return_value = 32102 // def blah:void ... return 12 - , invalid_return_semantics = 32103 // return <- required - , invalid_yield = 32104 // yield in block, yield in non generator, etc - , invalid_generator_finalizer = 32105 // generator with unspecified finalizer - - , unsupported_read_macro = 33100 // #what "" - , unsupported_call_macro = 33101 // apply failed etc - , unbound_macro_tag = 33102 // macro tag in the regular code - - , typeinfo_reference = 39901 // typeinfo(sizeof type int&) - , typeinfo_auto = 39902 // typeinfo(typename type auto) - , typeinfo_undefined = 39903 // typeinfo(??? ...) - , typeinfo_dim = 39904 // typeinfo(dim non_array) - , typeinfo_macro_error = 39905 // typeinfo(custom ...) returns errors - -// logic errors - - , static_assert_failed = 40100 // static_assert(false) - , run_failed = 40101 // [run]def fn; ..... fn(nonconst) - , annotation_failed = 40102 // annotation->verifyCall failed - , concept_failed = 40103 // similar to static_assert(false), but error reported 1up on stack - , macro_failed = 40104 // user did something in the macro, it went kaboom - - , not_all_paths_return_value = 40200 // def a() { if true return 1; } - , assert_with_side_effects = 40201 // assert(i++) - , only_fast_aot_no_cpp_name = 40202 // blah() of the function without cppName - , aot_side_effects = 40203 // eval(a++,b++,a+b) - , no_global_heap = 40204 // let a = {{ }} - , no_global_variables = 40205 // var a = ... - , unused_function_argument = 40206 // def foo ( a ) ..... /* no a here */ - , unsafe_function = 40207 // [unsafe] when code of policies prohibits - , unused_block_argument = 40208 // foo() <| $ ( a ) ..... /* no a here */ - , top_level_no_sideeffect_operation = 40209 // a == b - , deprecated_function = 40210 // [deprecated] function - , argument_aliasing = 40211 // a = fun(a) with some form of potential cmres - , make_local_aliasing = 40212 // a = [[... a.x ...]] with some form of potential cmres - , in_scope_in_the_loop = 40213 // for ( a in b ) { let in scope ... ; } - , no_init = 40214 // [init] disabled via options or CodeOfPolicies - , no_writing_to_nameless = 40215 // writing to nameless variable, like in a().b = 5 - , table_lookup_collision = 40216 // multiple lookups of the same table in the same expression, i.e. tab[1] = tab[2] - , performance_lint = 40217 // performance lint warning from perf_lint module - , style_lint = 40218 // style lint warning from style_lint module - - , duplicate_key = 40300 // { 1:1, ..., 1:* } - - , too_many_infer_passes = 41000 - -// integration errors - - , missing_node = 50100 // handled type requires simulateGetXXX - , missing_aot = 50101 // AOT hash function missing - , internal_error = 59999 // internal error + unspecified = 0 + + +// ===== stage 1xxxx (lex) ===== + + +// invalid_* + + , invalid_line = 10100 // 7 site(s) + , invalid_string = 10101 // 2 site(s) + +// mismatching_* + + , mismatching_curly_bracers = 10200 // 5 site(s) + , mismatching_module_name = 10201 // 4 site(s) + , mismatching_parens = 10202 // 8 site(s) + +// exceeds_* + + , exceeds_constant = 10300 // 38 site(s) + , exceeds_file = 10301 // 8 site(s) + +// ===== stage 2xxxx (parse) ===== + + +// invalid_* + + , invalid_aka = 20100 // 1 site(s) + , invalid_capture = 20103 // 2 site(s) + , invalid_escape = 20105 // 2 site(s) + , invalid_field = 20107 // 2 site(s) + , invalid_field_static = 20108 // 2 site(s) + , invalid_function = 20109 // 9 site(s) + , invalid_function_annotation = 20110 // 1 site(s) + , invalid_function_static = 20111 // 1 site(s) + , invalid_global_aka = 20112 // 2 site(s) + , invalid_macro = 20113 // 2 site(s) + , invalid_module = 20114 // 2 site(s) + , invalid_module_require = 20115 // 1 site(s) + , invalid_name = 20116 // 1 site(s) + , invalid_type_aka = 20120 // 1 site(s) + , invalid_type_alias = 20121 // 3 site(s) + +// missing_* + + , missing_module_name = 20201 // 2 site(s) + +// exceeds_* + + , exceeds_bitfield = 20300 // 4 site(s) + +// ambiguous_* + + , ambiguous_function_argument_type = 20402 // 1 site(s) + +// already_declared_* + + , already_declared_enumeration = 20501 // 1 site(s) + , already_declared_enumerator = 20502 // 4 site(s) + , already_declared_field = 20503 // 1 site(s) + , already_declared_field_static = 20504 // 1 site(s) + , already_declared_function_argument = 20506 // 1 site(s) + , already_declared_global = 20507 // 3 site(s) + , already_declared_global_bitfield = 20508 // 1 site(s) + , already_declared_local = 20509 // 2 site(s) + , already_declared_module = 20510 // 3 site(s) + , already_declared_module_name = 20511 // 2 site(s) + , already_declared_structure = 20512 // 2 site(s) + , already_declared_type_alias = 20513 // 10 site(s) + +// lookup_* + + , lookup_annotation = 20600 // 5 site(s) + , lookup_enumeration = 20602 // 1 site(s) + , lookup_file = 20603 // 5 site(s) + , lookup_module = 20605 // 2 site(s) + , lookup_structure = 20606 // 1 site(s) + +// cant_* + + , cant_structure = 20701 // 1 site(s) + +// runtime_* + + , runtime_annotation = 20800 // 4 site(s) + +// internal_* + + , internal_module = 20901 // 2 site(s) + +// ===== stage 3xxxx (semantic) ===== + + +// invalid_* + + , invalid_annotation = 30100 // 23 site(s) + , invalid_annotation_field = 30101 // 1 site(s) + , invalid_annotation_macro = 30102 // 1 site(s) + , invalid_annotation_type = 30103 // 1 site(s) + , invalid_argument = 30104 // 6 site(s) + , invalid_argument_global = 30105 // 4 site(s) + , invalid_argument_name = 30106 // 3 site(s) + , invalid_argument_type = 30107 // 3 site(s) + , invalid_array = 30108 // 6 site(s) + , invalid_array_dimension = 30109 // 5 site(s) + , invalid_array_dimension_type = 30110 // 1 site(s) + , invalid_array_element_type = 30111 // 1 site(s) + , invalid_array_type = 30112 // 5 site(s) + , invalid_as = 30113 // 1 site(s) + , invalid_ascend_array_handle_type = 30114 // 1 site(s) + , invalid_ascend_handle_type = 30115 // 1 site(s) + , invalid_assert_argument_count = 30116 // 1 site(s) + , invalid_assert_comment_type = 30117 // 1 site(s) + , invalid_assert_condition_type = 30118 // 1 site(s) + , invalid_bitfield = 30119 // 1 site(s) + , invalid_bitfield_cast_argument_count = 30120 // 1 site(s) + , invalid_block_argument = 30121 // 2 site(s) + , invalid_block_argument_count = 30122 // 1 site(s) + , invalid_block_argument_init_type = 30123 // 3 site(s) + , invalid_block_argument_type = 30124 // 1 site(s) + , invalid_block_break = 30125 // 1 site(s) + , invalid_block_continue = 30126 // 1 site(s) + , invalid_block_finally = 30127 // 1 site(s) + , invalid_break = 30128 // 1 site(s) + , invalid_capture_variable = 30129 // 1 site(s) + , invalid_cast_function = 30130 // 1 site(s) + , invalid_cast_structure = 30131 // 2 site(s) + , invalid_cast_structure_pointer = 30132 // 2 site(s) + , invalid_cast_type = 30133 // 1 site(s) + , invalid_class = 30134 // 2 site(s) + , invalid_class_local = 30135 // 1 site(s) + , invalid_class_tuple = 30136 // 1 site(s) + , invalid_class_variant = 30137 // 1 site(s) + , invalid_clone_smart_pointer_type = 30138 // 1 site(s) + , invalid_comprehension_element_type = 30139 // 1 site(s) + , invalid_continue = 30140 // 1 site(s) + , invalid_debug_argument_count = 30141 // 1 site(s) + , invalid_debug_comment_type = 30142 // 1 site(s) + , invalid_delete_size_type = 30143 // 1 site(s) + , invalid_delete_super_self_type = 30144 // 1 site(s) + , invalid_enumeration = 30145 // 1 site(s) + , invalid_enumeration_name = 30146 // 1 site(s) + , invalid_enumerator = 30147 // 1 site(s) + , invalid_enumerator_name = 30148 // 1 site(s) + , invalid_enumerator_type = 30149 // 1 site(s) + , invalid_erase_argument_count = 30150 // 1 site(s) + , invalid_expression = 30151 // 17 site(s) + , invalid_field_name = 30152 // 1 site(s) + , invalid_field_syntax = 30153 // 1 site(s) + , invalid_field_type = 30154 // 1 site(s) + , invalid_finally_in_generator_if = 30155 // 2 site(s) + , invalid_find_argument_count = 30156 // 1 site(s) + , invalid_for_iterator_count = 30157 // 1 site(s) + , invalid_for_iterator_tuple = 30158 // 1 site(s) + , invalid_function_argument = 30159 // 3 site(s) + , invalid_function_argument_count = 30160 // 1 site(s) + , invalid_function_argument_type = 30161 // 4 site(s) + , invalid_function_argument_type_block = 30162 // 1 site(s) + , invalid_function_name = 30163 // 1 site(s) + , invalid_function_options = 30164 // 1 site(s) + , invalid_function_result = 30165 // 1 site(s) + , invalid_function_result_discarded = 30166 // 1 site(s) + , invalid_function_result_type = 30167 // 2 site(s) + , invalid_function_type = 30168 // 1 site(s) + , invalid_generator = 30169 // 1 site(s) + , invalid_generator_argument_count = 30170 // 2 site(s) + , invalid_generator_argument_type = 30171 // 1 site(s) + , invalid_generator_result_type = 30172 // 1 site(s) + , invalid_global = 30173 // 1 site(s) + , invalid_global_init_options = 30174 // 1 site(s) + , invalid_global_init_type = 30175 // 3 site(s) + , invalid_global_options = 30176 // 1 site(s) + , invalid_global_self_init = 30177 // 1 site(s) + , invalid_global_shared = 30178 // 1 site(s) + , invalid_global_type = 30179 // 3 site(s) + , invalid_global_type_shared = 30180 // 1 site(s) + , invalid_handle_index_type = 30181 // 1 site(s) + , invalid_handle_safe_index_type = 30182 // 1 site(s) + , invalid_if_condition_type = 30183 // 1 site(s) + , invalid_index_type = 30184 // 7 site(s) + , invalid_insert_argument_count = 30185 // 1 site(s) + , invalid_invoke_argument_count = 30186 // 3 site(s) + , invalid_invoke_argument_type = 30187 // 2 site(s) + , invalid_invoke_method_syntax = 30188 // 2 site(s) + , invalid_invoke_target_type = 30189 // 3 site(s) + , invalid_is = 30190 // 1 site(s) + , invalid_is_expression = 30191 // 1 site(s) + , invalid_iteration_source_type = 30192 // 1 site(s) + , invalid_key_exists_argument_count = 30193 // 1 site(s) + , invalid_label_type = 30194 // 1 site(s) + , invalid_local_in_scope = 30195 // 1 site(s) + , invalid_local_in_scope_finally = 30196 // 1 site(s) + , invalid_local_init = 30197 // 3 site(s) + , invalid_local_init_block = 30198 // 1 site(s) + , invalid_local_init_constructor = 30199 // 1 site(s) + , invalid_local_init_type = 30200 // 4 site(s) + , invalid_local_tuple_expansion = 30201 // 1 site(s) + , invalid_local_type = 30202 // 1 site(s) + , invalid_macro_context = 30203 // 1 site(s) + , invalid_macro_read = 30204 // 1 site(s) + , invalid_macro_tag = 30205 // 1 site(s) + , invalid_macro_type = 30206 // 1 site(s) + , invalid_memzero_argument = 30207 // 1 site(s) + , invalid_memzero_argument_count = 30208 // 1 site(s) + , invalid_memzero_argument_type = 30209 // 1 site(s) + , invalid_module_name = 30210 // 1 site(s) + , invalid_new_class_syntax = 30211 // 1 site(s) + , invalid_new_initializer_result_type = 30212 // 1 site(s) + , invalid_new_initializer_type = 30213 // 1 site(s) + , invalid_new_type = 30214 // 5 site(s) + , invalid_null_coalescing_type = 30215 // 2 site(s) + , invalid_op3_expression = 30216 // 1 site(s) + , invalid_pointer_arithmetic = 30218 // 2 site(s) + , invalid_quote_argument_count = 30219 // 1 site(s) + , invalid_result = 30220 // 1 site(s) + , invalid_result_type = 30221 // 5 site(s) + , invalid_return_semantics = 30222 // 2 site(s) + , invalid_safe_as = 30223 // 1 site(s) + , invalid_safe_dereference_type = 30224 // 3 site(s) + , invalid_safe_field_type = 30225 // 1 site(s) + , invalid_static_assert_argument_count = 30226 // 1 site(s) + , invalid_static_assert_comment_type = 30227 // 1 site(s) + , invalid_static_assert_condition_type = 30228 // 1 site(s) + , invalid_static_if_condition = 30229 // 1 site(s) + , invalid_storage_type_op = 30230 // 1 site(s) + , invalid_string_builder_argument = 30231 // 2 site(s) + , invalid_structure = 30232 // 3 site(s) + , invalid_structure_annotation = 30233 // 1 site(s) + , invalid_structure_array = 30234 // 1 site(s) + , invalid_structure_block_pipe = 30235 // 1 site(s) + , invalid_structure_field_init = 30236 // 1 site(s) + , invalid_structure_field_type = 30237 // 3 site(s) + , invalid_structure_initializer_required = 30238 // 1 site(s) + , invalid_structure_local = 30239 // 1 site(s) + , invalid_structure_name = 30240 // 1 site(s) + , invalid_structure_template = 30241 // 1 site(s) + , invalid_structure_tuple = 30242 // 1 site(s) + , invalid_structure_type = 30243 // 1 site(s) + , invalid_structure_variant = 30244 // 1 site(s) + , invalid_super_call = 30245 // 2 site(s) + , invalid_swizzle_mask = 30246 // 1 site(s) + , invalid_swizzle_type = 30247 // 1 site(s) + , invalid_table = 30248 // 2 site(s) + , invalid_table_argument_type = 30249 // 4 site(s) + , invalid_table_expression = 30250 // 1 site(s) + , invalid_table_index_type = 30251 // 1 site(s) + , invalid_table_key_type = 30252 // 4 site(s) + , invalid_table_safe_index_type = 30253 // 2 site(s) + , invalid_table_type = 30254 // 2 site(s) + , invalid_tuple = 30255 // 4 site(s) + , invalid_tuple_argument_type = 30256 // 1 site(s) + , invalid_tuple_block = 30257 // 1 site(s) + , invalid_tuple_key = 30258 // 1 site(s) + , invalid_tuple_key_type = 30259 // 1 site(s) + , invalid_tuple_type = 30260 // 2 site(s) + , invalid_tuple_variant = 30261 // 1 site(s) + , invalid_type = 30262 // 10 site(s) + , invalid_type_dimension = 30263 // 1 site(s) + , invalid_type_expression = 30264 // 1 site(s) + , invalid_typeinfo = 30265 // 1 site(s) + , invalid_typeinfo_annotation = 30266 // 1 site(s) + , invalid_typeinfo_annotation_argument_type = 30267 // 1 site(s) + , invalid_typeinfo_dim = 30268 // 1 site(s) + , invalid_typeinfo_dim_table = 30269 // 1 site(s) + , invalid_typeinfo_dim_table_type = 30270 // 2 site(s) + , invalid_typeinfo_function = 30271 // 1 site(s) + , invalid_typeinfo_has_field_type = 30272 // 1 site(s) + , invalid_typeinfo_mangled_subexpression = 30273 // 2 site(s) + , invalid_typeinfo_module_subexpression = 30274 // 1 site(s) + , invalid_typeinfo_offsetof_type = 30275 // 1 site(s) + , invalid_typeinfo_struct_get_annotation_argument_type = 30276 // 1 site(s) + , invalid_typeinfo_struct_has_annotation_argument_type = 30277 // 1 site(s) + , invalid_typeinfo_struct_has_annotation_type = 30278 // 1 site(s) + , invalid_typeinfo_struct_modulename = 30279 // 1 site(s) + , invalid_typeinfo_struct_name = 30280 // 1 site(s) + , invalid_typeinfo_variant_index_type = 30281 // 1 site(s) + , invalid_variable_name = 30282 // 3 site(s) + , invalid_variable_private = 30283 // 1 site(s) + , invalid_variant = 30284 // 5 site(s) + , invalid_variant_array = 30285 // 1 site(s) + , invalid_variant_block = 30286 // 1 site(s) + , invalid_variant_initializer_count = 30287 // 1 site(s) + , invalid_variant_tuple = 30288 // 1 site(s) + , invalid_variant_type = 30289 // 2 site(s) + , invalid_variant_unique = 30290 // 3 site(s) + , invalid_while_condition_type = 30291 // 1 site(s) + , invalid_with_array_type = 30292 // 1 site(s) + , invalid_with_type = 30293 // 1 site(s) + , invalid_yield = 30294 // 1 site(s) + , invalid_yield_in_block = 30295 // 1 site(s) + +// missing_* + + , missing_annotation = 30300 // 2 site(s) + , missing_assume_type = 30301 // 1 site(s) + , missing_bitfield_init = 30302 // 1 site(s) + , missing_block_argument_init = 30303 // 1 site(s) + , missing_block_result = 30304 // 1 site(s) + , missing_enumeration_zero = 30305 // 1 site(s) + , missing_finalizer = 30306 // 1 site(s) + , missing_for_iterator = 30307 // 1 site(s) + , missing_function_body = 30308 // 1 site(s) + , missing_function_name = 30309 // 1 site(s) + , missing_function_result = 30310 // 3 site(s) + , missing_global = 30311 // 1 site(s) + , missing_global_init = 30312 // 2 site(s) + , missing_global_shared_init = 30313 // 1 site(s) + , missing_local = 30314 // 1 site(s) + , missing_local_block_init = 30315 // 1 site(s) + , missing_local_init = 30316 // 2 site(s) + , missing_local_reference_init = 30317 // 1 site(s) + , missing_new_default_initializer = 30318 // 1 site(s) + , missing_result = 30319 // 1 site(s) + , missing_structure_field = 30320 // 1 site(s) + , missing_typeinfo_subexpression = 30321 // 4 site(s) + +// mismatching_* + + , mismatching_array_dimension = 30400 // 1 site(s) + , mismatching_array_element_type = 30401 // 1 site(s) + , mismatching_block_argument_type = 30402 // 1 site(s) + , mismatching_clone_type = 30403 // 1 site(s) + , mismatching_function_argument = 30404 // 1 site(s) + , mismatching_function_argument_count = 30405 // 1 site(s) + , mismatching_numeric_type = 30406 // 5 site(s) + , mismatching_result_type = 30407 // 1 site(s) + , mismatching_structure_dimension = 30408 // 1 site(s) + , mismatching_tuple_argument_count = 30409 // 1 site(s) + , mismatching_tuple_field_names = 30410 // 1 site(s) + , mismatching_type = 30411 // 3 site(s) + , mismatching_variant_dimension = 30412 // 1 site(s) + +// exceeds_* + + , exceeds_argument = 30500 // 2 site(s) + , exceeds_array_index = 30502 // 1 site(s) + , exceeds_call_depth = 30503 // 3 site(s) + , exceeds_expression_recursion = 30504 // 2 site(s) + , exceeds_function_argument = 30505 // 4 site(s) + , exceeds_infer_passes = 30507 // 2 site(s) + , exceeds_local = 30508 // 1 site(s) + , exceeds_new_argument = 30509 // 1 site(s) + , exceeds_structure = 30510 // 1 site(s) + , exceeds_tuple_index = 30511 // 1 site(s) + , exceeds_type = 30512 // 2 site(s) + , exceeds_type_alias = 30513 // 1 site(s) + , exceeds_typeinfo_sizeof = 30514 // 1 site(s) + +// ambiguous_* + + , ambiguous_annotation = 30600 // 2 site(s) + , ambiguous_bitfield = 30601 // 1 site(s) + , ambiguous_call_macro = 30602 // 1 site(s) + , ambiguous_enumeration = 30603 // 2 site(s) + , ambiguous_field = 30604 // 1 site(s) + , ambiguous_field_lookup = 30605 // 1 site(s) + , ambiguous_finalizer = 30606 // 1 site(s) + , ambiguous_function = 30607 // 7 site(s) + , ambiguous_macro = 30608 // 3 site(s) + , ambiguous_structure = 30609 // 2 site(s) + , ambiguous_super_call = 30610 // 1 site(s) + , ambiguous_super_constructor = 30611 // 1 site(s) + , ambiguous_type = 30612 // 1 site(s) + , ambiguous_type_alias = 30613 // 1 site(s) + , ambiguous_typeinfo_macro = 30614 // 1 site(s) + , ambiguous_variable = 30615 // 2 site(s) + +// already_declared_* + + , already_declared_assume_alias = 30700 // 8 site(s) + , already_declared_block_argument = 30701 // 5 site(s) + , already_declared_function = 30702 // 8 site(s) + , already_declared_label = 30703 // 1 site(s) + , already_declared_local_variable = 30704 // 5 site(s) + , already_declared_structure_field_init = 30705 // 1 site(s) + , already_declared_table = 30706 // 4 site(s) + , already_declared_tuple_field = 30707 // 1 site(s) + , already_declared_variable = 30708 // 5 site(s) + , already_declared_with_shadow = 30709 // 1 site(s) + +// lookup_* + + , lookup_annotation_field = 30800 // 1 site(s) + , lookup_argument_type = 30801 // 1 site(s) + , lookup_bitfield = 30802 // 3 site(s) + , lookup_block_argument_type = 30803 // 1 site(s) + , lookup_block_result_type = 30804 // 1 site(s) + , lookup_cast_type = 30805 // 2 site(s) + , lookup_constructor = 30806 // 1 site(s) + , lookup_expression_type = 30807 // 1 site(s) + , lookup_field = 30808 // 3 site(s) + , lookup_field_type = 30809 // 1 site(s) + , lookup_function = 30810 // 13 site(s) + , lookup_function_address_type = 30811 // 1 site(s) + , lookup_function_argument_type = 30812 // 1 site(s) + , lookup_function_mangled_name = 30813 // 1 site(s) + , lookup_function_result_type = 30814 // 1 site(s) + , lookup_function_type = 30815 // 1 site(s) + , lookup_generator_type = 30816 // 2 site(s) + , lookup_global_type = 30817 // 1 site(s) + , lookup_is_expression_type = 30818 // 1 site(s) + , lookup_label = 30819 // 1 site(s) + , lookup_local_type = 30820 // 1 site(s) + , lookup_macro = 30821 // 3 site(s) + , lookup_method = 30822 // 1 site(s) + , lookup_new_type = 30823 // 1 site(s) + , lookup_safe_field_type = 30824 // 1 site(s) + , lookup_structure_field = 30825 // 1 site(s) + , lookup_structure_field_type = 30826 // 1 site(s) + , lookup_super_class = 30827 // 1 site(s) + , lookup_super_constructor = 30828 // 1 site(s) + , lookup_super_finalizer = 30829 // 1 site(s) + , lookup_super_method = 30830 // 1 site(s) + , lookup_tuple_field = 30831 // 4 site(s) + , lookup_type = 30832 // 1 site(s) + , lookup_typeinfo_annotation = 30833 // 2 site(s) + , lookup_typeinfo_annotation_argument = 30834 // 1 site(s) + , lookup_typeinfo_macro = 30835 // 1 site(s) + , lookup_typeinfo_offsetof_type = 30836 // 1 site(s) + , lookup_typeinfo_type = 30837 // 1 site(s) + , lookup_variable = 30838 // 2 site(s) + , lookup_variant_field = 30839 // 8 site(s) + , lookup_variant_type = 30840 // 2 site(s) + +// cant_* + + , cant_access_private_field = 30900 // 1 site(s) + , cant_access_private_structure = 30901 // 1 site(s) + , cant_address_function = 30902 // 1 site(s) + , cant_address_template_function = 30903 // 1 site(s) + , cant_annotation_field = 30904 // 2 site(s) + , cant_apply_op = 30905 // 2 site(s) + , cant_argument = 30906 // 1 site(s) + , cant_argument_structure = 30907 // 1 site(s) + , cant_array_element = 30908 // 1 site(s) + , cant_ascend = 30909 // 1 site(s) + , cant_assign_op = 30910 // 2 site(s) + , cant_block = 30911 // 1 site(s) + , cant_capture_variable = 30912 // 6 site(s) + , cant_clone = 30913 // 4 site(s) + , cant_clone_type = 30914 // 2 site(s) + , cant_copy = 30915 // 3 site(s) + , cant_create_structure_annotation = 30916 // 1 site(s) + , cant_delete = 30917 // 3 site(s) + , cant_delete_local = 30918 // 1 site(s) + , cant_delete_smart_pointer = 30919 // 1 site(s) + , cant_delete_super = 30920 // 1 site(s) + , cant_dereference = 30921 // 6 site(s) + , cant_expression = 30922 // 14 site(s) + , cant_field_class = 30923 // 1 site(s) + , cant_finalize_block_annotation = 30924 // 1 site(s) + , cant_finalize_function_annotation = 30925 // 1 site(s) + , cant_finalize_structure_annotation = 30926 // 1 site(s) + , cant_function = 30927 // 2 site(s) + , cant_get_field = 30928 // 1 site(s) + , cant_get_field_pointer = 30929 // 1 site(s) + , cant_global = 30930 // 8 site(s) + , cant_index = 30931 // 1 site(s) + , cant_index_key = 30932 // 1 site(s) + , cant_index_pointer = 30933 // 2 site(s) + , cant_index_table = 30934 // 2 site(s) + , cant_initialize_array_element = 30935 // 1 site(s) + , cant_initialize_private_field = 30936 // 1 site(s) + , cant_initialize_structure_field = 30937 // 1 site(s) + , cant_initialize_variant_field = 30938 // 1 site(s) + , cant_iterate_iterator = 30939 // 1 site(s) + , cant_local = 30940 // 2 site(s) + , cant_move = 30941 // 5 site(s) + , cant_pointer = 30942 // 1 site(s) + , cant_result = 30943 // 3 site(s) + , cant_safe_get_field = 30944 // 2 site(s) + , cant_safe_index = 30945 // 1 site(s) + , cant_safe_index_table = 30946 // 1 site(s) + , cant_structure_field = 30947 // 4 site(s) + , cant_take_pointer = 30948 // 1 site(s) + , cant_tuple = 30949 // 1 site(s) + , cant_type = 30950 // 6 site(s) + , cant_variant_field = 30951 // 2 site(s) + , cant_write = 30952 // 1 site(s) + +// unsafe_* + + , unsafe_address = 31000 // 1 site(s) + , unsafe_argument = 31001 // 1 site(s) + , unsafe_array_safe_index = 31002 // 2 site(s) + , unsafe_capture_variable = 31003 // 2 site(s) + , unsafe_cast = 31004 // 1 site(s) + , unsafe_class = 31005 // 2 site(s) + , unsafe_class_initializer = 31006 // 1 site(s) + , unsafe_class_local = 31007 // 1 site(s) + , unsafe_class_stack_construction = 31008 // 1 site(s) + , unsafe_delete = 31009 // 1 site(s) + , unsafe_delete_pointer = 31010 // 1 site(s) + , unsafe_fixed_array_safe_index = 31011 // 1 site(s) + , unsafe_function = 31012 // 2 site(s) + , unsafe_function_call = 31013 // 3 site(s) + , unsafe_global = 31014 // 2 site(s) + , unsafe_global_pointer = 31015 // 1 site(s) + , unsafe_local = 31016 // 1 site(s) + , unsafe_local_class = 31017 // 1 site(s) + , unsafe_local_in_scope_required = 31018 // 1 site(s) + , unsafe_local_reference = 31019 // 1 site(s) + , unsafe_local_type = 31020 // 1 site(s) + , unsafe_move = 31021 // 1 site(s) + , unsafe_operator = 31022 // 2 site(s) + , unsafe_pointer_index = 31023 // 1 site(s) + , unsafe_pointer_safe_index = 31024 // 1 site(s) + , unsafe_return_block = 31025 // 1 site(s) + , unsafe_return_function = 31026 // 1 site(s) + , unsafe_return_reference = 31027 // 2 site(s) + , unsafe_return_smart_pointer = 31028 // 2 site(s) + , unsafe_smart_pointer = 31029 // 1 site(s) + , unsafe_structure_field = 31030 // 1 site(s) + , unsafe_structure_uninitialized = 31031 // 1 site(s) + , unsafe_structure_visibility = 31032 // 1 site(s) + , unsafe_table_index = 31033 // 1 site(s) + , unsafe_table_safe_index = 31034 // 2 site(s) + , unsafe_variant_field = 31035 // 2 site(s) + , unsafe_variant_safe_as = 31036 // 1 site(s) + +// recursion_* + + , recursion_argument = 31100 // 1 site(s) + , recursion_assume_alias = 31101 // 1 site(s) + , recursion_function = 31102 // 1 site(s) + , recursion_function_argument = 31103 // 2 site(s) + , recursion_global = 31104 // 1 site(s) + , recursion_structure = 31105 // 1 site(s) + , recursion_type_alias = 31106 // 1 site(s) + +// runtime_* + + , runtime_annotation_transform = 31200 // 1 site(s) + , runtime_call_macro = 31201 // 1 site(s) + , runtime_expression = 31202 // 2 site(s) + , runtime_macro_exception = 31206 // 1 site(s) + , runtime_macro_infer = 31207 // 1 site(s) + , runtime_macro_performance = 31208 // 1 site(s) + , runtime_macro_style = 31209 // 1 site(s) + , runtime_structure_annotation = 31210 // 1 site(s) + , runtime_typeinfo_macro = 31211 // 2 site(s) + +// not_resolved_yet_* + + , not_resolved_yet_argument_type = 31300 // 7 site(s) + , not_resolved_yet_array_dimension = 31301 // 3 site(s) + , not_resolved_yet_array_type = 31302 // 5 site(s) + , not_resolved_yet_bitfield_type = 31303 // 1 site(s) + , not_resolved_yet_block = 31304 // 2 site(s) + , not_resolved_yet_block_argument = 31305 // 1 site(s) + , not_resolved_yet_block_argument_init = 31306 // 1 site(s) + , not_resolved_yet_class_type = 31307 // 1 site(s) + , not_resolved_yet_comprehension_type = 31308 // 1 site(s) + , not_resolved_yet_delete_size_type = 31309 // 1 site(s) + , not_resolved_yet_dereference_type = 31310 // 1 site(s) + , not_resolved_yet_enumerator = 31311 // 3 site(s) + , not_resolved_yet_expression_type = 31312 // 2 site(s) + , not_resolved_yet_function = 31313 // 2 site(s) + , not_resolved_yet_function_block = 31314 // 1 site(s) + , not_resolved_yet_generator_block = 31315 // 1 site(s) + , not_resolved_yet_index_type = 31316 // 2 site(s) + , not_resolved_yet_invoke_argument_type = 31317 // 3 site(s) + , not_resolved_yet_is_expression_type = 31318 // 3 site(s) + , not_resolved_yet_label_type = 31319 // 1 site(s) + , not_resolved_yet_lambda_block = 31320 // 1 site(s) + , not_resolved_yet_local_type = 31321 // 1 site(s) + , not_resolved_yet_method_call = 31322 // 1 site(s) + , not_resolved_yet_new_type = 31323 // 1 site(s) + , not_resolved_yet_null_coalescing_type = 31324 // 1 site(s) + , not_resolved_yet_structure = 31325 // 1 site(s) + , not_resolved_yet_structure_field = 31326 // 1 site(s) + , not_resolved_yet_structure_type = 31327 // 1 site(s) + , not_resolved_yet_table_type = 31328 // 2 site(s) + , not_resolved_yet_tuple_type = 31329 // 2 site(s) + , not_resolved_yet_type = 31330 // 4 site(s) + , not_resolved_yet_type_alias = 31331 // 1 site(s) + , not_resolved_yet_typeinfo = 31332 // 2 site(s) + , not_resolved_yet_typeinfo_alignof = 31333 // 1 site(s) + , not_resolved_yet_typeinfo_dim = 31334 // 1 site(s) + , not_resolved_yet_typeinfo_dim_table = 31335 // 1 site(s) + , not_resolved_yet_typeinfo_sizeof = 31336 // 1 site(s) + +// unspecified_* + + , concept_failed = 31400 // 1 site(s) + , condition_must_be_bool = 31401 // 1 site(s) + , not_expecting_result = 31402 // 1 site(s) + , static_assert_failed = 31403 // 1 site(s) + +// ===== stage 5xxxx (integration) ===== + + +// invalid_* + + , invalid_options = 50100 // 5 site(s) + +// mismatching_* + + , mismatching_runtime_type = 50200 // 1 site(s) + , mismatching_runtime_type_hash = 50201 // 1 site(s) + +// exceeds_* + + , exceeds_array = 50300 // 2 site(s) + , exceeds_global = 50301 // 3 site(s) + , exceeds_runtime_buffer = 50302 // 1 site(s) + +// cant_* + + , cant_hash_block = 50400 // 1 site(s) + , cant_hash_context = 50401 // 1 site(s) + , cant_hash_iterator = 50402 // 1 site(s) + , cant_serialize_block = 50403 // 1 site(s) + , cant_serialize_iterator = 50404 // 1 site(s) + , cant_serialize_null_pointer = 50405 // 1 site(s) + , cant_serialize_pointer = 50406 // 2 site(s) + , cant_serialize_table = 50407 // 1 site(s) + +// runtime_* + + , runtime_function = 50500 // 3 site(s) + , runtime_function_annotation = 50501 // 5 site(s) + , runtime_global = 50502 // 2 site(s) + , runtime_macro = 50503 // 6 site(s) + +// internal_* + + , internal_annotation = 50600 // 4 site(s) + , internal_array = 50601 // 2 site(s) + , internal_array_type = 50602 // 2 site(s) + , internal_block = 50603 // 2 site(s) + , internal_block_missing_return_type = 50604 // 1 site(s) + , internal_class = 50605 // 1 site(s) + , internal_enumeration = 50606 // 1 site(s) + , internal_expression = 50607 // 26 site(s) + , internal_field = 50608 // 1 site(s) + , internal_function = 50609 // 9 site(s) + , internal_function_annotation = 50610 // 1 site(s) + , internal_function_changed = 50611 // 1 site(s) + , internal_function_name = 50612 // 1 site(s) + , internal_function_not_resolved_yet = 50613 // 2 site(s) + , internal_function_refresh = 50614 // 1 site(s) + , internal_generator = 50615 // 2 site(s) + , internal_generator_finalizer = 50616 // 1 site(s) + , internal_generator_finalizer_multiple = 50617 // 1 site(s) + , internal_generator_finalizer_name = 50618 // 1 site(s) + , internal_generator_function_name = 50619 // 1 site(s) + , internal_generator_structure_name = 50620 // 1 site(s) + , internal_global = 50621 // 2 site(s) + , internal_label = 50622 // 1 site(s) + , internal_lambda_finalizer_name = 50623 // 1 site(s) + , internal_lambda_function_name = 50624 // 1 site(s) + , internal_lambda_in_scope_conversion = 50625 // 1 site(s) + , internal_lambda_structure_name = 50626 // 1 site(s) + , internal_macro = 50627 // 3 site(s) + , internal_name = 50628 // 2 site(s) + , internal_options = 50629 // 2 site(s) + , internal_pod_analysis_infer = 50630 // 1 site(s) + , internal_relocate_infer = 50631 // 1 site(s) + , internal_structure = 50632 // 2 site(s) + , internal_structure_block = 50633 // 1 site(s) + , internal_table = 50634 // 4 site(s) + , internal_tuple = 50635 // 1 site(s) + , internal_tuple_type = 50636 // 1 site(s) + , internal_type = 50637 // 15 site(s) + , internal_type_alias = 50638 // 1 site(s) + , internal_typeinfo_macro = 50639 // 1 site(s) + , internal_variable = 50640 // 3 site(s) + + // ===== preserved for direct (non-error()) callers ===== + , missing_aot = 50101 // Program::linkError direct + , syntax_error = 20001 // ds_*lexer.lpp default-arg for yyfatalerror + , function_not_found = 30341 // reportMissing(...) calls + , function_already_declared = 30342 // reportMissing(...) calls + , invalid_return_type = 30343 // verifyReturnType helper + , invalid_initialization_type = 30344 // verifyInitTypeMatch helper + , invalid_private = 30345 // parser_impl.cpp private-modifier + , invalid_static = 30346 // parser_impl.cpp static-modifier + , aot_side_effects = 40500 // ast_lint AOT side-effects warning + // dasFormatter (utils/dasFormatter/ds_parser.ypp) — older parser, not audited + , cant_pipe = 30347 // dasFormatter parser + , enumeration_value_already_declared = 30348 // dasFormatter parser + , invalid_escape_sequence = 10005 // dasFormatter parser + , invalid_option = 30349 // dasFormatter parser + , module_already_has_a_name = 30350 // dasFormatter parser + , type_alias_already_declared = 30351 // dasFormatter parser + , unsupported_read_macro = 30352 // dasFormatter parser }; } diff --git a/skills/documentation_rst.md b/skills/documentation_rst.md index 8c642cb17b..1935dc0d6f 100644 --- a/skills/documentation_rst.md +++ b/skills/documentation_rst.md @@ -155,11 +155,10 @@ After creating or modifying any RST files, stdlib documentation, or `daslib/*.da 2. **Clean Sphinx build** — MUST delete cache; cached builds hide errors: ``` - cd d:/Work/daScript/doc - rm -rf sphinx-build ../site/doc - d:/Work/daScript/.venv/Scripts/sphinx-build.exe -b html -d sphinx-build source ../site/doc 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | tee /tmp/sphinx_out.txt + rm -rf doc/sphinx-build site/doc + sphinx-build -b html -d doc/sphinx-build doc/source site/doc 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | tee /tmp/sphinx_out.txt ``` - Sphinx is installed in the project venv (`d:/Work/daScript/.venv/Scripts/sphinx-build.exe`). + Use `sphinx-build` from PATH. If unavailable, install with `pip install sphinx` (or `python -m pip install sphinx`). The repo `.venv/` is not maintained — don't rely on it. 3. **Verify no new errors or warnings**: Strip ANSI codes and check the build output: ``` diff --git a/skills/make_pr.md b/skills/make_pr.md index 66c352e9d2..8a1f864543 100644 --- a/skills/make_pr.md +++ b/skills/make_pr.md @@ -196,13 +196,14 @@ Must return empty. If not, go back to step 4a and add the missing function to a MUST delete cache — cached builds hide errors: ```bash -cd d:/Work/daScript/doc -rm -rf sphinx-build ../site/doc -d:/Work/daScript/.venv/Scripts/sphinx-build.exe -b html -d sphinx-build source ../site/doc 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | tee /tmp/sphinx_out.txt +rm -rf doc/sphinx-build site/doc +sphinx-build -b html -d doc/sphinx-build doc/source site/doc 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | tee /tmp/sphinx_out.txt tail -3 /tmp/sphinx_out.txt grep -iE "warning:|error:" /tmp/sphinx_out.txt ``` +Use `sphinx-build` from PATH. If unavailable, install with `pip install sphinx` (or `python -m pip install sphinx`) and re-run. The repo `.venv/` is not maintained — don't rely on it. + Must say `build succeeded.` with **zero** warnings and errors. The `grep` must return empty. Common Sphinx issues: diff --git a/skills/perf_lint.md b/skills/perf_lint.md index 315bef552f..ab50ce8bd4 100644 --- a/skills/perf_lint.md +++ b/skills/perf_lint.md @@ -2,16 +2,16 @@ ## Overview -The `perf_lint` module detects common performance anti-patterns in daslang code at compile time. It uses a `[lint_macro]` AST pass that walks the compiled program looking for known-slow patterns and reports them as `CompilationError::performance_lint` (error code 40217). +The `perf_lint` module detects common performance anti-patterns in daslang code at compile time. It uses a `[lint_macro]` AST pass that walks the compiled program looking for known-slow patterns and reports them as `CompilationError::runtime_macro_performance` (error code 31208). ## Architecture - **Module:** `daslib/perf_lint.das` — `module perf_lint shared private` - **Entry point:** `[lint_macro] class PerfLintMacro : AstPassMacro` calls `perf_lint(prog, true)` - **Visitor:** `class PerfLintVisitor : AstVisitor` — walks the AST with loop depth tracking -- **Error reporting:** `macro_performance_warning(compiling_program(), at, message)` — reports as error code 40217 +- **Error reporting:** `macro_performance_warning(compiling_program(), at, message)` — reports as error code 31208 - **Utility:** `utils/lint/main.das` — unified lint checker (all 3 passes: paranoid, perf, style) -- **Tests:** `utils/lint/tests/` — one file per rule with `expect 40217:N` +- **Tests:** `utils/lint/tests/` — one file per rule with `expect 31208:N` ## How to Add a New Rule @@ -61,7 +61,7 @@ options gen2 // for (i in range(100)) { write(w, "x") } // } -expect 40217:N // where N = number of warnings this file should produce +expect 31208:N // where N = number of warnings this file should produce require daslib/perf_lint diff --git a/skills/style_lint.md b/skills/style_lint.md index 7aff4e20d0..54c2a4b849 100644 --- a/skills/style_lint.md +++ b/skills/style_lint.md @@ -2,14 +2,14 @@ ## Overview -The `style_lint` module detects non-idiomatic patterns in daslang code at compile time. It uses a `[lint_macro]` AST pass that walks the compiled program looking for known style issues and reports them as `CompilationError::style_lint` (error code 40218). +The `style_lint` module detects non-idiomatic patterns in daslang code at compile time. It uses a `[lint_macro]` AST pass that walks the compiled program looking for known style issues and reports them as `CompilationError::runtime_macro_style` (error code 31209). ## Architecture - **Module:** `daslib/style_lint.das` — `module style_lint shared private` - **Entry point:** `[lint_macro] class StyleLintMacro : AstPassMacro` calls `style_lint(prog, true)` with `comment_hygiene` read from `options _comment_hygiene` - **Visitor:** `class StyleLintVisitor : AstVisitor` — walks the AST with source-line inspection -- **Error reporting:** `macro_style_warning(compiling_program(), at, message)` — reports as error code 40218 +- **Error reporting:** `macro_style_warning(compiling_program(), at, message)` — reports as error code 31209 - **Utility:** `utils/lint/main.das` — unified lint checker (all 3 passes: paranoid, perf, style) - **Tests:** `utils/lint/tests/` — one file per rule diff --git a/src/ast/ast.cpp b/src/ast/ast.cpp index e3f7328fed..a72fc69c48 100644 --- a/src/ast/ast.cpp +++ b/src/ast/ast.cpp @@ -2975,6 +2975,95 @@ namespace das { failToCompile = true; } + // Identify the "not_resolved_yet" follow-on family by numeric range. + // All `not_resolved_yet_*` codes live in the 31300-31399 block (the + // `not_resolved_yet` facet cluster within stage 3, semantic). See + // include/daScript/ast/compilation_errors.h. + static __forceinline bool isNotResolvedYet ( CompilationError cerr ) { + int v = int(cerr); + return v >= 31300 && v < 31400; + } + + void Program::deduplicateErrors () { + if ( errors.size() < 2 ) return; + // errors are already sorted by Error::operator< (at, what, extra, fixme) + // before this is called. + + // Pass 1: scan for "primary" errors. A primary is any error whose cerr + // is neither `unspecified` nor in the not_resolved_yet family. If any + // primary exists program-wide, Rule 4 drops every not_resolved_yet + // error; if any same-line coded error exists, Rule 3 drops same-line + // unspecified entries. + bool anyPrimaryProgramWide = false; + das_hash_set linesWithCoded; + auto lineKey = [](const LineInfo & at) -> uint64_t { + return (uint64_t(uintptr_t(at.fileInfo)) ^ uint64_t(at.line)) * 0x9E3779B97F4A7C15ull; + }; + for ( const auto & e : errors ) { + if ( e.cerr != CompilationError::unspecified && !isNotResolvedYet(e.cerr) ) { + anyPrimaryProgramWide = true; + } + if ( e.cerr != CompilationError::unspecified ) { + linesWithCoded.insert(lineKey(e.at)); + } + } + + // Pass 2: build the surviving list applying all four rules. + vector kept; + kept.reserve(errors.size()); + size_t i = 0; + const size_t N = errors.size(); + while ( i < N ) { + const Error & e = errors[i]; + + // Rule 4: drop not_resolved_yet entries program-wide if any primary exists. + if ( anyPrimaryProgramWide && isNotResolvedYet(e.cerr) ) { + ++i; + continue; + } + // Rule 3: drop same-line unspecified if any coded error sits on the same line. + if ( e.cerr == CompilationError::unspecified && linesWithCoded.count(lineKey(e.at)) ) { + ++i; + continue; + } + // Rule 1: collapse adjacent byte-identical entries. + size_t j = i + 1; + while ( j < N + && errors[j].at == e.at + && errors[j].what == e.what + && errors[j].extra == e.extra + && errors[j].fixme == e.fixme + && errors[j].cerr == e.cerr ) { + ++j; + } + int dupCount = int(j - i); + // Rule 2: same-line, same-cerr, different-text — collapse to first + // and append `(+N more on this line)` to the message. + int sameLineSameCerrCount = 0; + size_t k = j; + while ( k < N + && errors[k].at.fileInfo == e.at.fileInfo + && errors[k].at.line == e.at.line + && errors[k].cerr == e.cerr + && (errors[k].what != e.what || errors[k].extra != e.extra || errors[k].fixme != e.fixme) ) { + // distinct text, same line, same cerr — count it + ++sameLineSameCerrCount; + ++k; + } + // Emit the first instance with optional count suffixes. + Error out = e; + if ( dupCount > 1 ) { + out.what += " (\xC3\x97" + to_string(dupCount) + ")"; + } + if ( sameLineSameCerrCount > 0 ) { + out.what += " (+" + to_string(sameLineSameCerrCount) + " more on this line)"; + } + kept.push_back(out); + i = k; // skip past Rule 1 dups + Rule 2 same-line same-cerr siblings + } + errors.swap(kept); + } + void Program::linkError ( const string & str, const string & extra ) { aotErrors.emplace_back(str,extra,"",LineInfo(), CompilationError::missing_aot); if ( policies.fail_on_no_aot ) { @@ -3030,11 +3119,11 @@ namespace das { if ( annotation->create(st,arg,err) ) { return thisModule->addAnnotation(annotation, true); } else { - error("can't create structure handle "+ann->name,err,"",st->at,CompilationError::invalid_annotation); + error("can't create structure handle "+ann->name,err,"",st->at,CompilationError::cant_create_structure_annotation); return false; } } else { - error("not a structure annotation "+ann->name,"","",st->at,CompilationError::invalid_annotation); + error("not a structure annotation "+ann->name,"","",st->at,CompilationError::invalid_structure_annotation); return false; } } @@ -3064,7 +3153,7 @@ namespace das { candidates += describeCandidates(enums, false); candidates += describeCandidates(aliases, false); error("undefined make type declaration type "+name,candidates,"", - at,CompilationError::type_not_found); + at,CompilationError::ambiguous_type); return nullptr; } else if ( structs.size() ) { if ( structs.size()==1 ) { @@ -3074,7 +3163,7 @@ namespace das { } else { string candidates = describeCandidates(structs); error("too many options for "+name,candidates,"", - at,CompilationError::structure_not_found); + at,CompilationError::ambiguous_structure); return nullptr; } } else if ( handles.size() ) { @@ -3086,13 +3175,13 @@ namespace das { return pTD; } else { error("not a handled type annotation "+name,"","", - at,CompilationError::handle_not_found); + at,CompilationError::invalid_annotation); return nullptr; } } else { string candidates = describeCandidates(handles); error("too many options for "+name, candidates, "", - at,CompilationError::handle_not_found); + at,CompilationError::ambiguous_annotation); return nullptr; } } else if ( enums.size() ) { @@ -3104,7 +3193,7 @@ namespace das { } else { string candidates = describeCandidates(enums); error("too many options for "+name,candidates,"", - at,CompilationError::enumeration_not_found); + at,CompilationError::ambiguous_enumeration); return nullptr; } } else if ( aliases.size() ) { @@ -3115,7 +3204,7 @@ namespace das { } else { string candidates = describeCandidates(aliases); error("too many options for "+name,candidates,"", - at,CompilationError::type_alias_not_found); + at,CompilationError::ambiguous_type_alias); return nullptr; } } else { @@ -3143,7 +3232,7 @@ namespace das { } else if ( ptr.size()==0 ) { return new ExprCall(at,name); } else { - error("too many options for " + name,"","", at, CompilationError::function_not_found); + error("too many options for " + name,"","", at, CompilationError::ambiguous_function); return new ExprCall(at,name); } } @@ -3524,7 +3613,7 @@ namespace das { for ( const auto & pm : mod->optimizationMacros ) { last |= pm->apply(this, thisModule.get()); if ( failed() ) { // if macro failed, we report it, and we are done - error("optimization macro " + mod->name + "::" + pm->name + " failed", "","",LineInfo()); + error("optimization macro " + mod->name + "::" + pm->name + " failed", "","",LineInfo(), CompilationError::runtime_macro); return false; } } diff --git a/src/ast/ast_annotations.cpp b/src/ast/ast_annotations.cpp index cd3a449852..fb90631097 100644 --- a/src/ast/ast_annotations.cpp +++ b/src/ast/ast_annotations.cpp @@ -31,7 +31,7 @@ namespace das string err = ""; if (!sa->look(var, *program->thisModuleGroup, pA->arguments, err)) { program->error("can't finalize structure annotation [" + sa->name + "]",err,"", - var->at, CompilationError::invalid_annotation); + var->at, CompilationError::cant_finalize_structure_annotation); } } } @@ -43,7 +43,7 @@ namespace das string err = ""; if ( !fna->finalize(fn, *program->thisModuleGroup, an->arguments, program->options, err) ) { program->error("can't finalize annotation [" + fna->name + "]",err,"", - fn->at, CompilationError::invalid_annotation); + fn->at, CompilationError::cant_finalize_function_annotation); } } } @@ -55,7 +55,7 @@ namespace das string err = ""; if ( !fna->finalize(block, *program->thisModuleGroup, an->arguments, program->options, err) ) { program->error("can't finalize annotation [" + fna->name + "]",err,"", - block->at, CompilationError::invalid_annotation); + block->at, CompilationError::cant_finalize_block_annotation); } } if ( block->annotationDataSid || block->annotationData ) { @@ -63,7 +63,7 @@ namespace das program->thisModule->annotationData[block->annotationDataSid] = block->annotationData; } else { program->error("internal error. both annotationData and Sid must be provided","","", - block->at, CompilationError::invalid_annotation); + block->at, CompilationError::internal_annotation); } } } @@ -114,7 +114,7 @@ namespace das auto fann = static_cast(ann->annotation); string err; if ( !fann->patch(fn, *thisModuleGroup, ann->arguments, options, err, astChanged) ) { - error("function annotation patch failed\n", err, "", fn->at, CompilationError::annotation_failed ); + error("function annotation patch failed\n", err, "", fn->at, CompilationError::runtime_function_annotation ); } if ( astChanged ) return true; } @@ -128,7 +128,7 @@ namespace das auto sann = static_cast(ann->annotation); string err; if ( !sann->patch(st, *thisModuleGroup, ann->arguments, err, astChanged) ) { - error("structure annotation patch failed\n", err, "", st->at, CompilationError::annotation_failed ); + error("structure annotation patch failed\n", err, "", st->at, CompilationError::runtime_structure_annotation ); } if ( astChanged ) return true; } @@ -176,7 +176,7 @@ namespace das auto fann = static_cast(ann->annotation); string err; if ( !fann->fixup(fn, *thisModuleGroup, ann->arguments, options, err) ) { - error("function annotation patch failed\n", err, "", fn->at, CompilationError::annotation_failed ); + error("function annotation patch failed\n", err, "", fn->at, CompilationError::runtime_function_annotation ); } } } diff --git a/src/ast/ast_const_folding.cpp b/src/ast/ast_const_folding.cpp index f4cc35d34a..6089953a94 100644 --- a/src/ast/ast_const_folding.cpp +++ b/src/ast/ast_const_folding.cpp @@ -88,7 +88,7 @@ namespace das { "this typically means the AST was modified after type inference " "without signalling that infer needs to run again - check the " "annotation patch() / pass apply() / substitution macro that produced this node", - "", expr->at, CompilationError::missing_node); + "", expr->at, CompilationError::internal_function_not_resolved_yet); } virtual bool canVisitFunction ( Function * fun ) override { return !fun->stub && !fun->isTemplate; // we don't do a thing with templates @@ -848,7 +848,7 @@ namespace das { virtual ExpressionPtr visit(ExprStaticAssert * expr) override { auto cond = expr->arguments[0]; if (!cond->constexpression && !cond->rtti_isConstant()) { - program->error("static assert condition is not constexpr or const", "","",expr->at); + program->error("static assert condition is not constexpr or const", "","",expr->at, CompilationError::invalid_expression); return nullptr; } bool result = false; @@ -856,7 +856,7 @@ namespace das { bool failed; vec4f resB = eval(cond, failed); if ( failed ) { - program->error("exception while computing static assert condition", "","",expr->at); + program->error("exception while computing static assert condition", "","",expr->at, CompilationError::runtime_expression); } result = cast::to(resB); } else { @@ -869,7 +869,7 @@ namespace das { bool failed; vec4f resM = eval(expr->arguments[1], failed); if ( failed ) { - program->error("exception while computing static assert message","","", expr->at); + program->error("exception while computing static assert message","","", expr->at, CompilationError::runtime_expression); message = ""; } else { message = cast::to(resM); @@ -902,10 +902,10 @@ namespace das { if ( expr->func && expr->func->hasToRunAtCompileTime ) { if ( expr->func->sideEffectFlags ) { program->error("function did not run at compilation time because it has side-effects","","", - expr->at, CompilationError::run_failed); + expr->at, CompilationError::runtime_function); } else { program->error("function did not run at compilation time","","", - expr->at, CompilationError::run_failed); + expr->at, CompilationError::runtime_function); } } } @@ -960,7 +960,7 @@ namespace das { } if ( expr->func->index==-1 ) { runProgram->error("internal compilation error, folding symbol was not marked as used","","", - expr->at, CompilationError::run_failed); + expr->at, CompilationError::internal_function); return Visitor::visit(expr); } return evalAndFold(expr); diff --git a/src/ast/ast_derive_alias.cpp b/src/ast/ast_derive_alias.cpp index af760184aa..84894fb338 100644 --- a/src/ast/ast_derive_alias.cpp +++ b/src/ast/ast_derive_alias.cpp @@ -354,7 +354,7 @@ namespace das { if ( checkAliasing ) { program->error("[[" + string(expr->__rtti) + " ]] always aliases", "some form of ... *ptr ... = [[" + string(expr->__rtti) + " ...]] where we don't know where pointer came from", "", - expr->at, CompilationError::make_local_aliasing); + expr->at, CompilationError::invalid_expression); } else { expr->alwaysAlias = true; } @@ -374,7 +374,7 @@ namespace das { if ( checkAliasing ) { program->error("[[" + string(expr->__rtti) + " ]] always aliases", "some form of ... = [[" + string(expr->__rtti) + " ... *ptr ... ]] where we don't know where pointer came from", "", - expr->at, CompilationError::make_local_aliasing); + expr->at, CompilationError::invalid_expression); } else { expr->alwaysAlias = true; } @@ -382,7 +382,7 @@ namespace das { if ( checkAliasing ) { program->error("[[" + string(expr->__rtti) + " ]] aliases", "some form of ... " + aliasVar->name + " ... = [[" + string(expr->__rtti) + " ... " + aliasVar->name + " ... ]]", "", - expr->at, CompilationError::make_local_aliasing); + expr->at, CompilationError::invalid_expression); } else { expr->alwaysAlias = true; } @@ -446,7 +446,7 @@ namespace das { if ( checkAliasing ) { program->error("invoke result always aliases", "some form of ... *ptr ... = invoke( ... ) where we don't know where pointer came from", "", - expr->at, CompilationError::argument_aliasing); + expr->at, CompilationError::invalid_argument); } else { expr->cmresAlias = true; return; @@ -470,7 +470,7 @@ namespace das { if ( checkAliasing ) { program->error("invoke result aliases argument " + to_string(ai), "some form of ... = invoke( ... *ptr ... ) where we don't know where pointer came from", "", - expr->at, CompilationError::argument_aliasing); + expr->at, CompilationError::invalid_argument); } else { expr->cmresAlias = true; return; @@ -479,7 +479,7 @@ namespace das { if ( checkAliasing ) { program->error("invoke result aliases argument " + to_string(ai), "some form of ... " + aliasVar->name + " ... = invoke( ... " + aliasVar->name + " ... )", "", - expr->at, CompilationError::argument_aliasing); + expr->at, CompilationError::invalid_argument); } else { expr->cmresAlias = true; return; @@ -501,11 +501,11 @@ namespace das { if ( argT->isGoodFunctionType() ) { program->error("invoke result potentially aliases global " + gIt.first->name + " through function " + gIt.second->getMangledName(), "some form of ... " + gIt.first->name + " ... = invoke( ... " + gIt.first->name + " ... )", "", - expr->at, CompilationError::argument_aliasing); + expr->at, CompilationError::invalid_argument_global); } else { program->error("invoke result potentially aliases global " + gIt.first->name + " through lambda at " + gIt.second->at.describe(), "some form of ... " + gIt.first->name + " ... = invoke( ... " + gIt.first->name + " ... )", "", - expr->at, CompilationError::argument_aliasing); + expr->at, CompilationError::invalid_argument_global); } } else { expr->cmresAlias = true; @@ -533,7 +533,7 @@ namespace das { if ( checkAliasing ) { program->error("function " + expr->func->describeName() + " result always aliases", "some form of ... *ptr ... = " + expr->func->name + "( ... ) where we don't know where pointer came from", "", - expr->at, CompilationError::argument_aliasing); + expr->at, CompilationError::invalid_argument); } else { expr->cmresAlias = true; goto bailout; @@ -554,7 +554,7 @@ namespace das { if ( checkAliasing ) { program->error("function " + expr->func->describeName() + " result aliases argument " + expr->func->arguments[ai]->name, "some form of ... = " + expr->func->name + "( ... *ptr ... ) where we don't know where pointer came from", "", - expr->at, CompilationError::argument_aliasing); + expr->at, CompilationError::invalid_argument); } else { expr->cmresAlias = true; goto bailout; @@ -563,7 +563,7 @@ namespace das { if ( checkAliasing ) { program->error("function " + expr->func->describeName() + " result aliases argument " + expr->func->arguments[ai]->name, "some form of ... " + aliasVar->name + " ... = " + expr->func->name + "( ... " + aliasVar->name + " ... )", "", - expr->at, CompilationError::argument_aliasing); + expr->at, CompilationError::invalid_argument); } else { expr->cmresAlias = true; goto bailout; @@ -577,7 +577,7 @@ namespace das { if ( checkAliasing ) { program->error("function " + expr->func->describeName() + " result aliases global variable " + vit.var->getMangledName() + " through function " + vit.func->getMangledName(), "some form of ... = " + expr->func->name + "(...) where we don't know where the pointer in " + vit.var->name + " came from", "", - expr->at, CompilationError::argument_aliasing); + expr->at, CompilationError::invalid_argument_global); } else { expr->cmresAlias = true; goto bailout; @@ -592,7 +592,7 @@ namespace das { } program->error("function " + expr->func->describeName() + " result aliases global variable " + vit.var->getMangledName() + " through function " + vit.func->getMangledName(), "some form of ... " + aliasVar->name + " ... = " + expr->func->name + "(...) where " + whereMessage, "", - expr->at, CompilationError::argument_aliasing); + expr->at, CompilationError::invalid_argument_global); } else { expr->cmresAlias = true; goto bailout; diff --git a/src/ast/ast_export.cpp b/src/ast/ast_export.cpp index 4ec8a198de..598cedc161 100644 --- a/src/ast/ast_export.cpp +++ b/src/ast/ast_export.cpp @@ -123,14 +123,14 @@ namespace das { for ( auto & fn : functions.each() ) { if ( fn->used ) { if ( !mod.addFunction(fn, true) ) { - program->error("internal error, failed to add function " + fn->name,"","", fn->at ); + program->error("internal error, failed to add function " + fn->name,"","", fn->at, CompilationError::internal_function ); } } } for ( auto & var : globals.each() ) { if ( var->used ) { if ( !mod.addVariable(var, true) ) { - program->error("internal error, failed to add variable " + var->name,"","", var->at ); + program->error("internal error, failed to add variable " + var->name,"","", var->at, CompilationError::internal_variable ); } } } diff --git a/src/ast/ast_infer_type.cpp b/src/ast/ast_infer_type.cpp index 5cc07ee2f7..991b13adc5 100644 --- a/src/ast/ast_infer_type.cpp +++ b/src/ast/ast_infer_type.cpp @@ -77,19 +77,19 @@ namespace das { if ( isLoop(visited, td) ) { fatalAliasLoop = true; error("alias loop detected: '" + describeType(td) + "'", "", "", - td->at, CompilationError::invalid_type); + td->at, CompilationError::recursion_type_alias); return td; } if (auto ta = inferAlias(td)) { if (ta->isAutoOrAlias()) { error("internal compiler error: can't be inferred: '" + describeType(td) + "'", "", "", - td->at, CompilationError::invalid_type); + td->at, CompilationError::internal_type_alias); return td; } return ta; } else { error("can't be inferred: '" + describeType(td) + "'", reportInferAliasErrors(td), "", - td->at, CompilationError::invalid_type); + td->at, CompilationError::not_resolved_yet_type_alias); } } td->alias = saveAliasName; @@ -153,7 +153,7 @@ namespace das { return nextValue; } else { error("enumeration value '" + name + "' can't be inferred yet", "", "", - enu->at); + enu->at, CompilationError::not_resolved_yet_enumerator); } } else { reportAstChanged(); @@ -165,17 +165,17 @@ namespace das { } else { if (!value->type) { error("enumeration value '" + name + "' can't be inferred yet", "", "", - value->at); + value->at, CompilationError::not_resolved_yet_enumerator); } else if (!value->type || !value->type->isInteger()) { error("enumeration value '" + name + "' has to be signed or unsigned integer of any size, and not '" + value->type->describe() + "'", "", "", - value->at, CompilationError::invalid_enumeration); + value->at, CompilationError::invalid_enumerator_type); } else if (!value->rtti_isConstant()) { if (auto fenum = getConstExpr(value)) { reportAstChanged(); return fenum; } else { error("enumeration value '" + name + "' must be integer constant, and not an expression", "", "", - value->at, CompilationError::invalid_enumeration); + value->at, CompilationError::invalid_enumerator); } } else if (value->type->baseType != enu->baseType) { reportAstChanged(); @@ -216,7 +216,7 @@ namespace das { that->fieldLookup[decl.name] = fieldIndex++; if (decl.type->isAuto() && !decl.init) { error("structure field type can't be inferred, it needs an initializer", "", "", - decl.at, CompilationError::cant_infer_missing_initializer); + decl.at, CompilationError::missing_structure_field); } } bool InferTypes::hasSafeWhenUninitialized(const AnnotationArgumentList &args) const { @@ -252,7 +252,7 @@ namespace das { decl.type->sanitize(); reportAstChanged(); } else { - error("not fully resolved yet", "", "", decl.at); + error("not fully resolved yet", "", "", decl.at, CompilationError::not_resolved_yet_structure_field); return; } } @@ -263,7 +263,7 @@ namespace das { reportAstChanged(); } else { error("undefined structure field type '" + describeType(decl.type) + "'", - reportInferAliasErrors(decl.type), "", decl.at, CompilationError::invalid_structure_field_type); + reportInferAliasErrors(decl.type), "", decl.at, CompilationError::lookup_structure_field_type); } } if (decl.type->isAuto() && decl.init && decl.init->type) { @@ -293,7 +293,7 @@ namespace das { if (noUnsafeUninitializedStructs && !st->isLambda && !decl.init && decl.type->unsafeInit()) { if (!hasSafeWhenUninitialized(decl.annotation)) { error("Uninitialized field " + decl.name + " is unsafe. Use initializer syntax or @safe_when_uninitialized when intended.", "", "", - decl.at, CompilationError::unsafe); + decl.at, CompilationError::unsafe_structure_field); } } @@ -303,17 +303,17 @@ namespace das { "structure field " + decl.name + " initialization type mismatch", CompilationError::invalid_initialization_type, decl.init->at)) { } else if (!decl.type->canCopy() && !decl.moveSemantics) { error("field " + decl.name + " can't be copied, use <- instead; " + describeType(decl.type), "", "", - decl.init->at, CompilationError::invalid_initialization_type); + decl.init->at, CompilationError::cant_structure_field); if (canRelaxAssign(decl.init)) { reportAstChanged(); decl.moveSemantics = true; } } else if (!decl.init->type->canCopy() && !decl.init->type->canMove()) { - error("field " + decl.name + "can't be initialized at all; " + describeType(decl.init->type), "", "", - decl.at, CompilationError::invalid_initialization_type); + error("field " + decl.name + " can't be initialized at all; " + describeType(decl.init->type), "", "", + decl.at, CompilationError::invalid_structure_field_init); } else if (decl.moveSemantics && decl.init->type->isConst()) { error("can't move from a constant value " + describeType(decl.init->type), "", "", - decl.init->at, CompilationError::cant_move); + decl.init->at, CompilationError::cant_structure_field); } } else if (!decl.type->isAuto()) { if (decl.init->rtti_isCast()) { @@ -358,7 +358,7 @@ namespace das { if (isCircularType(tt)) { var->circular = true; error("type creates circular dependency", "", "", - var->at, CompilationError::invalid_type); + var->at, CompilationError::recursion_structure); } currentStructure = nullptr; return Visitor::visit(var); @@ -368,16 +368,16 @@ namespace das { if (noUnsafeUninitializedStructs && !var->init && var->type->unsafeInit()) { if (!hasSafeWhenUninitialized(var->annotation)) { error("Uninitialized variable " + var->name + " is unsafe. Use initializer syntax or @safe_when_uninitialized when intended.", "", "", - var->at, CompilationError::unsafe); + var->at, CompilationError::unsafe_global); } } if (checkNoGlobalVariablesAtAll && !var->generated) { error("global variables are disabled by option no_global_variables_at_all", "", "", - var->at, CompilationError::no_global_variables); + var->at, CompilationError::invalid_global_options); } if (var->type->isAuto() && !var->init) { error("global variable type can't be inferred, it needs an initializer", "", "", - var->at, CompilationError::cant_infer_missing_initializer); + var->at, CompilationError::missing_global_init); } if (var->type->isAlias()) { if (auto aT = inferAlias(var->type)) { @@ -385,7 +385,7 @@ namespace das { reportAstChanged(); } else { error("undefined global variable type " + describeType(var->type), - reportInferAliasErrors(var->type), "", var->at, CompilationError::invalid_type); + reportInferAliasErrors(var->type), "", var->at, CompilationError::lookup_global_type); } } } @@ -401,7 +401,7 @@ namespace das { auto varT = TypeDecl::inferGenericInitType(var->type, var->init->type); if (!varT || varT->isAlias()) { error("global variable '" + var->name + "' initialization type can't be inferred, " + describeType(var->type) + " = " + describeType(var->init->type), "", "", - var->at, CompilationError::cant_infer_mismatching_restrictions); + var->at, CompilationError::invalid_global_init_type); } else { varT->ref = false; TypeDecl::applyAutoContracts(varT, var->type); @@ -418,23 +418,23 @@ namespace das { "global variable '" + var->name + "' initialization type mismatch", CompilationError::invalid_initialization_type, var->init->at)) { } else if (var->type->ref && !var->type->isConst() && var->init->type->isConst()) { error("global variable '" + var->name + "' initialization type mismatch, const matters " + describeType(var->type) + " = " + describeType(var->init->type), "", "", - var->at, CompilationError::invalid_initialization_type); + var->at, CompilationError::invalid_global_init_type); } else if (!var->init_via_clone && (!var->init->type->canCopy() && !var->init->type->canMove())) { error("global variable '" + var->name + "' can't be initialized at all. " + describeType(var->type), "", "", - var->at, CompilationError::invalid_initialization_type); + var->at, CompilationError::invalid_global_init_type); } else if (var->init_via_move && var->init->type->isConst()) { error("global variable '" + var->name + "' can't init (move) from a constant value. " + describeType(var->init->type), "", "", - var->at, CompilationError::cant_move); + var->at, CompilationError::cant_global); } else if (!(var->init_via_move || var->init_via_clone) && !var->init->type->canCopy()) { error("global variable '" + var->name + "' can't be copied", "", "", - var->at, CompilationError::cant_copy); + var->at, CompilationError::cant_global); if (canRelaxAssign(var->init)) { reportAstChanged(); var->init_via_move = true; } } else if (var->init_via_move && !var->init->type->canMove()) { error("global variable '" + var->name + "' can't be moved", "", "", - var->at, CompilationError::cant_move); + var->at, CompilationError::cant_global); } else if (var->init_via_clone && !var->init->type->canClone()) { auto varType = new TypeDecl(*var->type); varType->ref = true; @@ -465,7 +465,7 @@ namespace das { } if (disableInit && !var->init->rtti_isConstant()) { program->error("[init] is disabled in the options or CodeOfPolicies", "", "", - var->at, CompilationError::no_init); + var->at, CompilationError::invalid_global_init_options); } return Visitor::visitGlobalLetInit(var, init); } @@ -478,32 +478,32 @@ namespace das { } if (var->type->ref) error("global variable can't be declared a reference", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::invalid_global_type); if (var->type->isVoid()) error("global variable can't be declared void", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::invalid_global_type); if (!var->type->isLocal()) error("can't have a global variable of type " + describeType(var->type), "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::invalid_global_type); if (!var->type->constant && var->global_shared) error("shared global variable must be constant", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::invalid_global_shared); if (var->global_shared && !var->init) error("shared global variable must be initialized", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::missing_global_shared_init); if (var->global_shared && !var->type->isShareable()) { if (!(var->type->isSimpleType(Type::tLambda) && program->policies.allow_shared_lambda)) { error("this variable type can't be shared, " + describeType(var->type), "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::invalid_global_type_shared); } } if (!var->type->ref && var->type->hasClasses()) { error("can only have global pointers to classes " + describeType(var->type), "", "", - var->at, CompilationError::unsafe); + var->at, CompilationError::unsafe_global_pointer); } if (!var->init && var->type->hasNonTrivialCtor()) { error("global variable of type " + describeType(var->type) + " needs to be initialized", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::missing_global_init); } // we are looking into initialization with empty table or array to replace with nada if (isEmptyInit(var)) { @@ -541,11 +541,11 @@ namespace das { } if (f->arguments.size() > DAS_MAX_FUNCTION_ARGUMENTS) { error("function has too many arguments, max allowed is DAS_MAX_FUNCTION_ARGUMENTS=" DAS_STR(DAS_MAX_FUNCTION_ARGUMENTS), "", "", - f->at, CompilationError::too_many_arguments); + f->at, CompilationError::exceeds_function_argument); } if ((f->init | f->shutdown) && disableInit) { error("[init] is disabled in the options or CodeOfPolicies", "", "", - f->at, CompilationError::no_init); + f->at, CompilationError::invalid_function_options); } } void InferTypes::preVisitArgument(Function *fn, const VariablePtr &var, bool lastArg) { @@ -556,19 +556,19 @@ namespace das { reportAstChanged(); } else { error("undefined function argument type " + describeType(var->type), - reportInferAliasErrors(var->type), "", var->at, CompilationError::type_not_found); + reportInferAliasErrors(var->type), "", var->at, CompilationError::lookup_function_argument_type); } } if (var->type->isVoid()) { error("function argument type can't be declared void", "", "", - var->at, CompilationError::invalid_type); + var->at, CompilationError::invalid_function_argument_type); } if (var->type->ref && var->type->isRefType()) { // silently fix a : Foo& into a : Foo var->type->ref = false; auto mname = fn->getMangledName(); if (fn->module->functions.find(mname)) { error("function already exists in non-ref form", "\t" + fn->describe(Function::DescribeModule::yes), "", - var->at, CompilationError::cant_infer_generic); + var->at, CompilationError::already_declared_function); var->type->ref = true; } } @@ -583,7 +583,7 @@ namespace das { auto varT = TypeDecl::inferGenericType(arg->type, arg->init->type, false, false, nullptr); if (!varT) { error("generic argument type can't be inferred, " + describeType(arg->type) + " = " + describeType(arg->init->type), "", "", - arg->at, CompilationError::cant_infer_generic); + arg->at, CompilationError::invalid_function_argument_type); } else { TypeDecl::applyAutoContracts(varT, arg->type); arg->type = varT; @@ -594,18 +594,18 @@ namespace das { } if (!arg->init->type || !arg->type->isSameType(*arg->init->type, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) { error("function argument default value type mismatch '" + describeType(arg->type) + "' vs '" + (arg->init->type ? describeType(arg->init->type) : "???") + "'", "", "", - arg->init->at, CompilationError::invalid_type); + arg->init->at, CompilationError::invalid_function_argument_type); } if (arg->init->type && arg->type->ref && !arg->init->type->ref) { error("function argument default value type mismatch '" + describeType(arg->type) + "' vs '" + describeType(arg->init->type) + "', reference matters", "", "", - arg->init->at, CompilationError::invalid_type); + arg->init->at, CompilationError::invalid_function_argument_type); } return Visitor::visitArgumentInit(f, arg, that); } VariablePtr InferTypes::visitArgument(Function *fn, const VariablePtr &var, bool lastArg) { if (var->type->isAuto()) { error("unresolved generics are not supported", "", "", - var->at, CompilationError::cant_infer_generic); + var->at, CompilationError::not_resolved_yet_function); } verifyType(var->type, true); return Visitor::visitArgument(fn, var, lastArg); @@ -618,7 +618,7 @@ namespace das { reportAstChanged(); } else if (!func->result->isVoid()) { error("function does not return a value", "", "", - func->at, CompilationError::expecting_return_value); + func->at, CompilationError::missing_function_result); } } if (func->result->isAlias()) { @@ -631,13 +631,13 @@ namespace das { reportAstChanged(); } else { error("undefined function result type '" + describeType(func->result) + "'", - reportInferAliasErrors(func->result), "", func->at, CompilationError::type_not_found); + reportInferAliasErrors(func->result), "", func->at, CompilationError::lookup_function_result_type); } } verifyType(func->result); if (!func->result->isReturnType()) { error("not a valid function return type '" + describeType(func->result) + "'", "", "", - func->result->at, CompilationError::invalid_return_type); + func->result->at, CompilationError::invalid_function_result_type); } if (func->result->isRefType() && !func->result->ref) { if (func->result->canCopy()) { @@ -656,7 +656,7 @@ namespace das { // the error will be reported in the inferReturnType /* error("this type can't be copied or moved. not a valid function return type " - + describeType(func->result),func->result->at,CompilationError::invalid_return_type); + + describeType(func->result),func->result->at,CompilationError::invalid_function_result_type); */ } } else { @@ -675,7 +675,7 @@ namespace das { if (!func->inferredSource.empty()) { if (func->inferredSource != srcCode.c_str()) { program->error("fully inferred function has changed\nbefore:\n" + func->inferredSource + "\nafter:\n" + srcCode.c_str(), - "", "", func->at, CompilationError::unspecified); + "", "", func->at, CompilationError::internal_function_changed); } } else { func->inferredSource = srcCode.c_str(); @@ -781,7 +781,7 @@ namespace das { c->type->constant = isConstantType(c); } else { error("enumeration value not inferred yet " + cE->text, "", "", - c->at, CompilationError::invalid_enumeration); + c->at, CompilationError::not_resolved_yet_enumerator); c->type = nullptr; } } else if (c->baseType == Type::tBitfield || c->baseType == Type::tBitfield8 || @@ -841,12 +841,12 @@ namespace das { expr->subexpr = Expression::autoDereference(expr->subexpr); if (!expr->subexpr->type) { error("goto label type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_label_type); return Visitor::visit(expr); } if (!expr->subexpr->type->isSimpleType(Type::tInt)) { error("label type has to be int, not " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::invalid_label); + expr->at, CompilationError::invalid_label_type); } else { if (enableInferTimeFolding) { if (auto se = getConstExpr(expr->subexpr)) { @@ -869,7 +869,7 @@ namespace das { } if (!expr->subexpr && !findLabel(expr->label)) { error("can't find label " + to_string(expr->label), "", "", - expr->at, CompilationError::invalid_label); + expr->at, CompilationError::lookup_label); } return Visitor::visit(expr); } @@ -883,7 +883,7 @@ namespace das { } if (errc == program->errors.size()) { error("unsupported read macro " + expr->macro->name, "", "", - expr->at, CompilationError::unsupported_read_macro); + expr->at, CompilationError::invalid_macro_read); } return Visitor::visit(expr); } @@ -891,7 +891,7 @@ namespace das { Visitor::preVisit(expr); if (!labels.insert(expr->label).second) { error("duplicate label " + to_string(expr->label), "", "", - expr->at, CompilationError::invalid_label); + expr->at, CompilationError::already_declared_label); } } ExpressionPtr InferTypes::visit(ExprRef2Value *expr) { @@ -934,11 +934,11 @@ namespace das { TextWriter tw; tw << *expr->subexpr; error("can only dereference a reference", tw.str(), "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::cant_dereference); } } else if (!expr->subexpr->type->isSimpleType()) { error("can only dereference value types, not a " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::cant_dereference); } else { TypeDecl::clone(expr->type, expr->subexpr->type); expr->type->ref = false; @@ -959,13 +959,13 @@ namespace das { reportAstChanged(); } else { error("undefined address expression type " + describeType(expr->funcType), - reportInferAliasErrors(expr->funcType), "", expr->at, CompilationError::type_not_found); + reportInferAliasErrors(expr->funcType), "", expr->at, CompilationError::lookup_function_address_type); return Visitor::visit(expr); } } if (expr->funcType->isAuto()) { error("function of undefined type " + describeType(expr->funcType), "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::lookup_function_type); return Visitor::visit(expr); } expr->funcType->firstType = retT; @@ -975,7 +975,7 @@ namespace das { if (expr->funcType) { if (!expr->funcType->isFunction()) { error("function of non-function type " + describeType(expr->funcType), "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::invalid_function_type); } fns = findTypedFuncAddr(expr->target, expr->funcType->argTypes); } else { @@ -995,7 +995,7 @@ namespace das { } if (expr->func->isTemplate) { error("can't take address of a template function " + describeFunction(expr->func), "", "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::cant_address_template_function); expr->type = nullptr; } else { verifyType(expr->type); @@ -1005,12 +1005,12 @@ namespace das { reportFunctionNotFound(expr); } else { error("function not found " + expr->target, "", "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::lookup_function); } } else { string candidates = verbose ? program->describeCandidates(fns) : ""; error("function not found " + expr->target, candidates, "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::lookup_function); } if (expr->func && expr->func->builtIn) { TextWriter tw; @@ -1034,7 +1034,7 @@ namespace das { tw << "); }"; } error("can't get address of builtin function " + describeFunction(expr->func), "wrap local function instead", tw.str(), - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::cant_address_function); return Visitor::visit(expr); } return Visitor::visit(expr); @@ -1052,7 +1052,7 @@ namespace das { expr->subexpr = Expression::autoDereference(expr->subexpr); if (!expr->subexpr->type) { error("dereference type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_dereference_type); return Visitor::visit(expr); } if (!expr->subexpr->type->isPointer()) { @@ -1075,7 +1075,7 @@ namespace das { // infer if (!expr->subexpr->type->isRef()) { error("can only make a pointer of a reference", "", "", - expr->at, CompilationError::cant_dereference); + expr->at, CompilationError::cant_take_pointer); } else { if (!safeExpression(expr)) { if (!expr->subexpr->type->temporary) { // address of temp type is temp, but its safe @@ -1096,7 +1096,7 @@ namespace das { } if (!isSelf) { error("address of reference requires unsafe", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_address); } } } @@ -1151,7 +1151,7 @@ namespace das { auto seT = expr->subexpr->type; if (!seT) { error("null coalescing type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_null_coalescing_type); return Visitor::visit(expr); } auto dvT = expr->defaultValue->type; @@ -1163,10 +1163,10 @@ namespace das { expr->at, CompilationError::cant_dereference); } else if (!seT->firstType->isSameType(*dvT, RefMatters::no, ConstMatters::no, TemporaryMatters::yes)) { error("default value type mismatch in " + describeType(seT->firstType) + " vs " + describeType(dvT), "", "", - expr->at, CompilationError::cant_dereference); + expr->at, CompilationError::invalid_null_coalescing_type); } else if (seT->isRef() && !seT->isConst() && dvT->isConst()) { error("default value type mismatch, constant matters in " + describeType(seT) + " vs " + describeType(dvT), "", "", - expr->at, CompilationError::cant_dereference); + expr->at, CompilationError::invalid_null_coalescing_type); } else { TypeDecl::clone(expr->type, seT->firstType); expr->type->constant |= expr->subexpr->type->constant || dvT->constant; @@ -1190,22 +1190,22 @@ namespace das { } if (expr->arguments.size() < 1 || expr->arguments.size() > 2) { error("static_assert(expr) or static_assert(expr,string)", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_static_assert_argument_count); return Visitor::visit(expr); } // infer expr->autoDereference(); if (!expr->arguments[0]->type) { error("static_assert argument type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_argument_type); return Visitor::visit(expr); } if (!expr->arguments[0]->type->isSimpleType(Type::tBool)) error("static assert condition must be boolean", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_static_assert_condition_type); if (expr->arguments.size() == 2 && !expr->arguments[1]->rtti_isStringConstant()) { error("static assert comment must be string constant", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_static_assert_comment_type); } // check if we can give more info this early (buy only if we are already reporting errors) @@ -1230,13 +1230,17 @@ namespace das { extra += func->getLocationExtra(); atC = func->getConceptLocation(atC); } - program->error(message, extra, "", atC, CompilationError::concept_failed); + if (verbose) { + program->error(message, extra, "", atC, CompilationError::concept_failed); + } } else { string extra; if (func) { extra = func->getLocationExtra(); } - program->error(message, extra, "", expr->at, CompilationError::static_assert_failed); + if (verbose) { + program->error(message, extra, "", expr->at, CompilationError::static_assert_failed); + } } } } @@ -1258,22 +1262,22 @@ namespace das { } if (expr->arguments.size() < 1 || expr->arguments.size() > 2) { error("assert(expr) or assert(expr,string)", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_assert_argument_count); return Visitor::visit(expr); } // infer expr->autoDereference(); if (!expr->arguments[0]->type) { error("assert argument type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_argument_type); return Visitor::visit(expr); } if (!expr->arguments[0]->type->isSimpleType(Type::tBool)) error("assert condition must be boolean", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_assert_condition_type); if (expr->arguments.size() == 2 && !expr->arguments[1]->rtti_isStringConstant()) { error("assert comment must be string constant", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_assert_comment_type); } expr->type = new TypeDecl(Type::tVoid); return Visitor::visit(expr); @@ -1281,7 +1285,7 @@ namespace das { ExpressionPtr InferTypes::visit(ExprQuote *expr) { if (expr->arguments.size() != 1) { error("quote(expr) only. can only return one expression tree", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_quote_argument_count); return Visitor::visit(expr); } // infer @@ -1304,13 +1308,13 @@ namespace das { } if (expr->arguments.size() < 1 || expr->arguments.size() > 2) { error("debug(expr) or debug(expr,string)", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_debug_argument_count); return Visitor::visit(expr); } // infer if (expr->arguments.size() == 2 && !expr->arguments[1]->rtti_isStringConstant()) { error("debug comment must be string constant", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_debug_comment_type); } TypeDecl::clone(expr->type, expr->arguments[0]->type); return Visitor::visit(expr); @@ -1323,17 +1327,17 @@ namespace das { } if (expr->arguments.size() != 1) { error("memzero(ref expr)", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_memzero_argument_count); return Visitor::visit(expr); } // infer const auto &arg = expr->arguments[0]; if (!arg->type->isRef()) { error("memzero argument must be reference", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_memzero_argument_type); } else if (arg->type->isConst()) { error("memzero argument can't be constant", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_memzero_argument); } expr->type = new TypeDecl(); return Visitor::visit(expr); @@ -1355,7 +1359,7 @@ namespace das { return (*ptr.back())(at); } else if (ptr.size() > 1) { error("ambiguous call macro " + funcName, "", "", - at, CompilationError::function_not_found); + at, CompilationError::ambiguous_call_macro); return nullptr; } else { return nullptr; @@ -1431,24 +1435,24 @@ namespace das { return newCall; } else if ( fnCandidates.size() > 1 ) { error("too many candidates for super call " + callName, - verbose ? program->describeCandidates(fnCandidates) : "", "", - expr->at, CompilationError::function_not_found); + verbose ? program->describeCandidates(fnCandidates) : "", "", + expr->at, CompilationError::ambiguous_super_call); return Visitor::visit(expr); } baseClass = baseClass->parent; } error("call to super in " + func->name + " is not allowed, no matching super method " + eField->name, "", "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::lookup_super_method); return Visitor::visit(expr); } else { error("call to super in " + func->name + " is not allowed, no base class for " + func->classParent->name, "", "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::invalid_super_call); return Visitor::visit(expr); } } } else { error("can't infer method call, field type is not inferred yet", "", "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::not_resolved_yet_method_call); return Visitor::visit(expr); } } @@ -1578,7 +1582,7 @@ namespace das { if (fnAddr->func) { if ( inArgumentInit && fnAddr->func==func ) { error("recursive call in argument initializer", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::recursion_function_argument); } else { int fnArgSize = int(fnAddr->func->arguments.size()); int fromFnArgSize = int(expr->arguments.size() - 1); @@ -1599,11 +1603,11 @@ namespace das { } } else { error("'" + fnAddr->target + "' is not fully resolved yet", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::not_resolved_yet_function); } } else { error("expecting class_ptr or cast class_ptr", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_invoke_argument_type); } } else { auto stf = sttf->type; @@ -1615,30 +1619,28 @@ namespace das { expr->arguments.erase(expr->arguments.begin() + 1); } else { error("'" + stt->name + "->" + eField->name + "' expecting function", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_invoke_target_type); } - error("'" + stt->name + "->" + eField->name + "' expecting function", "", "", - expr->at, CompilationError::invalid_argument_count); } } else { error("'" + stt->name + "->" + eField->name + "' not found", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::lookup_method); } } else { error("expecting class->method", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_invoke_method_syntax); } } else { error("class type is not inferred yet", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::not_resolved_yet_class_type); } } else { error("expecting class.method in the method invoke", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_invoke_method_syntax); } } error("expecting " + to_string(blockT->argTypes.size()) + " arguments, got " + to_string(expr->arguments.size() - 1), "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_invoke_argument_count); } else { for (size_t i = 0, is = blockT->argTypes.size(); i != is; ++i) { auto &arg = expr->arguments[i + 1]; @@ -1657,7 +1659,7 @@ namespace das { } if (expr->arguments.size() < 1) { error("expecting invoke(block_or_function_or_lambda) or invoke(block_or_function_or_lambda,...)", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_invoke_argument_count); return Visitor::visit(expr); } // infer @@ -1665,12 +1667,12 @@ namespace das { auto blockT = expr->arguments[0]->type; if (!blockT) { error("invoke argument type can't be inferred", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::not_resolved_yet_invoke_argument_type); return Visitor::visit(expr); } if (blockT->isAutoOrAlias()) { error("invoke argument not fully inferred " + describeType(blockT), "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::not_resolved_yet_invoke_argument_type); return Visitor::visit(expr); } // promote invoke(string_name,...) into string_name(...) @@ -1685,12 +1687,12 @@ namespace das { } if (!blockT->isGoodBlockType() && !blockT->isGoodFunctionType() && !blockT->isGoodLambdaType() && !blockT->isString()) { error("expecting block, or function, or lambda, or string, not a " + describeType(blockT), "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_invoke_target_type); return Visitor::visit(expr); } if (!blockT->isString() && expr->arguments.size() - 1 != blockT->argTypes.size()) { error("invalid number of arguments, expecting " + describeType(blockT), "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_invoke_argument_count); return Visitor::visit(expr); } if (blockT->isGoodLambdaType()) { @@ -1700,7 +1702,7 @@ namespace das { auto &passType = expr->arguments[i + 1]->type; if (!passType) { error("invoke argument " + to_string(i + 1) + " type can't be inferred", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::not_resolved_yet_invoke_argument_type); return Visitor::visit(expr); } auto &argType = blockT->argTypes[i]; @@ -1708,7 +1710,7 @@ namespace das { auto extras = verbose ? ("\n" + describeMismatchingArgument(to_string(i + 1), passType, argType, (int)i)) : ""; error("incompatible argument " + to_string(i + 1), "\t" + describeType(passType) + " vs " + describeType(argType) + extras, "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_invoke_argument_type); return Visitor::visit(expr); } // TODO: invoke with TEMP types @@ -1750,7 +1752,7 @@ namespace das { } if (expr->arguments.size() != 2) { error("insert(table,key)", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_insert_argument_count); return Visitor::visit(expr); } // infer @@ -1759,17 +1761,17 @@ namespace das { auto valueType = expr->arguments[1]->type; if (!containerType || !valueType) { error("argument type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_argument_type); return Visitor::visit(expr); } if (containerType->isGoodTableType()) { if (!containerType->firstType->isSameType(*valueType, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) error("key must be of the same type as table", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_table_key_type); expr->type = new TypeDecl(Type::tBool); } else { error("first argument must be fully qualified table", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_table_argument_type); } valueType->constant = true; return Visitor::visit(expr); @@ -1782,7 +1784,7 @@ namespace das { } if (expr->arguments.size() != 2) { error("eraseKey(table,key)", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_erase_argument_count); return Visitor::visit(expr); } // infer @@ -1791,17 +1793,17 @@ namespace das { auto valueType = expr->arguments[1]->type; if (!containerType || !valueType) { error("argument type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_argument_type); return Visitor::visit(expr); } if (containerType->isGoodTableType()) { if (!containerType->firstType->isSameType(*valueType, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) error("key must be of the same type as table", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_table_key_type); expr->type = new TypeDecl(Type::tBool); } else { error("first argument must be fully qualified table", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_table_argument_type); } valueType->constant = true; return Visitor::visit(expr); @@ -1814,7 +1816,7 @@ namespace das { } if (expr->arguments.size() != 2) { error("findKey(table,key)", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_find_argument_count); return Visitor::visit(expr); } // infer @@ -1823,18 +1825,18 @@ namespace das { auto valueType = expr->arguments[1]->type; if (!containerType || !valueType) { error("argument type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_argument_type); return Visitor::visit(expr); } if (containerType->isGoodTableType()) { if (!containerType->firstType->isSameType(*valueType, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) error("key must be of the same type as table", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_table_key_type); expr->type = new TypeDecl(Type::tPointer); expr->type->firstType = new TypeDecl(*containerType->secondType); } else { error("first argument must be fully qualified table", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_table_argument_type); } containerType->constant = true; valueType->constant = true; @@ -1848,7 +1850,7 @@ namespace das { } if (expr->arguments.size() != 2) { error("keyExists(table,key)", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_key_exists_argument_count); return Visitor::visit(expr); } // infer @@ -1857,17 +1859,17 @@ namespace das { auto valueType = expr->arguments[1]->type; if (!containerType || !valueType) { error("argument type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_argument_type); return Visitor::visit(expr); } if (containerType->isGoodTableType()) { if (!containerType->firstType->isSameType(*valueType, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) error("key must be of the same type as table", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_table_key_type); expr->type = new TypeDecl(Type::tBool); } else { error("first argument must be fully qualified table", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_table_argument_type); } containerType->constant = true; valueType->constant = true; @@ -1882,7 +1884,7 @@ namespace das { } if (expr->subexpr->type->isAutoOrAlias()) { error("is expression type can't be inferred, subexpression type is not fully inferred yet: " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_is_expression_type); return Visitor::visit(expr); } // generic operator @@ -1894,7 +1896,7 @@ namespace das { return opE; } else { error("is " + (expr->typeexpr ? describeType(expr->typeexpr) : "...") + " can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_is_expression_type); return Visitor::visit(expr); } auto nErrors = program->errors.size(); @@ -1905,18 +1907,18 @@ namespace das { return Visitor::visit(expr); } else { error("undefined is expression type " + describeType(expr->typeexpr), - reportInferAliasErrors(expr->typeexpr), "", expr->at, CompilationError::type_not_found); + reportInferAliasErrors(expr->typeexpr), "", expr->at, CompilationError::lookup_is_expression_type); return Visitor::visit(expr); } } if (expr->typeexpr->isAuto()) { error("is ... auto is undefined, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_auto); + expr->at, CompilationError::invalid_is_expression); return Visitor::visit(expr); } if (expr->typeexpr->isAutoOrAlias()) { error("is " + (expr->typeexpr ? describeType(expr->typeexpr) : "...") + " can't be fully inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_is_expression_type); return Visitor::visit(expr); } verifyType(expr->typeexpr); @@ -1940,13 +1942,13 @@ namespace das { return Visitor::visit(expr); } else { error("undefined type<" + describeType(expr->typeexpr) + ">", - reportInferAliasErrors(expr->typeexpr), "", expr->at, CompilationError::type_not_found); + reportInferAliasErrors(expr->typeexpr), "", expr->at, CompilationError::lookup_type); return Visitor::visit(expr); } } if (expr->typeexpr->isAutoOrAlias()) { error("type<" + describeType(expr->typeexpr) + "> can't be fully inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_type); return Visitor::visit(expr); } verifyType(expr->typeexpr, true); @@ -1974,7 +1976,7 @@ namespace das { // if (!expr->typeexpr && !allowMissingTypeExpr) { error("typeinfo(" + (expr->typeexpr ? describeType(expr->typeexpr) : "...") + ") can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_typeinfo); return Visitor::visit(expr); } auto nErrors = program->errors.size(); @@ -1987,18 +1989,18 @@ namespace das { return Visitor::visit(expr); } else if (!allowMissingType) { error("undefined typeinfo type expression type " + describeType(expr->typeexpr), - reportInferAliasErrors(expr->typeexpr), "", expr->at, CompilationError::type_not_found); + reportInferAliasErrors(expr->typeexpr), "", expr->at, CompilationError::lookup_typeinfo_type); return Visitor::visit(expr); } } if (expr->typeexpr->isAuto()) { error("typeinfo(... auto) is undefined, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_auto); + expr->at, CompilationError::invalid_typeinfo); return Visitor::visit(expr); } if (allowMissingType ? expr->typeexpr->isAuto() : !expr->typeexpr->isFullyInferred()) { error("typeinfo(" + (expr->typeexpr ? describeType(expr->typeexpr) : "...") + ") can't be fully inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_typeinfo); return Visitor::visit(expr); } verifyType(expr->typeexpr, true); @@ -2009,12 +2011,12 @@ namespace das { uint64_t size = expr->typeexpr->getSizeOf64(failed); if (failed) { error("typeinfo(sizeof " + describeType(expr->typeexpr) + ") is not fully inferred yet", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::not_resolved_yet_typeinfo_sizeof); return Visitor::visit(expr); } if (size > 0x7fffffff) { error("typeinfo(sizeof " + describeType(expr->typeexpr) + ") is too big", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::exceeds_typeinfo_sizeof); return Visitor::visit(expr); } reportAstChanged(); @@ -2024,7 +2026,7 @@ namespace das { auto align = expr->typeexpr->getAlignOfFailed(failed); if (failed) { error("typeinfo(alignof " + describeType(expr->typeexpr) + ") is not fully inferred yet", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::not_resolved_yet_typeinfo_alignof); return Visitor::visit(expr); } reportAstChanged(); @@ -2035,7 +2037,7 @@ namespace das { } else if (expr->trait == "dim") { if (expr->typeexpr->isExprTypeAnywhere()) { error("typeinfo(dim " + describeType(expr->typeexpr) + ") is not fully inferred, expecting resolved dim", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_typeinfo_dim); return Visitor::visit(expr); } if (expr->typeexpr->dim.size()) { @@ -2043,22 +2045,22 @@ namespace das { return new ExprConstInt(expr->at, expr->typeexpr->dim[0]); } else { error("typeinfo(dim non_array) is prohibited, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_dim); + expr->at, CompilationError::invalid_typeinfo_dim); } } else if (expr->trait == "dim_table_value") { if (!expr->typeexpr->isGoodTableType()) { error("typeinfo(dim_table_value " + describeType(expr->typeexpr) + ") is not a table type", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::invalid_typeinfo_dim_table_type); return Visitor::visit(expr); } if (!expr->typeexpr->secondType) { error("typeinfo(dim_table_value " + describeType(expr->typeexpr) + ") is not a table type with value", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::invalid_typeinfo_dim_table_type); return Visitor::visit(expr); } if (expr->typeexpr->secondType->isExprTypeAnywhere()) { error("typeinfo(dim_table_value " + describeType(expr->typeexpr->secondType) + ") is not fully inferred, expecting resolved dim", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_typeinfo_dim_table); return Visitor::visit(expr); } if (expr->typeexpr->secondType->dim.size()) { @@ -2066,7 +2068,7 @@ namespace das { return new ExprConstInt(expr->at, expr->typeexpr->secondType->dim[0]); } else { error("typeinfo(dim_table_value table<...,non_array>) is prohibited, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_dim); + expr->at, CompilationError::invalid_typeinfo_dim_table); } } else if (expr->trait == "is_any_vector") { reportAstChanged(); @@ -2076,7 +2078,7 @@ namespace das { if (!expr->typeexpr->isGoodVariantType()) { if (expr->trait == "variant_index") { error("variant_index only valid for variant, not for " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_typeinfo_variant_index_type); } else { reportAstChanged(); return new ExprConstInt(expr->at, -1); @@ -2088,32 +2090,32 @@ namespace das { return new ExprConstInt(expr->at, index); } else { error("variant_index variant " + expr->subtrait + " not found in " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::lookup_variant_field); } } } else if (expr->trait == "mangled_name") { if (!expr->subexpr) { error("mangled name requires subexpression", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::missing_typeinfo_subexpression); } else { if (expr->subexpr->rtti_isAddr()) { auto eaddr = static_cast(expr->subexpr); if (!eaddr->func) { error("mangled name of unknown @@function", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::lookup_function_mangled_name); } else { reportAstChanged(); return new ExprConstString(expr->at, eaddr->func->getMangledName()); } } else { error("unsupported mangled name subexpression ", expr->subexpr->__rtti, "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_mangled_subexpression); } } } else if (expr->trait == "is_argument") { if (!expr->subexpr) { error("is argument requires subexpression", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::missing_typeinfo_subexpression); } else { if (expr->subexpr->rtti_isVar()) { auto evar = static_cast(expr->subexpr); @@ -2151,7 +2153,7 @@ namespace das { return new ExprConstString(expr->at, expr->typeexpr->structType->name); } else { error("can't get struct_name of " + expr->typeexpr->describe(), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_struct_name); } } else if (expr->trait == "struct_modulename") { if (expr->typeexpr->isStructure()) { @@ -2160,7 +2162,7 @@ namespace das { return new ExprConstString(expr->at, modd ? modd->name : ""); } else { error("can't get struct_modulename of " + expr->typeexpr->describe(), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_struct_modulename); } } else if (expr->trait == "is_pod") { reportAstChanged(); @@ -2330,7 +2332,7 @@ namespace das { return new ExprConstBool(expr->at, false); } else { error("typeinfo(has_field<" + expr->subtrait + "> ...) is only defined for structures and handled types, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_has_field_type); } } } else if (expr->trait == "struct_has_annotation" || expr->trait == "struct_safe_has_annotation") { @@ -2344,7 +2346,7 @@ namespace das { return new ExprConstBool(expr->at, false); } else { error("typeinfo(struct_has_annotation<" + expr->subtrait + "> ...) is only defined for structures, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_struct_has_annotation_type); } } } else if (expr->trait == "struct_has_annotation_argument" || expr->trait == "struct_safe_has_annotation_argument") { @@ -2356,7 +2358,7 @@ namespace das { return new ExprConstBool(expr->at, false); } else { error("typeinfo(struct_has_annotation_argument<" + expr->subtrait + ";" + expr->extratrait + "> ...) annotation not found ", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::lookup_typeinfo_annotation); } } else { reportAstChanged(); @@ -2369,7 +2371,7 @@ namespace das { return new ExprConstBool(expr->at, false); } else { error("typeinfo(struct_has_annotation_argument<" + expr->subtrait + "> ...) is only defined for structures, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_struct_has_annotation_argument_type); } } } else if (expr->trait == "struct_get_annotation_argument") { @@ -2378,13 +2380,13 @@ namespace das { auto it = find_if(ann.begin(), ann.end(), [&](const AnnotationDeclarationPtr &pa) { return pa->annotation->name == expr->subtrait; }); if (it == ann.end()) { error("typeinfo(struct_get_annotation_argument<" + expr->subtrait + ";" + expr->extratrait + "> ...) annotation not found ", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::lookup_typeinfo_annotation); } else { const auto &args = (*it)->arguments; auto ita = find_if(args.begin(), args.end(), [&](const AnnotationArgument &arg) { return arg.name == expr->extratrait; }); if (ita == args.end()) { error("typeinfo(struct_get_annotation_argument<" + expr->subtrait + ";" + expr->extratrait + "> ...) annotation argument not found ", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::lookup_typeinfo_annotation_argument); } else { switch (ita->type) { case Type::tBool: @@ -2401,13 +2403,13 @@ namespace das { return new ExprConstString(expr->at, ita->sValue); default: error("typeinfo(struct_get_annotation_argument<" + expr->subtrait + ";" + expr->extratrait + "> ...) unsupported annotation argument type ", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_annotation_argument_type); } } } } else { error("typeinfo(struct_get_annotation_argument<" + expr->subtrait + "> ...) is only defined for structures, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_struct_get_annotation_argument_type); } } else if (expr->trait == "offsetof") { if (expr->typeexpr->isStructure()) { @@ -2418,16 +2420,16 @@ namespace das { return new ExprConstInt(expr->at, decl->offset); } else { error("typeinfo(offsetof<" + expr->subtrait + "> ...) of undefined type, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::lookup_typeinfo_offsetof_type); } } else { error("typeinfo(offsetof<" + expr->subtrait + "> ...) is only defined for structures, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_offsetof_type); } } else if (expr->trait == "builtin_function_exists") { if (!expr->subexpr) { error("builtin_function_exists requires subexpression", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::missing_typeinfo_subexpression); } else { if (expr->subexpr->rtti_isAddr()) { auto eaddr = static_cast(expr->subexpr); @@ -2436,20 +2438,20 @@ namespace das { return new ExprConstBool(false); } else if (!eaddr->func->builtIn) { error("builtin_function_exists of non-builtin function @@" + describeFunction(eaddr->func), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_function); } else { reportAstChanged(); return new ExprConstBool(true); } } else { error("unsupported mangled name subexpression ", expr->subexpr->__rtti, "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_mangled_subexpression); } } } else if (expr->trait == "builtin_module_exists") { if (!expr->subexpr) { error("builtin_module_exists requires subexpression", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::missing_typeinfo_subexpression); } else { if (expr->subexpr->rtti_isVar()) { auto evar = static_cast(expr->subexpr); @@ -2458,7 +2460,7 @@ namespace das { return new ExprConstBool(mod != nullptr); } else { error("unsupported module name subexpression ", expr->subexpr->__rtti, "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_module_subexpression); } } } else if (expr->trait == "builtin_annotation_exists") { @@ -2467,7 +2469,7 @@ namespace das { return new ExprConstBool(false); } else if (!expr->typeexpr->isHandle()) { error("builtin_function_exists requires annotation type", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::invalid_typeinfo_annotation); } else { reportAstChanged(); return new ExprConstBool(true); @@ -2476,10 +2478,10 @@ namespace das { auto mtis = program->findTypeInfoMacro(expr->trait); if (mtis.size() > 1) { error("typeinfo(" + expr->trait + " ...) too many macros match the trait", "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::ambiguous_typeinfo_macro); } else if (mtis.empty()) { error("typeinfo(" + expr->trait + " ...) is undefined, " + describeType(expr->typeexpr), "", "", - expr->at, CompilationError::typeinfo_undefined); + expr->at, CompilationError::lookup_typeinfo_macro); } else { expr->macro = mtis.back(); string errors; @@ -2489,7 +2491,7 @@ namespace das { return cexpr; } else if (!errors.empty()) { error("typeinfo(" + expr->trait + " ...) macro reported error; " + errors, "", "", - expr->at, CompilationError::typeinfo_macro_error); + expr->at, CompilationError::runtime_typeinfo_macro); } else { auto ctype = expr->macro->getAstType(program->library, expr, errors); if (ctype) { @@ -2500,10 +2502,10 @@ namespace das { return Visitor::visit(expr); } else if (!errors.empty()) { error("typeinfo(" + expr->trait + " ...) macro reported error; " + errors, "", "", - expr->at, CompilationError::typeinfo_macro_error); + expr->at, CompilationError::runtime_typeinfo_macro); } else { error("typeinfo(" + expr->trait + " ...) is macro integration error; no ast change and no type", "", "", - expr->at, CompilationError::typeinfo_macro_error); + expr->at, CompilationError::internal_typeinfo_macro); } } } @@ -2525,20 +2527,20 @@ namespace das { // finalizer shape: name=="finalize", exactly 1 arg named "self" of struct type if (!func || func->name != "finalize" || func->arguments.size() != 1) { error("delete super.self is only allowed inside operator delete (a finalizer)", - "", "", expr->at, CompilationError::bad_delete); + "", "", expr->at, CompilationError::cant_delete_super); return Visitor::visit(expr); } auto &selfArg = func->arguments[0]; if (selfArg->name != "self" || !selfArg->type || !selfArg->type->isStructure()) { error("delete super.self: finalizer's first argument must be 'self' of a structure type", - "", "", expr->at, CompilationError::bad_delete); + "", "", expr->at, CompilationError::invalid_delete_super_self_type); return Visitor::visit(expr); } auto selfStruct = selfArg->type->structType; auto baseStruct = selfStruct->parent; if (!baseStruct) { error("delete super.self: " + selfStruct->name + " has no base class or structure", - "", "", expr->at, CompilationError::bad_delete); + "", "", expr->at, CompilationError::lookup_super_class); return Visitor::visit(expr); } // Walk up the inheritance chain to the nearest ancestor with a user-defined @@ -2574,7 +2576,7 @@ namespace das { baseStruct = baseStruct->parent; } error("delete super.self in " + func->name + ": no ancestor of " + selfStruct->name + " defines a finalizer", - "", "", expr->at, CompilationError::bad_delete); + "", "", expr->at, CompilationError::lookup_super_finalizer); return Visitor::visit(expr); } } @@ -2605,38 +2607,38 @@ namespace das { expr->sizeexpr = Expression::autoDereference(expr->sizeexpr); if (!expr->sizeexpr->type) { error("delete size type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_delete_size_type); return Visitor::visit(expr); } if (!expr->sizeexpr->type->isSimpleType(Type::tInt)) { error("can't delete, expecting size to be int and not " + describeType(expr->sizeexpr->type), "", "", - expr->at, CompilationError::bad_delete); + expr->at, CompilationError::invalid_delete_size_type); } } // strict unsafe delete if (strictUnsafeDelete && !safeExpression(expr) && !expr->subexpr->type->isSafeToDelete()) { error("delete of " + expr->subexpr->type->describe() + " requires unsafe", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_delete); return Visitor::visit(expr); } // infer if (!expr->subexpr->type->canDelete()) { error("can't delete " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::bad_delete); + expr->at, CompilationError::cant_delete); } else if (!expr->subexpr->type->isRef()) { error("can only delete reference " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::bad_delete); + expr->at, CompilationError::cant_delete); } else if (expr->subexpr->type->isConst()) { error("can't delete constant expression " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::bad_delete); + expr->at, CompilationError::cant_delete); } else if (expr->subexpr->type->isPointer()) { if (!safeExpression(expr) && !(expr->subexpr->type->smartPtr || expr->subexpr->type->smartPtrNative)) { error("delete of pointer requires unsafe", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_delete_pointer); } else if (expr->subexpr->type->firstType && expr->subexpr->type->firstType->isHandle() && expr->subexpr->type->firstType->annotation->isSmart() && !expr->subexpr->type->smartPtr) { error("can't delete smart pointer type via regular pointer delete", "", "", - expr->at, CompilationError::bad_delete); + expr->at, CompilationError::cant_delete_smart_pointer); } else if (!expr->native) { if (expr->subexpr->type->firstType && expr->subexpr->type->firstType->needDelete()) { auto ptrf = getFinalizeFunc(expr->subexpr->type); @@ -2653,7 +2655,7 @@ namespace das { } else if (ptrf.size() > 1) { string candidates = verbose ? program->describeCandidates(ptrf) : ""; error("too many finalizers", candidates, "", - expr->at, CompilationError::function_already_declared); + expr->at, CompilationError::ambiguous_finalizer); return Visitor::visit(expr); } reportAstChanged(); @@ -2737,13 +2739,13 @@ namespace das { reportAstChanged(); } else { error("undefined cast type " + describeType(expr->castType), - reportInferAliasErrors(expr->castType), "", expr->at, CompilationError::type_not_found); + reportInferAliasErrors(expr->castType), "", expr->at, CompilationError::lookup_cast_type); return Visitor::visit(expr); } } if (expr->castType->isAuto()) { error("casting to undefined type " + describeType(expr->castType), "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::lookup_cast_type); return Visitor::visit(expr); } if (expr->subexpr->type->isSameExactType(*expr->castType)) { @@ -2768,14 +2770,14 @@ namespace das { if (expr->upcast || expr->reinterpret) { if (!safeExpression(expr)) { error("cast requires unsafe", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_cast); } } if (expr->type) { verifyType(expr->type); } else { error("can't cast " + describeType(expr->subexpr->type) + " to " + describeType(expr->castType), "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::invalid_cast_type); return Visitor::visit(expr); } return Visitor::visit(expr); @@ -2792,16 +2794,16 @@ namespace das { updateNewFlags(expr); if (!expr->subexpr->type->isRef()) { error("can't ascend (to heap) non-reference value", "", "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::cant_ascend); } else if (expr->subexpr->type->baseType == Type::tHandle) { const auto &subt = expr->subexpr->type; if (!subt->dim.empty()) { error("array of handled type cannot be allocated on the heap: '" + describeType(subt) + "'", "", "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::invalid_ascend_array_handle_type); } if (!subt->annotation->canNew()) { error("cannot allocate on the heap this handled type at all: '" + describeType(subt) + "'", "", "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::invalid_ascend_handle_type); } } if (expr->ascType) { @@ -2821,7 +2823,7 @@ namespace das { call->argumentsFailedToInfer = false; if (call->func && call->func->arguments.size() > DAS_MAX_FUNCTION_ARGUMENTS) { error("too many arguments in 'new', max allowed is DAS_MAX_FUNCTION_ARGUMENTS=" DAS_STR(DAS_MAX_FUNCTION_ARGUMENTS), "", "", - call->at, CompilationError::too_many_arguments); + call->at, CompilationError::exceeds_new_argument); } } void InferTypes::preVisitNewArg(ExprNew *call, Expression *arg, bool last) { @@ -2831,7 +2833,7 @@ namespace das { void InferTypes::checkEmptyBlock(Expression *arg) { if (arg->rtti_isBlock()) { error("block can't be function argument", "", "", - arg->at, CompilationError::invalid_argument_type); + arg->at, CompilationError::invalid_function_argument_type_block); } } ExpressionPtr InferTypes::visitNewArg(ExprNew *call, Expression *arg, bool last) { @@ -2850,7 +2852,7 @@ namespace das { } if (!expr->typeexpr) { error("new type did not infer", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_new_type); return Visitor::visit(expr); } if (expr->typeexpr && expr->typeexpr->isExprType()) { @@ -2866,7 +2868,7 @@ namespace das { reportAstChanged(); } else { error("undefined new expression type '" + describeType(expr->typeexpr) + "'", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::lookup_new_type); return Visitor::visit(expr); } } @@ -2878,7 +2880,7 @@ namespace das { } else if (expr->typeexpr->baseType == Type::tStructure) { if (!expr->initializer && expr->typeexpr->structType->isClass) { error("invalid syntax for 'new' of class, expected syntax: 'new " + describeType(expr->typeexpr) + "()'", "", "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::invalid_new_class_syntax); } expr->type = new TypeDecl(Type::tPointer); expr->type->firstType = new TypeDecl(*expr->typeexpr); @@ -2925,7 +2927,7 @@ namespace das { } if (expr->initializer && expr->name.empty()) { error("only native structures can have initializers, not '" + describeType(expr->typeexpr) + "'", "", "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::invalid_new_initializer_type); } if (expr->type && expr->initializer && !expr->name.empty()) { auto resultType = new TypeDecl(*expr->type); @@ -2941,7 +2943,7 @@ namespace das { if (expr->func) { if (!expr->type->firstType->isSameType(*resultType, RefMatters::yes, ConstMatters::yes, TemporaryMatters::yes)) { error("initializer returns '" + describeType(resultType) + "' vs '" + describeType(expr->type->firstType) + "'", "", "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::invalid_new_initializer_result_type); } } else { if (expr->typeexpr->baseType == Type::tStructure && @@ -2954,7 +2956,7 @@ namespace das { extraError = "while compiling function " + func->describe(); } error("'" + describeType(expr->type->firstType) + "' does not have default initializer", extraError, "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::missing_new_default_initializer); } } verifyType(expr->typeexpr); @@ -2990,33 +2992,33 @@ namespace das { auto ixT = expr->index->type; if (!ixT) { error("index type can't be inferred", "", "", - expr->index->at, CompilationError::type_not_found); + expr->index->at, CompilationError::not_resolved_yet_index_type); return Visitor::visit(expr); } if (seT->isGoodTableType()) { if (!seT->firstType->isSameType(*ixT, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) { error("table index type mismatch, '" + describeType(seT->firstType) + "' vs '" + describeType(ixT) + "'", "", "", - expr->index->at, CompilationError::invalid_index_type); + expr->index->at, CompilationError::invalid_table_index_type); return Visitor::visit(expr); } if (seT->isConst()) { error("cannot access the constant table by index, use 'get' instead", "", "", - expr->index->at, CompilationError::invalid_table_type); + expr->index->at, CompilationError::cant_index_table); return Visitor::visit(expr); } if (ixT->temporary && seT->firstType->isTempType()) { error("can't index with the temporary key", "", "", - expr->index->at, CompilationError::invalid_index_type); + expr->index->at, CompilationError::cant_index_key); return Visitor::visit(expr); } if (seT->secondType->isVoid()) { error("table<...; void> cannot be accessed by index", "", "", - expr->index->at, CompilationError::invalid_index_type); + expr->index->at, CompilationError::cant_index_table); return Visitor::visit(expr); } if (unsafeTableLookup && !safeExpression(expr)) { error("table index requires unsafe", "use 'get_value', 'insert', 'insert_clone' or 'emplace' instead. consider 'get'", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_table_index); } TypeDecl::clone(expr->type, seT->secondType); expr->type->ref = true; @@ -3024,7 +3026,7 @@ namespace das { } else if (seT->isHandle()) { if (!seT->annotation->isIndexable(ixT)) { error("handle '" + seT->annotation->name + "' does not support index type '" + describeType(ixT) + "'", "", "", - expr->index->at, CompilationError::invalid_index_type); + expr->index->at, CompilationError::invalid_handle_index_type); return Visitor::visit(expr); } expr->type = seT->annotation->makeIndexType(expr->subexpr, expr->index); @@ -3032,7 +3034,7 @@ namespace das { } else if (seT->isPointer()) { if (!safeExpression(expr)) { error("index of the pointer must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_pointer_index); } if (!ixT->isIndexExt()) { error("index type must be 'int', 'int64', 'uint', or 'uint64' and not '" + describeType(ixT) + "'", "", "", @@ -3040,7 +3042,7 @@ namespace das { return Visitor::visit(expr); } else if (!seT->firstType || seT->firstType->getSizeOf() == 0) { error("can't index 'void' pointer", "", "", - expr->index->at, CompilationError::invalid_index_type); + expr->index->at, CompilationError::cant_index_pointer); return Visitor::visit(expr); } else { expr->subexpr = Expression::autoDereference(expr->subexpr); @@ -3075,7 +3077,7 @@ namespace das { return Visitor::visit(expr); } else if (!seT->isAutoArrayResolved()) { error("type dimensions are not resolved yet: '" + describeType(seT) + "'", "", "", - expr->subexpr->at, CompilationError::cant_index); + expr->subexpr->at, CompilationError::not_resolved_yet_array_dimension); return Visitor::visit(expr); } else { TypeDecl::clone(expr->type, seT); @@ -3106,24 +3108,24 @@ namespace das { auto ixT = expr->index->type; if (!ixT) { error("safe index type can't be inferred", "", "", - expr->index->at, CompilationError::type_not_found); + expr->index->at, CompilationError::not_resolved_yet_index_type); return Visitor::visit(expr); } if (expr->subexpr->type->isPointer()) { if (!expr->subexpr->type->firstType) { error("can't index 'void' pointer", "", "", - expr->index->at, CompilationError::cant_index); + expr->index->at, CompilationError::cant_index_pointer); return Visitor::visit(expr); } auto seT = expr->subexpr->type->firstType; if (seT->isGoodTableType()) { if (!safeExpression(expr)) { error("safe-index of table<> must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_table_safe_index); } if (!seT->firstType->isSameType(*ixT, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) { error("table safe-index type mismatch, '" + describeType(seT->firstType) + "' vs '" + describeType(ixT) + "'", "", "", - expr->index->at, CompilationError::invalid_index_type); + expr->index->at, CompilationError::invalid_table_safe_index_type); return Visitor::visit(expr); } expr->type = new TypeDecl(Type::tPointer); @@ -3133,7 +3135,7 @@ namespace das { // TODO: support handle safe index // if (!seT->annotation->isIndexable(ixT)) { error("handle '" + seT->annotation->name + "' does not support safe index type '" + describeType(ixT) + "'", "", "", - expr->index->at, CompilationError::invalid_index_type); + expr->index->at, CompilationError::invalid_handle_safe_index_type); return Visitor::visit(expr); // } // expr->type = seT->annotation->makeIndexType(expr->subexpr, expr->index); @@ -3152,7 +3154,7 @@ namespace das { } else if (seT->isGoodArrayType()) { if (!safeExpression(expr)) { error("safe-index of array<> must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_array_safe_index); } expr->type = new TypeDecl(Type::tPointer); expr->type->firstType = new TypeDecl(*seT->firstType); @@ -3160,7 +3162,7 @@ namespace das { } else if (seT->dim.size()) { if (!seT->isAutoArrayResolved()) { error("type dimensions are not resolved yet '" + describeType(seT) + "'", "", "", - expr->subexpr->at, CompilationError::cant_index); + expr->subexpr->at, CompilationError::not_resolved_yet_array_dimension); return Visitor::visit(expr); } else { expr->type = new TypeDecl(Type::tPointer); @@ -3182,7 +3184,7 @@ namespace das { } if (!safeExpression(expr)) { error("safe-index of pointer must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_pointer_safe_index); return Visitor::visit(expr); } expr->type = new TypeDecl(*expr->subexpr->type); @@ -3191,7 +3193,7 @@ namespace das { } else if (expr->subexpr->type->isGoodArrayType()) { if (!safeExpression(expr)) { error("safe-index of array<> must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_array_safe_index); } if (!ixT->isIndex()) { error("index type must be 'int' or 'uint', not '" + describeType(ixT) + "'", "", "", @@ -3205,17 +3207,17 @@ namespace das { } else if (expr->subexpr->type->isGoodTableType()) { if (!safeExpression(expr)) { error("safe-index of table<> must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_table_safe_index); } const auto &seT = expr->subexpr->type; if (!seT->firstType->isSameType(*ixT, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) { error("table safe-index type mismatch, '" + describeType(seT->firstType) + "' vs '" + describeType(ixT) + "'", "", "", - expr->index->at, CompilationError::invalid_index_type); + expr->index->at, CompilationError::invalid_table_safe_index_type); return Visitor::visit(expr); } if (seT->secondType->isVoid()) { error("can't safe-index into table<...; void>", "", "", - expr->index->at, CompilationError::invalid_index_type); + expr->index->at, CompilationError::cant_safe_index_table); return Visitor::visit(expr); } expr->type = new TypeDecl(Type::tPointer); @@ -3224,7 +3226,7 @@ namespace das { } else if (expr->subexpr->type->dim.size()) { if (!safeExpression(expr)) { error("safe-index of fixed_array<> must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_fixed_array_safe_index); } if (!ixT->isIndex()) { error("index type must be 'int' or 'uint', not '" + describeType(ixT) + "'", "", "", @@ -3234,7 +3236,7 @@ namespace das { const auto &seT = expr->subexpr->type; if (!seT->isAutoArrayResolved()) { error("type dimensions are not resolved yet: '" + describeType(seT) + "'", "", "", - expr->subexpr->at, CompilationError::cant_index); + expr->subexpr->at, CompilationError::not_resolved_yet_array_dimension); } expr->type = new TypeDecl(Type::tPointer); expr->type->firstType = new TypeDecl(*seT); @@ -3255,7 +3257,7 @@ namespace das { expr->type->firstType->constant = seT->constant; } else { error("type can't be safe-indexed: '" + describeType(expr->subexpr->type) + "'", "", "", - expr->subexpr->at, CompilationError::cant_index); + expr->subexpr->at, CompilationError::cant_safe_index); return Visitor::visit(expr); } propagateTempType(expr->subexpr->type, expr->type); // foo#?[a] = a?# @@ -3272,7 +3274,7 @@ namespace das { TypeDecl::clone(block->type, block->returnType); } else { error("malformed AST, closure is missing return type", "", "", - block->at, CompilationError::malformed_ast); + block->at, CompilationError::internal_block_missing_return_type); } } scopes.push_back(block); @@ -3286,7 +3288,7 @@ namespace das { inFinally.back() = true; if (block->getFinallyEvalFlags()) { error("finally section can't have 'break', 'return', or 'goto'", "", "", - block->at, CompilationError::return_or_break_in_finally); + block->at, CompilationError::invalid_block_finally); } } void InferTypes::preVisitBlockArgument(ExprBlock *block, const VariablePtr &var, bool lastArg) { @@ -3296,7 +3298,7 @@ namespace das { for (auto &fna : func->arguments) { if (fna->name == var->name) { error("block argument '" + var->name + "' is shadowed by function argument '" + fna->name + ": " + describeType(fna->type) + "' at line " + to_string(fna->at.line), "", "", - var->at, CompilationError::variable_not_found); + var->at, CompilationError::already_declared_block_argument); } } } @@ -3306,20 +3308,20 @@ namespace das { for (auto &bna : blk->arguments) { if (bna->name == var->name) { error("block argument '" + var->name + "' is shadowed by another block argument '" + bna->name + ": " + describeType(bna->type) + "' at line " + to_string(bna->at.line), "", "", - var->at, CompilationError::variable_not_found); + var->at, CompilationError::already_declared_block_argument); } } } for (auto &lv : local) { if (lv->name == var->name) { error("block argument '" + var->name + "' is shadowed by local variable '" + lv->name + ": " + describeType(lv->type) + "' at line " + to_string(lv->at.line), "", "", - var->at, CompilationError::variable_not_found); + var->at, CompilationError::already_declared_block_argument); break; } } if (auto eW = hasMatchingWith(var->name)) { error("block argument '" + var->name + "' is shadowed by with expression at line " + to_string(eW->at.line), "", "", - var->at, CompilationError::variable_not_found); + var->at, CompilationError::already_declared_block_argument); } } if (var->type->isAlias()) { @@ -3329,35 +3331,35 @@ namespace das { reportAstChanged(); } else { error("undefined block argument type '" + describeType(var->type) + "'", - reportInferAliasErrors(var->type), "", var->at, CompilationError::type_not_found); + reportInferAliasErrors(var->type), "", var->at, CompilationError::lookup_block_argument_type); } } if (var->type->isAuto() && !var->init) { error("block argument type can't be inferred, it needs an " "initializer or to be passed to the function with the explicit block definition", "", "", - var->at, CompilationError::cant_infer_missing_initializer); + var->at, CompilationError::missing_block_argument_init); } if (var->type->ref && var->type->isRefType()) { // silently fix a : Foo& into a : Foo var->type->ref = false; } if (var->type->isVoid()) { error("block argument type can't be declared void", "", "", - var->at, CompilationError::invalid_type); + var->at, CompilationError::invalid_block_argument_type); } verifyType(var->type, true); } ExpressionPtr InferTypes::visitBlockArgumentInit(ExprBlock *block, const VariablePtr &arg, Expression *that) { if (!arg->init->type) { error("block argument initialization with undefined expression", "", "", - arg->at, CompilationError::invalid_type); + arg->at, CompilationError::not_resolved_yet_block_argument_init); return Visitor::visitBlockArgumentInit(block, arg, that); } if (arg->type->isAuto()) { auto argT = TypeDecl::inferGenericType(arg->type, arg->init->type, false, false, nullptr); if (!argT) { error("block argument initialization type can't be inferred, " + describeType(arg->type) + " = " + describeType(arg->init->type), "", "", - arg->at, CompilationError::cant_infer_mismatching_restrictions); + arg->at, CompilationError::invalid_block_argument_init_type); } else { TypeDecl::applyAutoContracts(argT, arg->type); arg->type = argT; @@ -3369,11 +3371,11 @@ namespace das { if (!arg->type->isAuto()) { if (!arg->init->type || !arg->type->isSameType(*arg->init->type, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) { error("block argument default value type mismatch '" + describeType(arg->type) + "' vs '" + (arg->init->type ? describeType(arg->init->type) : "???") + "'", "", "", - arg->init->at, CompilationError::invalid_argument_type); + arg->init->at, CompilationError::invalid_block_argument_init_type); } if (arg->init->type && arg->type->ref && !arg->init->type->ref) { error("block argument default value type mismatch '" + describeType(arg->type) + "' vs '" + describeType(arg->init->type) + "', reference matters", "", "", - arg->init->at, CompilationError::invalid_argument_type); + arg->init->at, CompilationError::invalid_block_argument_init_type); } } return Visitor::visitBlockArgumentInit(block, arg, that); @@ -3415,11 +3417,11 @@ namespace das { uint32_t flags = block->getEvalFlags(); if (flags & EvalFlags::stopForBreak) { error("captured block can't 'break' outside of the block", "", "", - block->at, CompilationError::invalid_block); + block->at, CompilationError::invalid_block_break); } if (flags & EvalFlags::stopForContinue) { error("captured block can't 'continue' outside of the block", "", "", - block->at, CompilationError::invalid_block); + block->at, CompilationError::invalid_block_continue); } } if (!block->hasReturn && canFoldResult && block->type->isAuto()) { @@ -3439,7 +3441,7 @@ namespace das { reportAstChanged(); } else { error("undefined block result type '" + describeType(block->returnType) + "'", - reportInferAliasErrors(block->returnType), "", block->at, CompilationError::type_not_found); + reportInferAliasErrors(block->returnType), "", block->at, CompilationError::lookup_block_result_type); return Visitor::visit(block); } } @@ -3460,7 +3462,7 @@ namespace das { auto valT = expr->value->type; if (!valT->isVectorType()) { error("unsupported swizzle type '" + valT->describe() + "'", "", "", - expr->at, CompilationError::invalid_swizzle_mask); + expr->at, CompilationError::invalid_swizzle_type); return Visitor::visit(expr); } int dim = valT->getVectorDim(); @@ -3513,13 +3515,13 @@ namespace das { auto valT = expr->value->type; if (!valT->isGoodVariantType()) { error(" as '" + expr->name + "' only allowed for variants", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_as); return Visitor::visit(expr); } int index = valT->findArgumentIndex(expr->name); if (index == -1 || index >= int(valT->argTypes.size())) { error("can't get variant field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_variant_field); return Visitor::visit(expr); } expr->fieldIndex = index; @@ -3563,12 +3565,12 @@ namespace das { // regular infer if (!expr->value->type->isPointer() && !safeExpression(expr)) { error("variant ?as on non-pointer requires unsafe", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_variant_safe_as); } auto valT = expr->value->type->isPointer() ? expr->value->type->firstType : expr->value->type; if (!valT || !valT->isGoodVariantType()) { error(" ?as " + expr->name + " only allowed for variants or pointers to variants and not " + expr->value->type->describe(), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_safe_as); return Visitor::visit(expr); } if (expr->value->type->isPointer()) { @@ -3577,7 +3579,7 @@ namespace das { int index = valT->findArgumentIndex(expr->name); if (index == -1 || index >= int(valT->argTypes.size())) { error("can't get variant field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_variant_field); return Visitor::visit(expr); } expr->fieldIndex = index; @@ -3623,13 +3625,13 @@ namespace das { auto valT = expr->value->type; if (!valT->isGoodVariantType()) { error(" is " + expr->name + " only allowed for variants", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_is); return Visitor::visit(expr); } int index = valT->findArgumentIndex(expr->name); if (index == -1 || index >= int(valT->argTypes.size())) { error("can't get variant field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_variant_field); return Visitor::visit(expr); } expr->fieldIndex = index; @@ -3658,7 +3660,7 @@ namespace das { return true; }, moduleName); if (possibleBitfields.size() && possibleEnums.size()) { error("ambiguous field lookup, '" + var->name + "' is both an enum and a bitfield", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::ambiguous_field_lookup); return Visitor::visit(expr); } if (possibleEnums.size() == 1) { @@ -3697,10 +3699,10 @@ namespace das { if (foundCount == 1) { if (!found->init) { error("bitfield constant '" + expr->name + "' of type " + describeType(alias) + " is not initialized", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::missing_bitfield_init); } else if (!found->init->type || !found->init->type->constant || !found->init->type->isBitfield()) { error("not a valid bitfield constant " + expr->name + " of type " + describeType(found->type), "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::invalid_bitfield); return Visitor::visit(expr); } reportAstChanged(); @@ -3718,12 +3720,12 @@ namespace das { } } error("bitfield constant '" + expr->name + "' of type " + describeType(alias) + " is ambiguous", tw.str(), "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::ambiguous_bitfield); return Visitor::visit(expr); } } else { error("bitfield '" + expr->name + "' not found in " + describeType(alias), "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_bitfield); return Visitor::visit(expr); } } @@ -3741,10 +3743,12 @@ namespace das { tw << "\tbitfield " << bf->alias << " in " << (bf->alias.empty() ? "this module" : bf->alias) << "\n"; } error("'" + var->name + "' is ambiguous", tw.str(), "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::ambiguous_field); } else { - error("Don't know what '" + var->name + "' is", "", "", - expr->at, CompilationError::cant_get_field); + if (verbose) { + error("Don't know what '" + var->name + "' is", "", "", + expr->at, CompilationError::lookup_field); + } } } } @@ -3753,7 +3757,7 @@ namespace das { return Visitor::visit(expr); // failed to infer if (expr->name.empty()) { error("syntax error, expecting field after '.'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::invalid_field_syntax); return Visitor::visit(expr); } if (!expr->underClone) { @@ -3768,7 +3772,7 @@ namespace das { expr->unsafeDeref = func ? func->unsafeDeref : false; if (!valT->firstType) { error("can't get field '" + expr->name + "' of 'void' pointer", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::cant_get_field_pointer); return Visitor::visit(expr); } else if (valT->firstType->isStructure()) { expr->fieldRef = valT->firstType->structType->findFieldRef(expr->name); @@ -3790,20 +3794,20 @@ namespace das { int index = valT->tupleFieldIndex(expr->name); if (index == -1 || index >= int(valT->firstType->argTypes.size())) { error("can't get tuple field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_tuple_field); return Visitor::visit(expr); } expr->fieldIndex = index; } else if (valT->firstType->isGoodVariantType()) { if (!safeExpression(expr)) { error("'variant.field' must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_variant_field); return Visitor::visit(expr); } int index = valT->variantFieldIndex(expr->name); if (index == -1 || index >= int(valT->firstType->argTypes.size())) { error("can't get variant field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_variant_field); return Visitor::visit(expr); } expr->fieldIndex = index; @@ -3817,13 +3821,13 @@ namespace das { valT = expr->value->type; if (!valT) { error("bitfield type can't be inferred", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::not_resolved_yet_bitfield_type); return Visitor::visit(expr); } int index = valT->bitFieldIndex(expr->name); if (index == -1 || index >= int(valT->argNames.size())) { error("can't get bit field '" + expr->name + "' in " + describeType(valT), "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_bitfield); return Visitor::visit(expr); } expr->fieldIndex = index; @@ -3845,20 +3849,20 @@ namespace das { int index = valT->tupleFieldIndex(expr->name); if (index == -1 || index >= int(valT->argTypes.size())) { error("can't get tuple field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_tuple_field); return Visitor::visit(expr); } expr->fieldIndex = index; } else if (valT->isGoodVariantType()) { if (!safeExpression(expr)) { error("variant.field requires unsafe", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_variant_field); return Visitor::visit(expr); } int index = valT->variantFieldIndex(expr->name); if (index == -1 || index >= int(valT->argTypes.size())) { error("can't get variant field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_variant_field); return Visitor::visit(expr); } expr->fieldIndex = index; @@ -3876,7 +3880,7 @@ namespace das { if (expr->fieldRef) { if (expr->fieldRef->type->isAliasOrExpr()) { error("undefined field type '" + describeType(expr->fieldRef->type) + "'", - reportInferAliasErrors(expr->fieldRef->type), "", expr->at, CompilationError::type_not_found); + reportInferAliasErrors(expr->fieldRef->type), "", expr->at, CompilationError::lookup_field_type); return Visitor::visit(expr); } TypeDecl::clone(expr->type, expr->fieldRef->type); @@ -3896,7 +3900,7 @@ namespace das { auto & tt = tupleT->argTypes[expr->fieldIndex]; if ( !tt->isRefType() && tt->ref ) { error("can't get field '" + expr->name + "', invalid field type '" + describeType(tt), "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::invalid_field_type); return Visitor::visit(expr); } TypeDecl::clone(expr->type, tt); @@ -3945,14 +3949,14 @@ namespace das { if (!mf.empty()) { reportDualFunctionNotFound("?.`" + expr->name, "can only safe dereference a variant or a pointer to a tuple, a structure or a handle " + describeType(valT), expr->at, mf, {expr->value->type}, {expr->value->type, new TypeDecl(Type::tString)}, true, false, true, - CompilationError::cant_get_field, 0, ""); + CompilationError::invalid_safe_dereference_type, 0, ""); } else { error("can only safe dereference a variant or a pointer to a tuple, a structure or a handle " + describeType(valT), "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::invalid_safe_dereference_type); } } else { error("can only safe dereference a variant or a pointer to a tuple, a structure or a handle " + describeType(valT), "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::invalid_safe_dereference_type); } return Visitor::visit(expr); } @@ -3962,7 +3966,7 @@ namespace das { auto argSize = valT->isGoodVariantType() ? valT->argTypes.size() : valT->firstType->argTypes.size(); if (index == -1 || index >= static_cast(argSize)) { error("can't get variant field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_variant_field); return Visitor::visit(expr); } reportAstChanged(); @@ -3972,11 +3976,11 @@ namespace das { expr->fieldRef = valT->firstType->structType->findFieldRef(expr->name); if (!expr->fieldRef) { error("can't safe get field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::cant_safe_get_field); return Visitor::visit(expr); } else if (expr->fieldRef->type->isAliasOrExpr()) { error("undefined safe field type '" + describeType(expr->fieldRef->type) + "'", - reportInferAliasErrors(expr->fieldRef->type), "", expr->at, CompilationError::type_not_found); + reportInferAliasErrors(expr->fieldRef->type), "", expr->at, CompilationError::lookup_safe_field_type); return Visitor::visit(expr); } TypeDecl::clone(expr->type, expr->fieldRef->type); @@ -3985,27 +3989,27 @@ namespace das { expr->type = expr->annotation->makeSafeFieldType(expr->name, valT->constant); if (!expr->type) { error("can't safe get field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::cant_safe_get_field); return Visitor::visit(expr); } } else if (valT->firstType->isGoodTupleType()) { int index = valT->tupleFieldIndex(expr->name); if (index == -1 || index >= int(valT->firstType->argTypes.size())) { error("can't get tuple field '" + expr->name + "'", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::lookup_tuple_field); return Visitor::visit(expr); } expr->fieldIndex = index; auto & tt = valT->firstType->argTypes[expr->fieldIndex]; if ( !tt->isRefType() && tt->ref ) { error("can't safe get field '" + expr->name + "', invalid field type '" + describeType(tt), "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::invalid_safe_field_type); return Visitor::visit(expr); } TypeDecl::clone(expr->type, tt); } else { error("can only safe dereference a pointer to a tuple, a structure or a handle " + describeType(valT), "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::invalid_safe_dereference_type); return Visitor::visit(expr); } expr->skipQQ = expr->type->isPointer(); @@ -4022,7 +4026,7 @@ namespace das { } void InferTypes::preVisit(ExprTag *expr) { Visitor::preVisit(expr); - error("macro tags can only appear in macro blocks", "", "", expr->at, CompilationError::unbound_macro_tag); + error("macro tags can only appear in macro blocks", "", "", expr->at, CompilationError::invalid_macro_tag); } void InferTypes::preVisit(ExprVar *expr) { Visitor::preVisit(expr); @@ -4123,8 +4127,8 @@ namespace das { if (vars.size() == 1) { auto var = vars.back(); if (var == globalVar) { - error("global variable '" + expr->name + "' cant't be initialized with itself", - "", "", expr->at, CompilationError::variable_not_found); + error("global variable '" + expr->name + "' can't be initialized with itself", + "", "", expr->at, CompilationError::invalid_global_self_init); return Visitor::visit(expr); } expr->variable = var; @@ -4144,14 +4148,16 @@ namespace das { errs << "\n"; } error("can't access private variable '" + expr->name + "'", "not visible due to privacy:\n" + errs.str(), "", - expr->at, CompilationError::variable_not_found); + expr->at, CompilationError::invalid_variable_private); } else { - error("can't locate variable '" + expr->name + "'", "", "", - expr->at, CompilationError::variable_not_found); + if (verbose) { + error("can't locate variable '" + expr->name + "'", "", "", + expr->at, CompilationError::lookup_variable); + } } } else { error("can't locate variable '" + expr->name + "'", "", "", - expr->at, CompilationError::variable_not_found); + expr->at, CompilationError::lookup_variable); } } else { if (verbose) { @@ -4164,10 +4170,12 @@ namespace das { errs << "\n"; } error("too many matching variables '" + expr->name + "'", "candidates are:\n" + errs.str(), "", - expr->at, CompilationError::variable_not_found); + expr->at, CompilationError::ambiguous_variable); } else { - error("too many matching variables '" + expr->name + "'", "", "", - expr->at, CompilationError::variable_not_found); + if (verbose) { + error("too many matching variables '" + expr->name + "'", "", "", + expr->at, CompilationError::ambiguous_variable); + } } } return Visitor::visit(expr); @@ -4218,15 +4226,15 @@ namespace das { } if (block->returnType && block->returnType->ref && !safeExpression(expr)) { error("returning reference requires unsafe", "", "", - expr->at, CompilationError::invalid_return_type); + expr->at, CompilationError::unsafe_return_reference); } if (block->returnType && block->returnType->isTemp() && !safeExpression(expr)) { error("returning temporary value from block requires unsafe", "", "", - expr->at, CompilationError::invalid_return_type); + expr->at, CompilationError::unsafe_return_block); } if (strictSmartPointers && block->returnType && !expr->moveSemantics && !safeExpression(expr) && block->returnType->needInScope()) { error("returning smart pointers without move semantics is unsafe", "use return <- instead", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_return_smart_pointer); } if (block->returnType) { TypeDecl::clone(expr->returnType, block->returnType); @@ -4258,15 +4266,15 @@ namespace das { } if (func->result->ref && !safeExpression(expr)) { error("returning reference requires unsafe", "", "", - func->result->at, CompilationError::invalid_return_type); + func->result->at, CompilationError::unsafe_return_reference); } if (func->result->isTemp() && !safeExpression(expr)) { error("returning temporary value from function requires unsafe", "", "", - func->result->at, CompilationError::invalid_return_type); + func->result->at, CompilationError::unsafe_return_function); } if (strictSmartPointers && !expr->moveSemantics && !safeExpression(expr) && func->result->needInScope()) { error("returning smart pointers without move semantics is unsafe", "use return <- instead", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_return_smart_pointer); } if (func->result) { TypeDecl::clone(expr->returnType, func->result); @@ -4283,7 +4291,7 @@ namespace das { ExpressionPtr InferTypes::visit(ExprYield *expr) { if (blocks.size()) { error("can't yield from inside the block", "", "", - expr->at, CompilationError::invalid_yield); + expr->at, CompilationError::invalid_yield_in_block); } else { if (!func->generator) { error("can't yield from non-generator", "", "", @@ -4305,13 +4313,13 @@ namespace das { ExpressionPtr InferTypes::visit(ExprBreak *expr) { if (!loop.size()) error("'break' without a loop", "", "", - expr->at, CompilationError::invalid_loop); + expr->at, CompilationError::invalid_break); return Visitor::visit(expr); } ExpressionPtr InferTypes::visit(ExprContinue *expr) { if (!loop.size()) error("'continue' without a loop", "", "", - expr->at, CompilationError::invalid_loop); + expr->at, CompilationError::invalid_continue); return Visitor::visit(expr); } bool InferTypes::canVisitIfSubexpr(ExprIfThenElse *expr) { @@ -4352,7 +4360,7 @@ namespace das { // infer if (!expr->cond->type->isSimpleType(Type::tBool)) { error("if-then-else condition must be boolean, and not " + expr->cond->type->describe(), "", "", - expr->at, CompilationError::condition_must_be_bool); + expr->at, CompilationError::invalid_if_condition_type); return Visitor::visit(expr); } if (expr->cond->type->isRef()) { @@ -4370,7 +4378,7 @@ namespace das { } } else if (expr->isStatic) { error("static_if must resolve to constant", "", "", - expr->at, CompilationError::condition_must_be_static); + expr->at, CompilationError::invalid_static_if_condition); return Visitor::visit(expr); } } @@ -4390,7 +4398,7 @@ namespace das { auto iftb = static_cast(expr->if_true); if (!iftb->finalList.empty()) { error("can't have final section in the if-then-else inside generator yet", "", "", - expr->at, CompilationError::invalid_yield); + expr->at, CompilationError::invalid_finally_in_generator_if); return Visitor::visit(expr); } } @@ -4398,7 +4406,7 @@ namespace das { auto iffb = static_cast(expr->if_false); if (!iffb->finalList.empty()) { error("can't have final section in the if-then-else inside generator yet", "", "", - expr->at, CompilationError::invalid_yield); + expr->at, CompilationError::invalid_finally_in_generator_if); return Visitor::visit(expr); } } @@ -4418,7 +4426,7 @@ namespace das { for (const auto &aa : assume) { if (aa.expr->alias == name) { error("can't assume " + name + ", alias already taken by another assume expression at " + aa.expr->at.describe(), "", "", - expr->at, CompilationError::invalid_assume); + expr->at, CompilationError::already_declared_assume_alias); return; } } @@ -4426,14 +4434,14 @@ namespace das { for (const auto &lv : local) { if (lv->name == name || lv->aka == name) { error("can't assume " + name + ", alias already taken by local variable at " + lv->at.describe(), "", "", - expr->at, CompilationError::invalid_assume); + expr->at, CompilationError::already_declared_assume_alias); return; } } // with if (auto mW = hasMatchingWith(name)) { error("can't assume " + name + ", alias already taken by `with` at " + mW->at.describe(), "", "", - expr->at, CompilationError::invalid_assume); + expr->at, CompilationError::already_declared_assume_alias); return; } // block arguments @@ -4441,7 +4449,7 @@ namespace das { for (const auto &arg : block->arguments) { if (arg->name == name || arg->aka == name) { error("can't assume " + name + ", alias already taken by block argument at " + arg->at.describe(), "", "", - expr->at, CompilationError::invalid_assume); + expr->at, CompilationError::already_declared_assume_alias); return; } } @@ -4451,7 +4459,7 @@ namespace das { for (auto &arg : func->arguments) { if (arg->name == name || arg->aka == name) { error("can't assume " + name + ", alias already taken by block argument at " + arg->at.describe(), "", "", - expr->at, CompilationError::invalid_assume); + expr->at, CompilationError::already_declared_assume_alias); return; } } @@ -4461,10 +4469,10 @@ namespace das { if (globals.size()) { if (globals.size() == 1) { error("can't assume " + name + ", alias already taken by global variable at " + globals[0]->at.describe(), "", "", - expr->at, CompilationError::invalid_assume); + expr->at, CompilationError::already_declared_assume_alias); } else { error("can't assume " + name + ", alias already taken by multiple global variables", "", "", - expr->at, CompilationError::invalid_assume); + expr->at, CompilationError::already_declared_assume_alias); } return; } @@ -4479,12 +4487,12 @@ namespace das { } } error("can't assume " + name + ", type or alias name is already used", extra, "", - expr->at, CompilationError::invalid_assume); + expr->at, CompilationError::already_declared_assume_alias); return; } if (!expr->assumeType) { error("assume without subexpression must have type", "", "", - expr->at, CompilationError::invalid_assume); + expr->at, CompilationError::missing_assume_type); return; } } @@ -4549,7 +4557,7 @@ namespace das { } } error("assume '" + expr->alias + "' creates a circular dependency", extra, "", - expr->at, CompilationError::invalid_assume); + expr->at, CompilationError::recursion_assume_alias); return expr; } assume.push_back(AssumeEntry{expr, move(collector.vars)}); @@ -4567,7 +4575,7 @@ namespace das { StructurePtr pSt = nullptr; if (wT->dim.size()) { error("with array in undefined, " + describeType(wT), "", "", - expr->at, CompilationError::invalid_with_type); + expr->at, CompilationError::invalid_with_array_type); } else if (wT->isStructure()) { pSt = wT->structType; } else if (wT->isPointer() && wT->firstType && wT->firstType->isStructure()) { @@ -4583,7 +4591,7 @@ namespace das { error("with expression shadows local variable " + lv->name + " at line " + to_string(lv->at.line), "", "", - expr->at, CompilationError::variable_not_found); + expr->at, CompilationError::already_declared_with_shadow); } } } @@ -4604,7 +4612,7 @@ namespace das { // infer if (!expr->cond->type->isSimpleType(Type::tBool)) { error("while loop condition must be boolean", "", "", - expr->at, CompilationError::invalid_loop); + expr->at, CompilationError::invalid_while_condition_type); } if (expr->cond->type->isRef()) { expr->cond = Expression::autoDereference(expr->cond); @@ -4638,11 +4646,11 @@ namespace das { Visitor::preVisitForStack(expr); if (!expr->iterators.size()) { error("for loop needs at least one iterator", "", "", - expr->at, CompilationError::invalid_loop); + expr->at, CompilationError::missing_for_iterator); return; } else if (expr->iterators.size() != expr->sources.size()) { error("for loop needs as many iterators as there are sources", "", "", - expr->at, CompilationError::invalid_loop); + expr->at, CompilationError::invalid_for_iterator_count); return; } // iterator variables @@ -4667,7 +4675,7 @@ namespace das { } else if (src->type->isGoodIteratorType()) { if (src->type->isConst()) { error("can't iterate over const iterator", "", "", - expr->at, CompilationError::invalid_iteration_source); + expr->at, CompilationError::cant_iterate_iterator); } pVar->type = new TypeDecl(*src->type->firstType); } else if (src->type->isGoodArrayType()) { @@ -4685,7 +4693,7 @@ namespace das { pVar->type = new TypeDecl(*src->type->annotation->makeIteratorType(src)); } else { error("unsupported iteration type " + src->type->describe() + " for the loop variable " + pVar->name + ", iterating over " + describeType(src->type), "", "", - expr->at, CompilationError::invalid_iteration_source); + expr->at, CompilationError::invalid_iteration_source_type); return; } pVar->type->constant |= src->type->isConst(); @@ -4695,7 +4703,7 @@ namespace das { for (auto &al : assume) { if (al.expr->alias == pVar->name) { error("can't make loop variable `" + pVar->name + "`, name already taken by alias", "", "", - pVar->at, CompilationError::variable_not_found); + pVar->at, CompilationError::already_declared_variable); } } if (!pVar->can_shadow && !program->policies.allow_local_variable_shadowing) { @@ -4703,7 +4711,7 @@ namespace das { for (auto &fna : func->arguments) { if (fna->name == pVar->name) { error("for loop iterator variable " + pVar->name + " is shadowed by function argument " + fna->name + ": " + describeType(fna->type) + " at line " + to_string(fna->at.line), "", "", - pVar->at, CompilationError::variable_not_found); + pVar->at, CompilationError::already_declared_variable); } } } @@ -4711,20 +4719,20 @@ namespace das { for (auto &bna : blk->arguments) { if (bna->name == pVar->name) { error("for loop iterator variable " + pVar->name + " is shadowed by block argument " + bna->name + ": " + describeType(bna->type) + " at line " + to_string(bna->at.line), "", "", - pVar->at, CompilationError::variable_not_found); + pVar->at, CompilationError::already_declared_variable); } } } for (auto &lv : local) { if (lv->name == pVar->name) { error("for loop iterator variable " + pVar->name + " is shadowed by another local variable " + lv->name + ": " + describeType(lv->type) + " at line " + to_string(lv->at.line), "", "", - pVar->at, CompilationError::variable_not_found); + pVar->at, CompilationError::already_declared_variable); break; } } if (auto eW = hasMatchingWith(pVar->name)) { error("for loop iterator variable " + pVar->name + " is shadowed by with expression at line " + to_string(eW->at.line), "", "", - pVar->at, CompilationError::variable_not_found); + pVar->at, CompilationError::already_declared_variable); } } local.push_back(pVar); @@ -4732,7 +4740,7 @@ namespace das { if (expr->iteratorsTupleExpansion.size() > idx && expr->iteratorsTupleExpansion[idx]) { if (pVar->type && !pVar->type->isTuple()) { error("for loop iterator variable " + pVar->name + " is not a tuple", "", "", - expr->at, CompilationError::invalid_iteration_source); + expr->at, CompilationError::invalid_for_iterator_tuple); } else { expandTupleName(pVar->name, pVar->at); } @@ -4860,17 +4868,17 @@ namespace das { reportAstChanged(); } else { error("undefined let type " + describeType(var->type), - reportInferAliasErrors(var->type), "", var->at, CompilationError::type_not_found); + reportInferAliasErrors(var->type), "", var->at, CompilationError::lookup_local_type); } } if (var->type->isAuto() && !var->init) { error("local variable type can't be inferred, it needs an initializer", "", "", - var->at, CompilationError::cant_infer_missing_initializer); + var->at, CompilationError::missing_local_init); } for (auto &al : assume) { if (al.expr->alias == var->name) { error("can't make local variable `" + var->name + "`, name already taken by alias", "", "", - var->at, CompilationError::variable_not_found); + var->at, CompilationError::already_declared_local_variable); } } if (!var->can_shadow && !program->policies.allow_local_variable_shadowing) { @@ -4878,7 +4886,7 @@ namespace das { for (auto &fna : func->arguments) { if (fna->name == var->name) { error("local variable " + var->name + " is shadowed by function argument " + fna->name + ": " + describeType(fna->type) + " at line " + to_string(fna->at.line), "", "", - var->at, CompilationError::variable_not_found); + var->at, CompilationError::already_declared_local_variable); } } } @@ -4886,20 +4894,20 @@ namespace das { for (auto &bna : blk->arguments) { if (bna->name == var->name) { error("local variable " + var->name + " is shadowed by block argument " + bna->name + ": " + describeType(bna->type) + " at line " + to_string(bna->at.line), "", "", - var->at, CompilationError::variable_not_found); + var->at, CompilationError::already_declared_local_variable); } } } for (auto &lv : local) { if (lv->name == var->name) { error("local variable " + var->name + " is shadowed by another local variable " + lv->name + ": " + describeType(lv->type) + " at line " + to_string(lv->at.line), "", "", - var->at, CompilationError::variable_not_found); + var->at, CompilationError::already_declared_local_variable); break; } } if (auto eW = hasMatchingWith(var->name)) { error("local variable " + var->name + " is shadowed by with expression at line " + to_string(eW->at.line), "", "", - var->at, CompilationError::variable_not_found); + var->at, CompilationError::already_declared_local_variable); } } if (!var->init) { @@ -4915,36 +4923,36 @@ namespace das { } if (var->type->ref && !var->init) error("local reference has to be initialized", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::missing_local_reference_init); if (var->type->ref && var->init && !(var->init->alwaysSafe || isLocalOrGlobal(var->init)) && !safeExpression(expr) && !(var->init->type && var->init->type->temporary)) { if (program->policies.local_ref_is_unsafe) { error("local reference to non-local expression is unsafe", "", "", - var->at, CompilationError::unsafe); + var->at, CompilationError::unsafe_local_reference); } } if (var->type->isVoid()) error("local variable can't be declared void", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::invalid_local_type); if (!var->type->isLocal() && !var->type->ref && !safeExpression(expr)) { if (var->type->isGoodBlockType()) { if (!var->init) { error("local block variable needs to be initialized", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::missing_local_block_init); } } else { error("local variable of type " + describeType(var->type) + " requires unsafe", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::unsafe_local_type); } } if (!var->type->ref && var->type->hasClasses() && !safeExpression(expr)) { error("local class requires unsafe " + describeType(var->type), "", "", - var->at, CompilationError::unsafe); + var->at, CompilationError::unsafe_local_class); } if (!var->type->isAutoOrAlias()) { if (!var->init && var->type->isLocal()) { // we already report error for non-local if (var->type->hasNonTrivialCtor()) { error("local variable of type " + describeType(var->type) + " needs to be initialized", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::missing_local_init); } } else if (var->init && var->init->rtti_isCast()) { auto castExpr = static_cast(var->init); @@ -4969,14 +4977,14 @@ namespace das { if (!var->inScope) { if ( inFinally.back() ) { error("in-scope variable " + var->name + " can't be declared in the finally block", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::invalid_local_in_scope_finally); return Visitor::visitLet(expr, var, last); } if (var->type->canDelete()) { if (var->type->constant) { error("variable " + var->name + " of type " + describeType(var->type) + " can't be in-scope const", "const variable with complex finalizer can't be deleted automatically", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::invalid_local_in_scope); return Visitor::visitLet(expr, var, last); } var->inScope = true; @@ -4991,18 +4999,18 @@ namespace das { finBlk->list.insert(finBlk->list.begin(), exprDel); } else { error("internal error. generator function " + func->name + " has finalize function which is not a block for type " + describeType(func->arguments[0]->type), "", "", - var->at, CompilationError::invalid_generator_finalizer); + var->at, CompilationError::internal_generator_finalizer); return Visitor::visitLet(expr, var, last); } } else { error("internal error. generator function " + func->name + " has multiple finalize functions for type " + describeType(func->arguments[0]->type), "", "", - var->at, CompilationError::invalid_generator_finalizer); + var->at, CompilationError::internal_generator_finalizer_multiple); return Visitor::visitLet(expr, var, last); } } else if (scopes.back()->isLambdaBlock) { var->inScope = false; error("internal error. in-scope variable in lambda gets converted as part of the lambda function", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::internal_lambda_in_scope_conversion); return Visitor::visitLet(expr, var, last); } else { scopes.back()->finalList.insert(scopes.back()->finalList.begin(), exprDel); @@ -5010,19 +5018,19 @@ namespace das { reportAstChanged(); } else { error("can't delete " + describeType(var->type), "", "", - var->at, CompilationError::bad_delete); + var->at, CompilationError::cant_delete_local); } } } else { if (strictSmartPointers && !var->generated && !safeExpression(expr) && var->type->needInScope()) { error("variable " + var->name + " of type " + describeType(var->type) + " requires var inscope to be safe", "", "", - var->at, CompilationError::invalid_variable_type); + var->at, CompilationError::unsafe_local_in_scope_required); } } if (noUnsafeUninitializedStructs && !var->init && var->type->unsafeInit()) { if (!safeExpression(expr)) { error("Uninitialized variable " + var->name + " is unsafe. Use initializer syntax or [safe_when_uninitialized] when intended.", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_local); } } } @@ -5060,10 +5068,10 @@ namespace das { auto varT = TypeDecl::inferGenericInitType(var->type, var->init->type); if (!varT || varT->isAlias()) { error("local variable " + var->name + " initialization type can't be inferred, " + describeType(var->type) + " = " + describeType(var->init->type), "", "", - var->at, CompilationError::cant_infer_mismatching_restrictions); + var->at, CompilationError::invalid_local_init_type); } else if (varT->isVoid()) { error("local variable " + var->name + " initialization can't be void, " + describeType(var->type), "", "", - var->at, CompilationError::cant_infer_mismatching_restrictions); + var->at, CompilationError::invalid_local_init_type); } else { varT->ref = false; TypeDecl::applyAutoContracts(varT, var->type); @@ -5080,34 +5088,34 @@ namespace das { "local variable " + var->name + " initialization type mismatch", CompilationError::invalid_initialization_type, var->at)) { } else if (var->type->ref && !var->init->type->isRef()) { error("local variable " + var->name + " initialization type mismatch. reference can't be initialized via value, " + describeType(var->type) + " = " + describeType(var->init->type), "", "", - var->at, CompilationError::invalid_initialization_type); + var->at, CompilationError::invalid_local_init_type); } else if (var->type->ref && !var->type->isConst() && var->init->type->isConst()) { error("local variable " + var->name + " initialization type mismatch. const matters, " + describeType(var->type) + " = " + describeType(var->init->type), "", "", - var->at, CompilationError::invalid_initialization_type); + var->at, CompilationError::invalid_local_init_type); } else if (!var->type->ref && var->type->isGoodBlockType()) { if (!var->init->rtti_isMakeBlock()) { error("local variable " + var->name + " can only be initialized with make block expression", "", "", - var->at, CompilationError::invalid_initialization_type); + var->at, CompilationError::invalid_local_init_block); } } else if (!var->type->ref && !var->init->type->canCopy() && !var->init->type->canMove() && var->type->hasNonTrivialCtor() && !var->isCtorInitialized()) { error("local variable " + var->name + " can only be initialized with type constructor", "", "", - var->at, CompilationError::invalid_initialization_type); + var->at, CompilationError::invalid_local_init_constructor); } else if (!var->type->ref && !var->init->type->canCopy() && !var->init->type->canMove() && var->type->hasNonTrivialCtor() && var->isCtorInitialized() && var->init_via_move) { error("local variable " + var->name + " can only be initialized with copy", "", "", - var->at, CompilationError::invalid_initialization_type); + var->at, CompilationError::invalid_local_init); } else if (!var->type->ref && !var->init->type->canCopy() && !var->init->type->canMove() && !var->type->hasNonTrivialCtor()) { error("local variable " + var->name + " can't be initialized at all", "", "", - var->at, CompilationError::invalid_initialization_type); + var->at, CompilationError::invalid_local_init); } else if (!var->type->ref && !var->init->type->canCopy() && var->init->type->canMove() && !(var->init_via_move || var->init_via_clone)) { error("local variable " + var->name + " can only be move-initialized", "", "use <- for that", - var->at, CompilationError::invalid_initialization_type); + var->at, CompilationError::invalid_local_init); if (canRelaxAssign(var->init)) { reportAstChanged(); var->init_via_move = true; } } else if (var->init_via_move && var->init->type->isConst()) { error("local variable " + var->name + " can't init (move) from a constant value. " + describeType(var->init->type), "", "", - var->at, CompilationError::cant_move); + var->at, CompilationError::cant_local); } else if (var->init_via_clone && !var->init->type->canClone()) { auto varType = new TypeDecl(*var->type); varType->ref = true; @@ -5140,7 +5148,7 @@ namespace das { } for (auto &var : expr->variables) { if (var->type->isAutoOrAlias()) { - error("type not ready yet", "", "", var->at); + error("type not ready yet", "", "", var->at, CompilationError::not_resolved_yet_local_type); return Visitor::visit(expr); } } @@ -5171,7 +5179,7 @@ namespace das { for (auto &var : expr->variables) { if (!var->type->isTuple()) { error("expansion of " + var->name + " should be tuple", "", "", - var->at, CompilationError::invalid_type); + var->at, CompilationError::invalid_local_tuple_expansion); } expandTupleName(var->name, var->at); } @@ -5193,14 +5201,14 @@ namespace das { } if (errc == program->errors.size()) { // this fail safe adds error if macro failed, but did not report any errors error("call macro '" + expr->macro->name + "' failed to compile", "possibly missing require", "", - expr->at, CompilationError::unsupported_call_macro); + expr->at, CompilationError::runtime_call_macro); } return Visitor::visit(expr); } bool InferTypes::canVisitLooksLikeCall(ExprLooksLikeCall *call) { if ( callDepth >= program->policies.max_call_depth ) { error("call expression depth exceeded maximum allowed (" + to_string(program->policies.max_call_depth) + ")", "", "", - call->at, CompilationError::too_many_infer_passes); + call->at, CompilationError::exceeds_call_depth); return false; } return true; @@ -5211,7 +5219,7 @@ namespace das { call->argumentsFailedToInfer = false; if (call->arguments.size() > DAS_MAX_FUNCTION_ARGUMENTS) { error("too many arguments in " + call->name + ", max allowed is DAS_MAX_FUNCTION_ARGUMENTS=" DAS_STR(DAS_MAX_FUNCTION_ARGUMENTS), "", "", - call->at, CompilationError::too_many_arguments); + call->at, CompilationError::exceeds_function_argument); } } ExpressionPtr InferTypes::visit(ExprLooksLikeCall *call) { @@ -5229,7 +5237,7 @@ namespace das { bool InferTypes::canVisitNamedCall(ExprNamedCall *call) { if ( callDepth >= program->policies.max_call_depth ) { error("call expression depth exceeded maximum allowed (" + to_string(program->policies.max_call_depth) + ")", "", "", - call->at, CompilationError::too_many_infer_passes); + call->at, CompilationError::exceeds_call_depth); return false; } return true; @@ -5240,7 +5248,7 @@ namespace das { call->argumentsFailedToInfer = false; if (((call->arguments ? call->arguments->size() : 0) > DAS_MAX_FUNCTION_ARGUMENTS) || (call->nonNamedArguments.size() > DAS_MAX_FUNCTION_ARGUMENTS)) { error("too many arguments in " + call->name + ", max allowed is DAS_MAX_FUNCTION_ARGUMENTS=" DAS_STR(DAS_MAX_FUNCTION_ARGUMENTS), "", "", - call->at, CompilationError::too_many_arguments); + call->at, CompilationError::exceeds_function_argument); } } MakeFieldDeclPtr InferTypes::visitNamedCallArg(ExprNamedCall *call, MakeFieldDecl *arg, bool last) { @@ -5262,7 +5270,7 @@ namespace das { vector nonNamedTypes; if (!inferArguments(nonNamedTypes, expr->nonNamedArguments)) { error("can't infer type of non-named argument in call to " + expr->name, "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::not_resolved_yet_argument_type); return Visitor::visit(expr); } MatchingFunctions functions, generics; @@ -5350,7 +5358,7 @@ namespace das { } } if ( inArgumentInit && func==fun ) { - error("recursive call to " + func->name + " in argument initializer is not allowed", "", "",expr->at); + error("recursive call to " + func->name + " in argument initializer is not allowed", "", "",expr->at, CompilationError::recursion_function_argument); return Visitor::visit(expr); } reportAstChanged(); @@ -5361,7 +5369,7 @@ namespace das { bool InferTypes::canVisitCall(ExprCall *call) { if ( callDepth >= program->policies.max_call_depth ) { error("call expression depth exceeded maximum allowed (" + to_string(program->policies.max_call_depth) + ")", "", "", - call->at, CompilationError::too_many_infer_passes); + call->at, CompilationError::exceeds_call_depth); return false; } return true; @@ -5372,12 +5380,12 @@ namespace das { call->argumentsFailedToInfer = false; if (call->arguments.size() > DAS_MAX_FUNCTION_ARGUMENTS) { error("too many arguments in " + call->name + ", max allowed is DAS_MAX_FUNCTION_ARGUMENTS=" DAS_STR(DAS_MAX_FUNCTION_ARGUMENTS), "", "", - call->at, CompilationError::too_many_arguments); + call->at, CompilationError::exceeds_function_argument); } if (call->func && call->func->nodiscard && !call->notDiscarded && !safeExpression(call)) { error("call to " + call->name + " result is discarded, which is unsafe", "use let _ = " + call->name + "(...)", "", - call->at, CompilationError::result_discarded); + call->at, CompilationError::invalid_function_result_discarded); } // super() constructor rewrite is done in visit(ExprCall*), once argument types are inferred } @@ -5433,17 +5441,17 @@ namespace das { } else if (matching.size() > 1) { error("too many candidates for super constructor " + candidateName, verbose ? program->describeCandidates(matching) : "", "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::ambiguous_super_constructor); return Visitor::visit(expr); } baseClass = baseClass->parent; } error("call to super in " + func->name + ": no matching super constructor for " + func->classParent->name, "", "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::lookup_super_constructor); return Visitor::visit(expr); } else { error("call to super in " + func->name + " is not allowed, no base class for " + func->classParent->name, "", "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::invalid_super_call); return Visitor::visit(expr); } } @@ -5465,7 +5473,7 @@ namespace das { if (expr->aliasSubstitution) { if (expr->arguments.size() != 1) { error("casting to bitfield requires one argument", "", "", - expr->at, CompilationError::invalid_cast); + expr->at, CompilationError::invalid_bitfield_cast_argument_count); return Visitor::visit(expr); } auto ecast = new ExprCast(expr->at, expr->clone(), new TypeDecl(*expr->aliasSubstitution)); @@ -5600,13 +5608,13 @@ namespace das { */ if (expr->func && expr->func->unsafeOperation && !safeExpression(expr)) { error("unsafe call '" + expr->name + "' must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_function_call); } else if (expr->func && expr->func->unsafeOutsideOfFor && !(expr->isForLoopSource || safeExpression(expr))) { error("'" + expr->name + "' is unsafe, when not source of the for-loop; must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_function_call); } else if (expr->func && expr->func->unsafeWhenNotCloneArray && !(safeExpression(expr) || isCloneArrayExpression(expr))) { error("'" + expr->name + "' is unsafe, when not clone array; must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_function_call); } else if (enableInferTimeFolding && expr->func && isConstExprFunc(expr->func)) { vector cargs; cargs.reserve(expr->arguments.size()); @@ -5638,7 +5646,7 @@ namespace das { auto fexpr = fnAnn->transformCall(expr, err); if (!err.empty()) { error("call annotated by '" + fnAnn->name + "' failed to transform, " + err, "", "", - expr->at, CompilationError::annotation_failed); + expr->at, CompilationError::runtime_annotation_transform); } else if (fexpr) { reportAstChanged(); return fexpr; @@ -5650,7 +5658,7 @@ namespace das { if (expr->func->name == expr->func->result->structType->name) { if (!safeExpression(expr)) { error("Constructing class on stack is unsafe. Allocate it on the heap via 'new [[...]]' or 'new " + expr->func->name + "()' instead.", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_class_stack_construction); } } } @@ -5661,10 +5669,10 @@ namespace das { if (expr->type) { if (expr->type->isVoid()) { error("argument of format string should not be `void`", "", "", - expr->at, CompilationError::expecting_return_value); + expr->at, CompilationError::invalid_string_builder_argument); } else if (expr->type->isAutoOrAlias()) { error("argument of format string can't be `auto` or alias", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_string_builder_argument); } } if (expr->constexpression) { @@ -5699,7 +5707,7 @@ namespace das { for (const auto &pm : mod->macros) { bool anyWork = pm->apply(this, thisModule.get()); if (failed()) { // if macro failed, we report it, and we are done - error("macro '" + mod->name + "::" + pm->name + "' failed", "", "", LineInfo()); + error("macro '" + mod->name + "::" + pm->name + "' failed", "", "", LineInfo(), CompilationError::runtime_macro); return false; } if (anyWork) { // if macro did anything, we done @@ -5707,7 +5715,7 @@ namespace das { inferTypesDirty(logs, true); reportingInferErrors = false; if (failed()) { // if it failed to infer types after, we report it - error("macro '" + mod->name + "::" + pm->name + "' failed to infer", "", "", LineInfo()); + error("macro '" + mod->name + "::" + pm->name + "' failed to infer", "", "", LineInfo(), CompilationError::runtime_macro_infer); anyMacrosFailedToInfer = true; return false; } @@ -5729,7 +5737,7 @@ namespace das { inferTypesDirty(logs, true); reportingInferErrors = false; if (failed()) { - error("internal compiler error: variable relocation infer to fail", "", "", LineInfo()); + error("internal compiler error: variable relocation infer to fail", "", "", LineInfo(), CompilationError::internal_relocate_infer); } continue; } @@ -5740,7 +5748,7 @@ namespace das { inferTypesDirty(logs, true); reportingInferErrors = false; if (failed()) { - error("internal compiler error: pod analysis infer to fail", "", "", LineInfo()); + error("internal compiler error: pod analysis infer to fail", "", "", LineInfo(), CompilationError::internal_pod_analysis_infer); } continue; } @@ -5755,7 +5763,7 @@ namespace das { error("type inference exceeded maximum allowed number of passes (" + to_string(maxInferPasses) + ")\n" "this is likely due to a macro continuously being applied", "", "", - LineInfo(), CompilationError::too_many_infer_passes); + LineInfo(), CompilationError::exceeds_infer_passes); } } @@ -5788,7 +5796,7 @@ namespace das { } }); for (auto rfn : refreshFunctions) { if (!thisModule->functions.refresh_key(get<1>(rfn), get<2>(rfn))) { - error("internal compiler error: failed to refresh '" + get<0>(rfn)->getMangledName() + "'", "", "", get<0>(rfn)->at); + error("internal compiler error: failed to refresh '" + get<0>(rfn)->getMangledName() + "'", "", "", get<0>(rfn)->at, CompilationError::internal_function_refresh); goto failedIt; } } @@ -5822,7 +5830,7 @@ namespace das { error("type inference exceeded maximum allowed number of passes (" + to_string(maxInferPasses) + ")\n" "this is likely due to a loop in the type system", "", "", - LineInfo(), CompilationError::too_many_infer_passes); + LineInfo(), CompilationError::exceeds_infer_passes); } } } diff --git a/src/ast/ast_infer_type_function.cpp b/src/ast/ast_infer_type_function.cpp index db34c80dce..2986bbb75e 100644 --- a/src/ast/ast_infer_type_function.cpp +++ b/src/ast/ast_infer_type_function.cpp @@ -605,20 +605,20 @@ namespace das { if (verbose) { string candidates = program->describeCandidates(fnList); error("both generated and custom '" + fnList.front()->name + "' functions exist for " + describeFunction(fnList.front()), candidates, "", - at, CompilationError::function_not_found); + at, CompilationError::ambiguous_function); } else { error("both generated and custom '" + fnList.front()->name + "' functions exist", "", "", - at, CompilationError::function_not_found); + at, CompilationError::ambiguous_function); } return false; } else if (customCount > 1) { if (verbose) { string candidates = program->describeCandidates(fnList); error("too many custom '" + fnList.front()->name + "' functions exist for " + describeFunction(fnList.front()), candidates, "", - at, CompilationError::function_not_found); + at, CompilationError::ambiguous_function); } else { error("too many custom '" + fnList.front()->name + "' functions exist", "", "", - at, CompilationError::function_not_found); + at, CompilationError::ambiguous_function); } return false; } else { @@ -1061,7 +1061,7 @@ namespace das { return false; } if(ar->type->baseType==Type::tVoid) { - error("void type is not allowed as argument", "", "", ar->at); + error("void type is not allowed as argument", "", "", ar->at, CompilationError::invalid_argument_type); return false; } DAS_ASSERT(!ar->type->isExprType() && "if this happens, we are calling infer function call without checking for '[expr]'. do that from where we call up the stack."); @@ -1086,7 +1086,7 @@ namespace das { FunctionPtr InferTypes::inferFunctionCall(ExprLooksLikeCall *expr, InferCallError cerr, Function *lookupFunction, bool failOnMissingCtor, bool visCheck) { if ( inferDepth > 1 ) { error("infer expression depth exceeded maximum allowed", "", "", - expr->at, CompilationError::too_many_infer_passes); + expr->at, CompilationError::exceeds_expression_recursion); return nullptr; } InferDepthGuard guard(&inferDepth); @@ -1106,17 +1106,17 @@ namespace das { if (functions.size() == 1) { auto funcC = functions.back(); if ( inArgumentInit && funcC==func ) { - error("recursive call in argument initializer is not allowed", "", "", expr->at); + error("recursive call in argument initializer is not allowed", "", "", expr->at, CompilationError::recursion_argument); return nullptr; } if (funcC->result->baseType == Type::autoinfer) { if ( cerr != InferCallError::tryOperator ) { - error("cannot infer type for function call '" + expr->name + "' with 'auto' return type", "", "", expr->at, CompilationError::invalid_type); + error("cannot infer type for function call '" + expr->name + "' with 'auto' return type", "", "", expr->at, CompilationError::invalid_function_result); return nullptr; } } if ( find(inInfer.begin(), inInfer.end(), funcC) != inInfer.end() ) { - error("recursive call in function is not allowed", "", "", expr->at); + error("recursive call in function is not allowed", "", "", expr->at, CompilationError::recursion_function); return nullptr; } if (funcC->firstArgReturnType) { @@ -1135,7 +1135,7 @@ namespace das { auto block = static_cast(mkBlock->block); auto retT = TypeDecl::inferGenericType(mkBlock->type, funcC->arguments[iF]->type, true, true, nullptr); if ( !retT ) { - error("default arguments don't match the function signature of '" + funcC->name + "'", "", "", expr->at, CompilationError::invalid_type); + error("default arguments don't match the function signature of '" + funcC->name + "'", "", "", expr->at, CompilationError::mismatching_function_argument); return nullptr; } TypeDecl::applyAutoContracts(mkBlock->type, funcC->arguments[iF]->type); @@ -1150,7 +1150,7 @@ namespace das { if (arg->rtti_isMakeStruct()) { // its always MakeStruct auto mkStruct = static_cast(arg); if (mkStruct->structs.size()) { - error("internal compiler error: array type not under default> or default>", "", "", expr->at); + error("internal compiler error: array type not under default> or default>", "", "", expr->at, CompilationError::internal_array_type); return nullptr; } auto retT = TypeDecl::inferGenericType(mkStruct->type, funcC->arguments[iF]->type, true, true, nullptr); @@ -1159,7 +1159,7 @@ namespace das { mkStruct->makeType = retT; reportAstChanged(); } else { - error("internal compiler error: unknown array type not under make strcut", "", "", expr->at); + error("internal compiler error: unknown array type not under make struct", "", "", expr->at, CompilationError::internal_array_type); return nullptr; } } @@ -1209,7 +1209,7 @@ namespace das { << (instFn->module->name.empty() ? "this module" : ("'" + instFn->module->name + "'")) << "\n"; } - error("internal compiler error: multiple instances of '" + genName + "'", ss.str(), "", expr->at); + error("internal compiler error: multiple instances of '" + genName + "'", ss.str(), "", expr->at, CompilationError::internal_function); } else if (instancedFunctions.size() == 1) { expr->name = callCloneName(genName); reportAstChanged(); @@ -1302,7 +1302,7 @@ namespace das { } error("unknown type of argument " + clone->arguments[ai]->name + "; can't instance " + describeFunction(oneGeneric), "", "provide argument type explicitly", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::lookup_argument_type); return nullptr; } } @@ -1349,7 +1349,7 @@ namespace das { if (exf->fromGeneric != clone->fromGeneric) { // TODO: getOrigin?? error("can't instance generic " + describeFunction(clone), +"\ttrying to instance from module " + clone->fromGeneric->module->name + "\n" + "\texisting instance from module " + exf->fromGeneric->module->name, "", - expr->at, CompilationError::function_already_declared); + expr->at, CompilationError::already_declared_function); return nullptr; } } else { @@ -1360,7 +1360,7 @@ namespace das { string err; if (!ann->generic_apply(clone, *(program->thisModuleGroup), pA->arguments, err)) { error("Macro [" + pA->annotation->name + "] failed to generic_apply to a function " + clone->name + "\n", - err, "", clone->at, CompilationError::invalid_annotation); + err, "", clone->at, CompilationError::invalid_annotation_macro); return nullptr; } } @@ -1389,16 +1389,16 @@ namespace das { bool isPrivate = aliasT->structType->privateStructure; if (isPrivate && aliasT->structType->module != thisModule) { error("can't access private structure " + aliasT->structType->name, "", "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::cant_access_private_structure); } else { // if ( !tryMakeStructureCtor (aliasT->structType, true, true) ) { if (failOnMissingCtor) { error("default constructor " + aliasT->structType->name + " is not visible directly", - "try default<" + expr->name + "> instead", "", expr->at, CompilationError::function_not_found); + "try default<" + expr->name + "> instead", "", expr->at, CompilationError::lookup_function); } } } else { error("can only generate default structure constructor without arguments", - "", "", expr->at, CompilationError::invalid_argument_count); + "", "", expr->at, CompilationError::invalid_function_argument_count); } } else { if (cerr == InferCallError::operatorOp2) { diff --git a/src/ast/ast_infer_type_helper.cpp b/src/ast/ast_infer_type_helper.cpp index 74d0ceb6b9..4a27cc0872 100644 --- a/src/ast/ast_infer_type_helper.cpp +++ b/src/ast/ast_infer_type_helper.cpp @@ -92,7 +92,7 @@ namespace das { size *= di; if (size > 0x7fffffff) { error("array is too big: '" + describeType(decl) + "'", "", "", - decl->at, CompilationError::invalid_array_dimension); + decl->at, CompilationError::exceeds_array); break; } } @@ -110,7 +110,7 @@ namespace das { if (decl->baseType == Type::tVoid) { if (decl->dim.size()) { error("can't declare an array of void: '" + describeType(decl) + "'", "", "", - decl->at, CompilationError::invalid_type); + decl->at, CompilationError::invalid_array); } if (decl->ref) { error("can't declare a void reference: '" + describeType(decl) + "'", "", "", @@ -128,7 +128,7 @@ namespace das { ptrType->at, CompilationError::invalid_type); } else if (!ptrType->annotation->isSmart()) { error("this annotation does not support smart pointers: '" + describeType(decl) + "'", "", "", - ptrType->at, CompilationError::invalid_type); + ptrType->at, CompilationError::invalid_annotation_type); } } verifyType(ptrType); @@ -146,19 +146,19 @@ namespace das { if (auto arrayType = decl->firstType) { if (arrayType->isAutoOrAlias()) { error("array type is not fully resolved: '" + describeType(arrayType) + "'", "", "", - arrayType->at, CompilationError::invalid_array_type); + arrayType->at, CompilationError::not_resolved_yet_array_type); } if (arrayType->ref) { error("can't declare an array of references: '" + describeType(arrayType) + "'", "", "", - arrayType->at, CompilationError::invalid_array_type); + arrayType->at, CompilationError::invalid_array); } if (arrayType->baseType == Type::tVoid) { error("can't declare a void array: '" + describeType(arrayType) + "'", "", "", - arrayType->at, CompilationError::invalid_array_type); + arrayType->at, CompilationError::invalid_array); } if (!arrayType->canBePlacedInContainer()) { error("can't have array of non-trivial type: '" + describeType(arrayType) + "'", "", "", - arrayType->at, CompilationError::invalid_type); + arrayType->at, CompilationError::invalid_array_type); } verifyType(arrayType); } @@ -166,14 +166,14 @@ namespace das { if (auto keyType = decl->firstType) { if (keyType->isAutoOrAlias()) { error("table key is not fully resolved: '" + describeType(keyType) + "'", "", "", - keyType->at, CompilationError::invalid_array_type); + keyType->at, CompilationError::not_resolved_yet_table_type); } if (keyType->ref) { error("table key can't be declared as a reference: '" + describeType(keyType) + "'", "", "", - keyType->at, CompilationError::invalid_table_type); + keyType->at, CompilationError::invalid_table); } if (!(keyType->isWorkhorseType() || (keyType->baseType == Type::tHandle && !keyType->annotation->isRefType()))) { - error("table key has to be declare as a basic 'hashable' type: '" + describeType(keyType) + "'", "", "", + error("table key has to be declared as a basic 'hashable' type: '" + describeType(keyType) + "'", "", "", keyType->at, CompilationError::invalid_table_type); } verifyType(keyType); @@ -181,15 +181,15 @@ namespace das { if (auto valueType = decl->secondType) { if (valueType->isAutoOrAlias()) { error("table value is not fully resolved: '" + describeType(valueType) + "'", "", "", - valueType->at, CompilationError::invalid_array_type); + valueType->at, CompilationError::not_resolved_yet_table_type); } if (valueType->ref) { error("table value can't be declared as a reference: '" + describeType(valueType) + "'", "", "", - valueType->at, CompilationError::invalid_table_type); + valueType->at, CompilationError::invalid_table); } if (!valueType->canBePlacedInContainer()) { error("can't have table value of non-trivial type: '" + describeType(valueType) + "'", "", "", - valueType->at, CompilationError::invalid_type); + valueType->at, CompilationError::invalid_table_type); } verifyType(valueType); } @@ -197,7 +197,7 @@ namespace das { if (auto resultType = decl->firstType) { if (!resultType->isReturnType()) { error("not a valid return type: '" + describeType(resultType) + "'", "", "", - resultType->at, CompilationError::invalid_return_type); + resultType->at, CompilationError::invalid_result_type); } verifyType(resultType); } @@ -212,15 +212,15 @@ namespace das { for (auto &argType : decl->argTypes) { if (argType->ref) { error("tuple element can't be a reference: '" + describeType(argType) + "'", "", "", - argType->at, CompilationError::invalid_type); + argType->at, CompilationError::invalid_tuple); } if (argType->isVoid()) { error("tuple element can't be void", "", "", - argType->at, CompilationError::invalid_type); + argType->at, CompilationError::invalid_tuple); } if (!argType->canBePlacedInContainer()) { error("invalid tuple element type: '" + describeType(argType) + "'", "", "", - argType->at, CompilationError::invalid_type); + argType->at, CompilationError::invalid_tuple_type); } verifyType(argType); } @@ -228,15 +228,15 @@ namespace das { for (auto &argType : decl->argTypes) { if (argType->ref) { error("variant element can't be a reference: '" + describeType(argType) + "'", "", "", - argType->at, CompilationError::invalid_type); + argType->at, CompilationError::invalid_variant); } if (argType->isVoid()) { error("variant element can't be void", "", "", - argType->at, CompilationError::invalid_type); + argType->at, CompilationError::invalid_variant); } if (!argType->canBePlacedInContainer()) { error("invalid variant element type: '" + describeType(argType) + "'", "", "", - argType->at, CompilationError::invalid_type); + argType->at, CompilationError::invalid_variant_type); } verifyType(argType); } @@ -651,7 +651,7 @@ namespace das { } } else { error("array dimension must be int32 or uint32", "", "", - type->at, CompilationError::invalid_array_dimension); + type->at, CompilationError::invalid_array_dimension_type); } } else { error("array dimension must be constant", "", "", @@ -666,7 +666,7 @@ namespace das { } else if (type->baseType == Type::typeDecl) { if (type->dimExpr.size() != 1) { error("typeDecl must have exactly one dimension", "", "", - type->at, CompilationError::invalid_type); + type->at, CompilationError::invalid_type_dimension); } else if (type->dimExpr[0]->type) { if (!type->dimExpr[0]->type->isAutoOrAlias()) { auto resType = new TypeDecl(*type->dimExpr[0]->type); @@ -676,26 +676,26 @@ namespace das { return true; } else { error("can't deduce typeDecl type", "", "", - type->at, CompilationError::invalid_type); + type->at, CompilationError::not_resolved_yet_type); } } else { error("can't deduce type", "", "", - type->at, CompilationError::invalid_type); + type->at, CompilationError::not_resolved_yet_type); } } else if (type->baseType == Type::typeMacro) { auto tmn = type->typeMacroName(); auto tms = findTypeMacro(tmn); if (tms.size() == 0) { error("can't find typeMacro " + tmn, "", "", - type->at, CompilationError::invalid_type); + type->at, CompilationError::lookup_macro); } else if (tms.size() > 1) { error("too many typeMacro " + tmn + " found", "", "", - type->at, CompilationError::invalid_type); + type->at, CompilationError::ambiguous_macro); } else { auto resType = tms[0]->visit(program, thisModule, type, nullptr); if (!resType) { error("can't deduce typeMacro " + tmn, "", "", - type->at, CompilationError::invalid_type); + type->at, CompilationError::invalid_macro_type); } else { TypeDecl::applyAutoContracts(resType, type); type = resType; @@ -768,11 +768,11 @@ namespace das { return exprType; } else { error("incompatible cast, can't cast " + seT->structType->name + " to " + cT->structType->name, "", "", - at, CompilationError::invalid_cast); + at, CompilationError::invalid_cast_structure); } } else { error("invalid cast, expecting structure", "", "", - at, CompilationError::invalid_cast); + at, CompilationError::invalid_cast_structure); } } else if (seT->isPointer() && seT->firstType && seT->firstType->isStructure()) { if (cT->isPointer() && cT->firstType->isStructure()) { @@ -789,11 +789,11 @@ namespace das { return exprType; } else { error("incompatible cast, can't cast '" + seT->firstType->structType->name + "?' to '" + cT->firstType->structType->name + "?'", "", "", - at, CompilationError::invalid_cast); + at, CompilationError::invalid_cast_structure_pointer); } } else { error("invalid cast, expecting structure pointer", "", "", - at, CompilationError::invalid_cast); + at, CompilationError::invalid_cast_structure_pointer); } } return nullptr; @@ -803,7 +803,7 @@ namespace das { auto cTF = castType; if (seTF->argTypes.size() != cTF->argTypes.size()) { error("invalid cast, number of arguments does not match", "", "", - at, CompilationError::invalid_cast); + at, CompilationError::mismatching_function_argument_count); return nullptr; } // result @@ -840,7 +840,7 @@ namespace das { return funT; } else { error("incompatible cast, can't cast " + describeType(funT) + " to " + describeType(castType), "", "", - at, CompilationError::invalid_cast); + at, CompilationError::invalid_cast_function); return nullptr; } } @@ -870,7 +870,7 @@ namespace das { block->moveOnReturn = true; } else { error("this type can't be returned at all: '" + describeType(block->returnType) + "'", "", "", - block->at, CompilationError::invalid_return_type); + block->at, CompilationError::invalid_result_type); } } else { block->copyOnReturn = false; @@ -890,7 +890,7 @@ namespace das { } if (!canLookup) { error("can't access private field '" + expr->name + "' of " + describeType(expr->value->type) + " outside of member functions.", "", "", - expr->at, CompilationError::cant_get_field); + expr->at, CompilationError::cant_access_private_field); return false; } } @@ -957,22 +957,22 @@ namespace das { bool InferTypes::inferReturnType(TypeDeclPtr &resType, ExprReturn *expr) { if (expr->subexpr && expr->subexpr->type && expr->subexpr->type->isVoid()) { error("returning void value", "", "", - expr->at, CompilationError::invalid_return_type); + expr->at, CompilationError::invalid_result); return false; } if (resType->isAuto()) { if (expr->subexpr) { if (!expr->subexpr->type) { - error("subexpresion type is not resolved yet", "", "", expr->at); + error("subexpression type is not resolved yet", "", "", expr->at, CompilationError::not_resolved_yet_expression_type); return false; } else if (expr->subexpr->type->isAutoOrAlias()) { - error("subexpresion type is not fully resolved yet", "", "", expr->at); + error("subexpression type is not fully resolved yet", "", "", expr->at, CompilationError::not_resolved_yet_expression_type); return true; } auto resT = TypeDecl::inferGenericType(resType, expr->subexpr->type, false, false, nullptr); if (!resT) { error("type can't be inferred, " + describeType(resType) + ", returns " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::cant_infer_mismatching_restrictions); + expr->at, CompilationError::mismatching_result_type); } else { resT->ref = false; TypeDecl::applyAutoContracts(resT, resType); @@ -993,35 +993,35 @@ namespace das { if (resType->isVoid()) { if (expr->subexpr) { error("not expecting a return value", "", "", - expr->at, CompilationError::not_expecting_return_value); + expr->at, CompilationError::not_expecting_result); } } else { if (!expr->subexpr) { error("expecting a return value", "", "", - expr->at, CompilationError::expecting_return_value); + expr->at, CompilationError::missing_result); } else { if (!canCopyOrMoveType(resType, expr->subexpr->type, TemporaryMatters::yes, expr->subexpr, "incompatible return type", CompilationError::invalid_return_type, expr->at)) { } if (resType->ref && !expr->subexpr->type->isRef()) { error("incompatible return type, reference matters. expecting " + describeType(resType) + ", passing " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::invalid_return_type); + expr->at, CompilationError::invalid_result_type); } if (resType->isRef() && !resType->isConst() && expr->subexpr->type->isConst() && expr->moveSemantics) { error("incompatible return type, constant matters. expecting " + describeType(resType) + ", passing " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::invalid_return_type); + expr->at, CompilationError::invalid_result_type); } } } if (resType->isRefType()) { if (!resType->canCopy() && !resType->canMove()) { error("this type can't be returned at all " + describeType(resType), "", "", - expr->at, CompilationError::invalid_return_type); + expr->at, CompilationError::invalid_result_type); } } if (expr->moveSemantics && expr->subexpr->type->isConst()) { error("can't return via move from a constant value", "", "", - expr->at, CompilationError::cant_move); + expr->at, CompilationError::cant_result); } return false; } diff --git a/src/ast/ast_infer_type_make.cpp b/src/ast/ast_infer_type_make.cpp index faed1768e3..7836085ff7 100644 --- a/src/ast/ast_infer_type_make.cpp +++ b/src/ast/ast_infer_type_make.cpp @@ -30,38 +30,38 @@ namespace das { reportAstChanged(); } else { error("undefined generator type " + describeType(expr->iterType), - reportInferAliasErrors(expr->iterType), "", expr->at, CompilationError::type_not_found); + reportInferAliasErrors(expr->iterType), "", expr->at, CompilationError::lookup_generator_type); return Visitor::visit(expr); } } if (expr->iterType->isAuto()) { error("generator of undefined type " + describeType(expr->iterType), "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::lookup_generator_type); return Visitor::visit(expr); } else if (expr->iterType->isVoid()) { error("generator can't be void (yet)", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::invalid_generator); return Visitor::visit(expr); } if (expr->arguments.size() != 1) { error("generator can only have one argument", "", "", - expr->at, CompilationError::invalid_argument_count); + expr->at, CompilationError::invalid_generator_argument_count); } else if (!expr->arguments[0]->rtti_isMakeBlock()) { error("expecting generator(closure), got " + string(expr->arguments[0]->__rtti) + " instead", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_generator_argument_type); } else { auto mkBlock = static_cast(expr->arguments[0]); auto block = static_cast(mkBlock->block); if (auto bT = block->makeBlockType()) { if (bT->isAutoOrAlias()) { error("can't infer generator block type", "", "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::not_resolved_yet_generator_block); } else if (!bT->firstType->isSimpleType(Type::tBool)) { error("generator must return boolean", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_generator_result_type); } else if (!bT->argTypes.empty()) { error("generator must have no arguments", "", "", - expr->at, CompilationError::invalid_argument_type); + expr->at, CompilationError::invalid_generator_argument_count); } else { // TODO: check validity of the generator type CaptureLambda cl(func && func->isClassMethod); @@ -134,15 +134,15 @@ namespace das { return cEach; } else { error("generator finalizer name mismatch", "", "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::internal_generator_finalizer_name); } } else { error("generator function name mismatch", "", "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::internal_generator_function_name); } } else { error("generator struct name mismatch " + ls->name, "", "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::internal_generator_structure_name); } } // in case of error @@ -166,45 +166,45 @@ namespace das { if (cV->capture_as_ref) { // this is ok by default } else if (!cV->type->canCopy() && !cV->type->canMove()) { - error("can't captured variable " + cV->name, "it can't be copied or moved", "", - at, CompilationError::invalid_capture); + error("can't capture variable " + cV->name, "it can't be copied or moved", "", + at, CompilationError::invalid_capture_variable); return false; } else if (!cV->type->canCopy() && isUnsafe) { error("implicit capture by move requires unsafe, while capturing " + cV->name, "", "", - at, CompilationError::invalid_capture); + at, CompilationError::unsafe_capture_variable); return false; } else if (!cV->type->canCopy() && cV->type->isConst()) { error("can't implicitly capture constant variable " + cV->name + " by move", "", "", - at, CompilationError::invalid_capture); + at, CompilationError::cant_capture_variable); return false; } } else if (mode == CaptureMode::capture_by_reference) { if (!cV->capture_as_ref && isUnsafe) { error("capture by reference requires unsafe, while capturing " + cV->name, "", "", - at, CompilationError::invalid_capture); + at, CompilationError::unsafe_capture_variable); return false; } } else if (mode == CaptureMode::capture_by_move) { if (!cV->type->canMove()) { error("can't move captured variable " + cV->name, "", "", - at, CompilationError::invalid_capture); + at, CompilationError::cant_capture_variable); return false; } else if (cV->type->isConst()) { error("can't capture constant variable " + cV->name + " by move", "", "", - at, CompilationError::invalid_capture); + at, CompilationError::cant_capture_variable); return false; } } else if (mode == CaptureMode::capture_by_copy) { if (!cV->type->canCopy()) { error("can't copy captured variable " + cV->name, "", "", - at, CompilationError::invalid_capture); + at, CompilationError::cant_capture_variable); return false; } } if (cV->no_capture) { error("can't capture variable " + cV->name, cV->name == "self" ? "can't capture `self` in the class initializer" : "it is marked as no_capture", - "", at, CompilationError::invalid_capture); + "", at, CompilationError::cant_capture_variable); return false; } } @@ -215,7 +215,7 @@ namespace das { if (auto bT = block->makeBlockType()) { if (bT->isAutoOrAlias()) { error("can't infer lambda block type", "", "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::not_resolved_yet_lambda_block); } else { CaptureLambda cl(func && func->isClassMethod); // we can only capture in-scope variables @@ -258,15 +258,15 @@ namespace das { return ms; } else { error("lambda finalizer name mismatch", "", "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::internal_lambda_finalizer_name); } } else { error("lambda function name mismatch", "", "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::internal_lambda_function_name); } } else { error("lambda struct name mismatch", "", "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::internal_lambda_structure_name); } } } @@ -279,7 +279,7 @@ namespace das { if (auto bT = block->makeBlockType()) { if (bT->isAutoOrAlias()) { error("can't infer local function block type", "", "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::not_resolved_yet_function_block); } else { string lname = generateNewLocalFunctionName(block->at); auto pFn = generateLocalFunction(lname, block); @@ -293,7 +293,7 @@ namespace das { return new ExprAddr(expr->at, "_::" + lname + "`function"); } else { error("local function name mismatch", "", "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::internal_function_name); } } } @@ -320,7 +320,7 @@ namespace das { if (verbose) tt << unInferred->at.describe() << ": " << unInferred->describe() << " is not fully inferred yet"; error("block is not fully inferred yet", tt.str(), "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::not_resolved_yet_block); } } else { if (auto btl = convertBlockToLambda(expr)) { @@ -338,7 +338,7 @@ namespace das { if (verbose) tt << unInferred->at.describe() << ": " << unInferred->describe() << " is not fully inferred yet"; error("block is not fully inferred yet", tt.str(), "", - expr->at, CompilationError::invalid_block); + expr->at, CompilationError::not_resolved_yet_block); } } else { if (auto btl = convertBlockToLocalFunction(expr)) { @@ -357,19 +357,19 @@ namespace das { verifyType(expr->makeType); if (expr->makeType->baseType != Type::tVariant) { error("[[variant" + describeType(expr->makeType) + "]] with non-variant type", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_variant_type); } if (expr->makeType->dim.size() > 1) { error("[[" + describeType(expr->makeType) + "]] variant can only initialize single dimension arrays", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_variant_array); } else if (expr->makeType->dim.size() == 1 && expr->makeType->dim[0] != int32_t(expr->variants.size())) { error("[[" + describeType(expr->makeType) + "]] variant dimension mismatch, provided " + to_string(expr->variants.size()) + " elements, expecting " + to_string(expr->makeType->dim[0]), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::mismatching_variant_dimension); } else if (expr->makeType->ref) { error("[[" + describeType(expr->makeType) + "]] variant can't be reference", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_variant); } } MakeFieldDeclPtr InferTypes::visitMakeVariantField(ExprMakeVariant *expr, int index, MakeFieldDecl *decl, bool last) { @@ -383,22 +383,22 @@ namespace das { "can't initialize field " + decl->name, CompilationError::cant_copy, decl->value->at)) { } else if (decl->value->type->isTemp(true, false)) { error("can't initialize variant field " + decl->name + " with temporary value", "", "", - decl->value->at, CompilationError::cant_pass_temporary); + decl->value->at, CompilationError::cant_initialize_variant_field); } if (!fieldType->canCopy() && !decl->moveSemantics) { error("field " + decl->name + " can't be copied; " + describeType(fieldType), "", "use <- instead", - decl->at, CompilationError::invalid_type); + decl->at, CompilationError::cant_variant_field); if (canRelaxAssign(decl->value)) { reportAstChanged(); decl->moveSemantics = true; } } else if (decl->moveSemantics && decl->value->type->isConst()) { error("can't move from a constant value " + describeType(decl->value->type), "", "", - decl->value->at, CompilationError::cant_move); + decl->value->at, CompilationError::cant_variant_field); } } else { error("field not found: '" + decl->name + "'", "", "", - decl->at, CompilationError::cant_get_field); + decl->at, CompilationError::lookup_variant_field); } return Visitor::visitMakeVariantField(expr, index, decl, last); } @@ -415,17 +415,17 @@ namespace das { reportAstChanged(); } else { error("undefined variant type " + describeType(expr->makeType), - reportInferAliasErrors(expr->makeType), "", expr->at, CompilationError::type_not_found); + reportInferAliasErrors(expr->makeType), "", expr->at, CompilationError::lookup_variant_type); return Visitor::visit(expr); } } if ( resT->isAuto() ) { error("variant of undefined type " + describeType(expr->makeType), "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::lookup_variant_type); return Visitor::visit(expr); } else if ( resT->isVoid() ) { error("variant can't be void", "", "", - expr->at, CompilationError::type_not_found); + expr->at, CompilationError::invalid_variant); return Visitor::visit(expr); } uint32_t resDim = uint32_t(expr->variants.size()); @@ -491,7 +491,7 @@ namespace das { bool InferTypes::canVisitMakeStructure ( ExprMakeStruct * expr ) { if ( callDepth >= program->policies.max_call_depth ) { error("call expression depth exceeded maximum allowed (" + to_string(program->policies.max_call_depth) + ")", "", "", - expr->at, CompilationError::too_many_infer_passes); + expr->at, CompilationError::exceeds_expression_recursion); return false; } return true; @@ -507,46 +507,46 @@ namespace das { if (expr->makeType->baseType != Type::tStructure && expr->makeType->baseType != Type::tHandle) { if (expr->structs.size()) { error("[[" + describeType(expr->makeType) + "]] with non-structure type", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_structure_type); } } if (expr->makeType->dim.size() > 1) { error("[[" + describeType(expr->makeType) + "]] struct can only initialize single dimension arrays", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_structure_array); } else if (expr->makeType->dim.size() == 1 && expr->makeType->dim[0] != int32_t(expr->structs.size())) { error("[[" + describeType(expr->makeType) + "]] struct dimension mismatch, provided " + to_string(expr->structs.size()) + " elements, expecting " + to_string(expr->makeType->dim[0]), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::mismatching_structure_dimension); } else if (expr->makeType->ref) { error("[[" + describeType(expr->makeType) + "]] struct can't be reference", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_structure); } else if (!expr->makeType->isLocal() && !expr->isNewHandle) { if (expr->makeType->isClass()) { error("Class '" + expr->makeType->structType->name + "' has fields, which can't be allocated locally, which is not allowed. " "It contains Handled type, where isLocal() returned false.", describeLocalType(expr->makeType), "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_class_local); } else { - error(describeType(expr->makeType) + "() can`t be allocated locally (on the stack or as part of other data structure), which is not allowed. " + error(describeType(expr->makeType) + "() can't be allocated locally (on the stack or as part of other data structure), which is not allowed. " "It contains Handled type, where isLocal() returned false. " "Allocate it on the heap (new [[...]]) or modify your C++ bindings.", describeLocalType(expr->makeType), "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_structure_local); } } else if (expr->makeType->baseType == Type::tHandle && expr->isNewHandle && !expr->useInitializer) { error("'new [[" + describeType(expr->makeType) + "]]' struct requires initializer syntax", "", "use 'new [[" + describeType(expr->makeType) + "()]]' instead", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_structure_initializer_required); } else if (!expr->isNewClass && expr->makeType->isClass()) { if (!safeExpression(expr)) { error("Constructing class on stack is unsafe. Allocate it on the heap via new [[...]] or new " + expr->makeType->structType->name + "() instead.", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_class_local); } } else if (noUnsafeUninitializedStructs && !(expr->useInitializer || expr->usedInitializer) && expr->makeType->structType && !expr->makeType->structType->safeWhenUninitialized && !expr->makeType->structType->isLambda && expr->makeType->structType->hasInitFields) { if (!safeExpression(expr)) { error("Uninitialized structure " + expr->makeType->structType->name + " is unsafe. Use initializer syntax or [safe_when_uninitialized] when intended.", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_structure_uninitialized); } } } @@ -555,13 +555,13 @@ namespace das { expr->block = makeStructWhereBlock(expr); if ( !expr->block->rtti_isMakeBlock() ) { error("Expected make block for struct construction, got " + expr->block->describe(), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::internal_structure_block); return false; } auto mkb = static_cast(expr->block); if (!mkb->block->rtti_isBlock()) { error("Expected block for make block, got " + mkb->block->describe(), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::internal_block); return false; } auto blk = static_cast(mkb->block); @@ -601,26 +601,26 @@ namespace das { } else if (decl->value->type->isTemp(true, false)) { if (expr->makeType->structType->isLambda) { error("can't capture temporary lambda variable " + decl->name, "", "", - decl->value->at, CompilationError::cant_pass_temporary); + decl->value->at, CompilationError::cant_capture_variable); } else { error("can't initialize structure field " + decl->name + " with temporary value", "", "", - decl->value->at, CompilationError::cant_pass_temporary); + decl->value->at, CompilationError::cant_initialize_structure_field); } } if (!field->type->canCopy() && !decl->moveSemantics) { error("field " + decl->name + " can't be copied; " + describeType(field->type), "", "use <- instead", - decl->at, CompilationError::invalid_type); + decl->at, CompilationError::cant_structure_field); if (canRelaxAssign(decl->value)) { reportAstChanged(); decl->moveSemantics = true; } } else if (decl->moveSemantics && decl->value->type->isConst()) { error("can't move from a constant value " + describeType(decl->value->type), "", "", - decl->value->at, CompilationError::cant_move); + decl->value->at, CompilationError::cant_structure_field); } if (field->privateField && !expr->nativeClassInitializer) { error("field " + decl->name + " is private, can't be initialized", "", "", - decl->at, CompilationError::cant_get_field); + decl->at, CompilationError::cant_initialize_private_field); } if (!decl->moveSemantics && !field->type->ref) { decl->value = Expression::autoDereference(decl->value); @@ -670,34 +670,34 @@ namespace das { } } error("field not found, " + decl->name, extra.str(), "", - decl->at, CompilationError::cant_get_field); + decl->at, CompilationError::lookup_structure_field); } } else if (expr->makeType->baseType == Type::tHandle) { if (auto fldt = expr->makeType->annotation->makeFieldType(decl->name, false)) { if (!fldt->isRef()) { error("field is a property, not a value; " + decl->name, "", "", - decl->at, CompilationError::cant_get_field); + decl->at, CompilationError::invalid_annotation_field); } if (!canCopyOrMoveType(fldt, decl->value->type, TemporaryMatters::no, decl->value, "can't initialize field " + decl->name, CompilationError::cant_copy, decl->value->at)) { } if (!fldt->canCopy() && !decl->moveSemantics) { error("field " + decl->name + " can't be copied; " + describeType(fldt), "", "use <- instead", - decl->at, CompilationError::invalid_type); + decl->at, CompilationError::cant_annotation_field); if (canRelaxAssign(decl->value)) { reportAstChanged(); decl->moveSemantics = true; } } else if (decl->moveSemantics && decl->value->type->isConst()) { error("can't move from a constant value " + describeType(decl->value->type), "", "", - decl->value->at, CompilationError::cant_move); + decl->value->at, CompilationError::cant_annotation_field); } if (!decl->moveSemantics && !fldt->ref) { decl->value = Expression::autoDereference(decl->value); } } else { error("annotation field not found, " + decl->name, "", "", - decl->at, CompilationError::cant_get_field); + decl->at, CompilationError::lookup_annotation_field); } } return Visitor::visitMakeStructureField(expr, index, decl, last); @@ -705,7 +705,7 @@ namespace das { ExpressionPtr InferTypes::structToTuple(const TypeDeclPtr &makeType, const MakeStructPtr &st, const LineInfo &at) { if (makeType->isAutoOrAlias()) { // not fully inferred? error("can't infer tuple type " + describeType(makeType), "", "", - at, CompilationError::invalid_type); + at, CompilationError::not_resolved_yet_tuple_type); return nullptr; } auto mkt = new ExprMakeTuple(at); @@ -715,11 +715,11 @@ namespace das { auto idx = makeType->findArgumentIndex(fld->name); if (idx == -1) { error("tuple field not found, " + fld->name, "", "", - fld->at, CompilationError::cant_get_field); + fld->at, CompilationError::lookup_tuple_field); return nullptr; } else if (mkt->values[idx]) { error("tuple field already initialized, " + fld->name, "", "", - fld->at, CompilationError::field_already_initialized); + fld->at, CompilationError::already_declared_tuple_field); return nullptr; } else { mkt->values[idx] = fld->value->clone(); @@ -741,7 +741,7 @@ namespace das { } if (expr->ignoreVisCheck && !safeExpression(expr)) { error("ignoring visibility check on structure initialization requires unsafe", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_structure_visibility); } if (expr->makeType && expr->makeType->isAlias()) { if (auto aT = inferAlias(expr->makeType)) { @@ -749,7 +749,7 @@ namespace das { reportAstChanged(); } else { error("undefined [[ ]] expression type " + describeType(expr->makeType), - reportInferAliasErrors(expr->makeType), "", expr->makeType->at, CompilationError::type_not_found); + reportInferAliasErrors(expr->makeType), "", expr->makeType->at, CompilationError::lookup_expression_type); return Visitor::visit(expr); } } @@ -772,7 +772,7 @@ namespace das { reportAstChanged(); } error("constructor can't be inferred " + describeType(expr->makeType), - reportInferAliasErrors(expr->makeType), "", expr->makeType->at, CompilationError::function_not_found); + reportInferAliasErrors(expr->makeType), "", expr->makeType->at, CompilationError::lookup_constructor); } else if (expr->constructor->arguments.size() && expr->structs.empty()) { // this one with default arguments, we demote back to call reportAstChanged(); @@ -786,7 +786,7 @@ namespace das { if (!expr->block->rtti_isMakeBlock()) { string btype = expr->block->type ? describeType(expr->block->type) : "unknown"; error("can only pipe block into structure declaration. expecting <| $ ( var decl ), got " + btype, - "", "", expr->block->at, CompilationError::invalid_block); + "", "", expr->block->at, CompilationError::invalid_structure_block_pipe); return Visitor::visit(expr); } auto mkb = static_cast(expr->block); @@ -794,7 +794,7 @@ namespace das { auto blk = static_cast(mkb->block); if (blk->arguments.size() != 1) { error("where closure should only have one argument", "", "", - expr->block->at, CompilationError::invalid_block); + expr->block->at, CompilationError::invalid_block_argument_count); } else { auto arg = blk->arguments[0]; if (arg->type) { @@ -812,19 +812,19 @@ namespace das { arg->type = nargT; } else { error("can't infer where closure block argument", "", "", - arg->at, CompilationError::invalid_block); + arg->at, CompilationError::not_resolved_yet_block_argument); } } if (!arg->type->isSameType(*passT, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) { error("where closure block argument type mismatch, " + describeType(arg->type) + " vs " + describeType(expr->makeType), "", "", - arg->at, CompilationError::invalid_block); + arg->at, CompilationError::mismatching_block_argument_type); } else if (arg->type->constant) { error("where closure block argument can't be constant, " + describeType(arg->type) + " vs " + describeType(expr->makeType), "", "", - arg->at, CompilationError::invalid_block); + arg->at, CompilationError::invalid_block_argument); } } } @@ -833,20 +833,20 @@ namespace das { if (expr->makeType->baseType == Type::tVariant) { if (expr->forceClass) { error(expr->makeType->describe() + " is not a class, but a variant", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_class_variant); return Visitor::visit(expr); } else if (expr->forceStruct) { error(expr->makeType->describe() + " is not a struct, but a variant", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_structure_variant); return Visitor::visit(expr); } else if (expr->forceTuple) { error(expr->makeType->describe() + " is not a tuple, but a variant", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_tuple_variant); return Visitor::visit(expr); } if (expr->block) { error("[[variant]] can't have where closure", "", "", - expr->block->at, CompilationError::invalid_block); + expr->block->at, CompilationError::invalid_variant_block); return Visitor::visit(expr); } auto mkv = new ExprMakeVariant(expr->at); @@ -855,7 +855,7 @@ namespace das { for (auto &st : expr->structs) { if (st->size() != 1) { error("variant only supports one initializer", "", "", - st->front()->at, CompilationError::field_already_initialized); + st->front()->at, CompilationError::invalid_variant_initializer_count); allGood = false; } else { mkv->variants.push_back(st->front()->clone()); @@ -870,20 +870,20 @@ namespace das { if (expr->makeType->baseType == Type::tTuple && expr->structs.size()) { if (expr->forceClass) { error(expr->makeType->describe() + " is not a class, but a tuple", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_class_tuple); return Visitor::visit(expr); } else if (expr->forceStruct) { error(expr->makeType->describe() + " is not a struct, but a tuple", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_structure_tuple); return Visitor::visit(expr); } else if (expr->forceVariant) { error(expr->makeType->describe() + " is not a variant, but a tuple", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_variant_tuple); return Visitor::visit(expr); } if (expr->block) { error("[[tuple]] can't have where closure", "", "", - expr->block->at, CompilationError::invalid_block); + expr->block->at, CompilationError::invalid_tuple_block); return Visitor::visit(expr); } if (expr->structs.size() == 1) { @@ -915,7 +915,7 @@ namespace das { extraError = "while compiling function " + func->describe(); } error("can't initialize template structure " + expr->makeType->structType->name, extraError, "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_structure_template); return Visitor::visit(expr); } bool anyDuplicates = false; @@ -924,7 +924,7 @@ namespace das { for (auto &fi : *st) { if (fld.find(fi->name) != fld.end()) { error("field " + fi->name + " is already initialized", "", "", - fi->at, CompilationError::field_already_initialized); + fi->at, CompilationError::already_declared_structure_field_init); anyDuplicates = true; } else { fld.insert(fi->name); @@ -938,7 +938,7 @@ namespace das { for (auto &stf : expr->makeType->structType->fields) { if (stf.init) { if (!stf.init->type || stf.init->type->isAuto()) { - error("structure '" + expr->makeType->structType->name + "' is not fully resolved yet", "", "", expr->at); + error("structure '" + expr->makeType->structType->name + "' is not fully resolved yet", "", "", expr->at, CompilationError::not_resolved_yet_structure); return Visitor::visit(expr); } } @@ -1033,7 +1033,7 @@ namespace das { return ens; } else { error("enumeration " + describeType(expr->type) + " is missing 0 value", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::missing_enumeration_zero); } } else if (expr->type->isPointer()) { if ( !isAutoOrAlias ) { @@ -1058,27 +1058,27 @@ namespace das { } if (isAutoOrAlias) { error("undefined structure type " + describeType(expr->type), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::not_resolved_yet_structure_type); return Visitor::visit(expr); } else if (expr->type->isClass() && !expr->usedInitializer && !safeExpression(expr)) { error("skipping initializer for class initialization requires unsafe", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_class_initializer); } if (expr->forceClass && !(expr->makeType->baseType == Type::tStructure && expr->makeType->structType && expr->makeType->structType->isClass)) { error(expr->type->describe() + " is not a class", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_class); } if (expr->forceStruct && !(expr->makeType->baseType == Type::tStructure && expr->makeType->structType && !expr->makeType->structType->isClass)) { error(expr->type->describe() + " is not a struct", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_structure); } if (expr->forceVariant && !(expr->makeType->baseType == Type::tVariant)) { error(expr->type->describe() + " is not a variant", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_variant); } if (expr->forceTuple && !(expr->makeType->baseType == Type::tTuple)) { error(expr->type->describe() + " is not a tuple", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_tuple); } verifyType(expr->type); return Visitor::visit(expr); @@ -1095,7 +1095,7 @@ namespace das { if (expr->recordType && expr->recordType->baseType == Type::tTuple) { if (expr->recordType->argTypes.size() <= index) { error("tuple element _" + to_string(index) + " out of element range", "", "", - init->at, CompilationError::invalid_type); + init->at, CompilationError::exceeds_tuple_index); return Visitor::visitMakeTupleIndex(expr, index, init, lastField); } if (!canCopyOrMoveType(expr->recordType->argTypes[index], init->type, TemporaryMatters::no, init, @@ -1104,7 +1104,7 @@ namespace das { } if (!init->type->canCopy() && init->type->canMove() && init->type->isConst()) { error("can't move from a constant value " + describeType(init->type), "", "", - init->at, CompilationError::cant_move); + init->at, CompilationError::cant_tuple); } if (init->rtti_isMakeLocal()) { auto initl = static_cast(init); @@ -1117,21 +1117,21 @@ namespace das { for (auto &val : expr->values) { if (!val->type || val->type->isAutoOrAlias()) { error("not fully defined tuple element type", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::not_resolved_yet_tuple_type); return Visitor::visit(expr); } } if (expr->recordType) { if (!expr->recordType->isTuple()) { error("internal error. ExprMakeTuple with non-tuple record type", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::internal_tuple_type); return Visitor::visit(expr); } size_t argCount = expr->values.size(); if (expr->recordType->argTypes.size() != argCount) { error("declaring " + to_string(argCount) + " arguments in " + describeType(expr->recordType), "but it only has " + to_string(expr->recordType->argTypes.size()) + " elements", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::mismatching_tuple_argument_count); return Visitor::visit(expr); } auto mkt = new TypeDecl(Type::tTuple); @@ -1142,7 +1142,7 @@ namespace das { error("invalid argument _" + to_string(ai) + ", expecting " + describeType(argT) + ", passing " + describeType(val->type), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_tuple_argument_type); } auto valT = new TypeDecl(*argT); valT->ref = false; @@ -1160,7 +1160,7 @@ namespace das { auto valT = new TypeDecl(*val->type); if (valT->isVoid()) { error("tuple element type can't be void", "", "", - val->at, CompilationError::invalid_type); + val->at, CompilationError::invalid_tuple); return Visitor::visit(expr); } valT->ref = false; @@ -1170,7 +1170,7 @@ namespace das { if (expr->recordNames.size()) { if (expr->recordNames.size() != expr->values.size()) { error("tuple field names mismatch", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::mismatching_tuple_field_names); } else { for (size_t ri = 0, rsize = expr->recordNames.size(); ri != rsize; ++ri) { mkt->argNames.push_back(expr->recordNames[ri]); @@ -1185,17 +1185,17 @@ namespace das { auto keyType = expr->makeType->argTypes[0]; if (keyType->ref) { error("a => b tuple key can't be declared as a reference", "", "", - keyType->at, CompilationError::invalid_table_type); + keyType->at, CompilationError::invalid_tuple_key); } if (!keyType->isWorkhorseType()) { - error("a => b tuple key has to be declare as a basic 'hashable' type", "", "", - keyType->at, CompilationError::invalid_table_type); + error("a => b tuple key has to be declared as a basic 'hashable' type", "", "", + keyType->at, CompilationError::invalid_tuple_key_type); } } for (auto &argType : expr->makeType->argTypes) { if (!argType->canCopy() && !argType->canMove()) { error("tuple element has to be copyable or moveable", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_tuple_type); } } return Visitor::visit(expr); @@ -1212,21 +1212,21 @@ namespace das { if (expr->gen2) { if (expr->makeType->ref) { error("fixed_array<" + describeType(expr->makeType) + "> array type can't be reference", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_array); } TypeDecl::clone(expr->recordType, expr->makeType); } else { if (expr->makeType->dim.size() > 1) { error("[[" + describeType(expr->makeType) + "]] array can only initialize single dimension arrays", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_array_dimension); } else if (expr->makeType->dim.size() == 1 && expr->makeType->dim[0] != int32_t(expr->values.size())) { error("[[" + describeType(expr->makeType) + "]] array dimension mismatch, provided " + to_string(expr->values.size()) + " elements, expecting " + to_string(expr->makeType->dim[0]), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::mismatching_array_dimension); } else if (expr->makeType->ref) { error("[[" + describeType(expr->makeType) + "]] array can't be reference", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_array); } TypeDecl::clone(expr->recordType, expr->makeType); expr->recordType->dim.clear(); @@ -1257,14 +1257,14 @@ namespace das { } if (!mkt) { error("array type can't be inferred, " + describeType(expr->makeType) + " = " + describeType(init->type), "", "", - init->at, CompilationError::invalid_array_type); + init->at, CompilationError::not_resolved_yet_array_type); } else { mkt->ref = false; mkt->constant = false; TypeDecl::applyAutoContracts(mkt, init->type); if (mkt->isVoid()) { error("array element type can't be void", "", "", - init->at, CompilationError::invalid_array_type); + init->at, CompilationError::invalid_array); return Visitor::visitMakeArrayIndex(expr, index, init, last); } expr->makeType = mkt; @@ -1273,7 +1273,7 @@ namespace das { } } else { error("can't infer array auto type, first element type is undefined", "", "", - init->at, CompilationError::invalid_array_type); + init->at, CompilationError::not_resolved_yet_array_type); } } } @@ -1294,7 +1294,7 @@ namespace das { } if (options.size() == 0) { error("can't recognize unique variant '" + describeType(init->type) + "' in '" + describeType(expr->recordType) + "'", "", "", - init->at, CompilationError::invalid_type); + init->at, CompilationError::invalid_variant_unique); } else { if (verbose) { TextWriter tw; @@ -1303,12 +1303,14 @@ namespace das { if (opt != options.back()) tw << "\n"; } - error("can't recognize unique variant '" + describeType(init->type) + "' in '" + describeType(expr->recordType) + "'", + if (verbose) { + error("can't recognize unique variant '" + describeType(init->type) + "' in '" + describeType(expr->recordType) + "'", "\tcandidates are:\n" + tw.str(), "", - init->at, CompilationError::invalid_type); + init->at, CompilationError::invalid_variant_unique); + } } else { error("can't recognize unique variant", "", "", - init->at, CompilationError::invalid_type); + init->at, CompilationError::invalid_variant_unique); } } } else { @@ -1329,10 +1331,10 @@ namespace das { } } else if (!expr->recordType->canCopy() && expr->recordType->canMove() && init->type->isConst()) { error("can't move from a constant value\n\t" + describeType(init->type), "", "", - init->at, CompilationError::cant_move); + init->at, CompilationError::cant_array_element); } else if (init->type->isTemp(true, false)) { error("can't initialize array element with temporary value", "", "", - init->at, CompilationError::cant_pass_temporary); + init->at, CompilationError::cant_initialize_array_element); } if (init->rtti_isMakeLocal()) { auto initl = static_cast(init); @@ -1384,7 +1386,7 @@ namespace das { } if (!expr->recordType->canCopy() && !expr->recordType->canMove()) { error("array element has to be copyable or moveable", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_array_element_type); } auto resT = new TypeDecl(*expr->makeType); uint32_t resDim = uint32_t(expr->values.size()); @@ -1398,11 +1400,11 @@ namespace das { auto eval = expr->values[0]; if (!eval->type) { error("unknown value type", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::not_resolved_yet_type); return Visitor::visit(expr); } else if (!expr->recordType->isSameType(*(eval->type), RefMatters::no, ConstMatters::no, TemporaryMatters::no, AllowSubstitute::yes)) { error("incompatible value type. expecting " + describeType(expr->recordType) + " vs " + describeType(eval->type), "", "", - eval->at, CompilationError::invalid_type); + eval->at, CompilationError::mismatching_array_element_type); return Visitor::visit(expr); } else { reportAstChanged(); @@ -1424,7 +1426,7 @@ namespace das { verifyType(expr->type); if ( resT->isAutoOrAlias() ) { error("array element type is not resolved", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::not_resolved_yet_array_type); } return Visitor::visit(expr); } @@ -1442,10 +1444,10 @@ namespace das { if (expr->subexpr->type) { if (!expr->subexpr->type->canCopy() && !expr->subexpr->type->canMove()) { error("comprehension element has to be copyable or moveable", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_comprehension_element_type); } else if (expr->subexpr->type->isAutoOrAlias()) { error("comprehension element type is not resolved", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::not_resolved_yet_comprehension_type); } else { auto pAC = expr->generatorSyntax ? generateComprehensionIterator(expr) : generateComprehension(expr, expr->tableSyntax); reportAstChanged(); diff --git a/src/ast/ast_infer_type_op.cpp b/src/ast/ast_infer_type_op.cpp index 43cadae363..9bddbfe66c 100644 --- a/src/ast/ast_infer_type_op.cpp +++ b/src/ast/ast_infer_type_op.cpp @@ -34,7 +34,7 @@ namespace das { error("operations on 'void' pointers are prohibited; " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::cant_type); } else { string pop; if (expr->op == "++" || expr->op == "+++") { @@ -45,7 +45,7 @@ namespace das { if (!pop.empty()) { if ( expr->subexpr->type->firstType->isAuto() ) { error("type is not fully inferred, fixed array dimension is unknown", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::not_resolved_yet_array_type); return Visitor::visit(expr); } reportAstChanged(); @@ -56,7 +56,7 @@ namespace das { return popc; } else { error("pointer arithmetics only allows +, -, +=, -=, ++, --; not" + expr->op, "", "", - expr->at, CompilationError::operator_not_found); + expr->at, CompilationError::invalid_pointer_arithmetic); } } } @@ -64,11 +64,11 @@ namespace das { if (expr->subexpr->type->isWorkhorseType()) { if (!expr->subexpr->type->ref) { error(expr->op + " can't be applied to non reference " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::operator_not_found); + expr->at, CompilationError::cant_apply_op); return Visitor::visit(expr); } else if (expr->subexpr->type->constant) { error(expr->op + " can't be applied to constant " + describeType(expr->subexpr->type), "", "", - expr->at, CompilationError::operator_not_found); + expr->at, CompilationError::cant_apply_op); return Visitor::visit(expr); } if (unsafeTableLookup && expr->subexpr->rtti_isAt()) { // tab[expr]++ is always safe @@ -102,7 +102,7 @@ namespace das { // lets try to fold it if (expr->func && expr->func->unsafeOperation && safeExpression(expr)) { error("unsafe operator '" + expr->name + "' must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_operator); } else if (enableInferTimeFolding && isConstExprFunc(expr->func)) { if (auto se = getConstExpr(expr->subexpr)) { expr->subexpr = se; @@ -270,7 +270,7 @@ namespace das { error("operations on 'void' pointers are prohibited; " + describeType(expr->left->type), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::cant_type); } else { string pop; if (expr->op == "+") { @@ -293,7 +293,7 @@ namespace das { return popc; } else { error("pointer arithmetics only allows +, -, +=, -=, ++, --; not" + expr->op, "", "", - expr->at, CompilationError::operator_not_found); + expr->at, CompilationError::invalid_pointer_arithmetic); } } } @@ -310,7 +310,7 @@ namespace das { error("operations on 'void' pointers are prohibited; " + describeType(expr->left->type), "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::cant_type); } else { reportAstChanged(); auto popc = new ExprCall(expr->at, "i_das_ptr_diff"); @@ -325,7 +325,7 @@ namespace das { if (expr->left->type->isEnum() && expr->right->type->isEnum()) if (!expr->left->type->isSameType(*expr->right->type, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) error("operations on different enumerations are prohibited", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_enumeration); auto opName = "_::" + expr->op; auto tempCall = new ExprLooksLikeCall(expr->at, opName); tempCall->arguments.push_back(expr->left); @@ -358,7 +358,7 @@ namespace das { // lets try to fold it if (expr->func && expr->func->unsafeOperation && !safeExpression(expr)) { error("unsafe operator '" + expr->name + "' must be inside the 'unsafe' block", "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_operator); } else if (enableInferTimeFolding && isConstExprFunc(expr->func)) { auto lcc = getConstExpr(expr->left); auto rcc = getConstExpr(expr->right); @@ -376,8 +376,8 @@ namespace das { return Visitor::visit(expr); // infer if (expr->op != "?") { - error("Op3 currently only supports 'is'", "", "", - expr->at, CompilationError::operator_not_found); + error("Op3 currently only supports '?:'", "", "", + expr->at, CompilationError::invalid_op3_expression); return Visitor::visit(expr); } expr->subexpr = Expression::autoDereference(expr->subexpr); @@ -387,7 +387,7 @@ namespace das { } else if (!expr->left->type->isSameType(*expr->right->type, RefMatters::no, ConstMatters::no, TemporaryMatters::no)) { error("cond operator must return the same types on both sides", "\t" + (verbose ? (expr->left->type->describe() + " vs " + expr->right->type->describe()) : ""), "", - expr->at, CompilationError::operator_not_found); + expr->at, CompilationError::mismatching_type); } else if (expr->left->type->isVoid()) { error("cond operator must return a value, not void", "", "", expr->at, CompilationError::invalid_type); @@ -477,36 +477,36 @@ namespace das { "can only move compatible type", CompilationError::cant_move, expr->at)) { } else if (!expr->left->type->isRef()) { error("can only move to a reference" + moveErrorInfo(expr), "", "", - expr->at, CompilationError::cant_write_to_non_reference); + expr->at, CompilationError::cant_move); } else if (!expr->right->type->isRef() && !expr->right->type->isMoveableValue()) { - error("can only move to from a reference" + moveErrorInfo(expr), "", "", - expr->at, CompilationError::cant_write_to_non_reference); + error("can only move from a reference" + moveErrorInfo(expr), "", "", + expr->at, CompilationError::cant_move); } else if (!expr->allowConstantLValue && expr->left->type->constant) { error("can't move to a constant value" + moveErrorInfo(expr), "", "", - expr->at, CompilationError::cant_move_to_const); + expr->at, CompilationError::cant_move); } else if (!expr->left->type->canMove()) { error("this type can't be moved, use clone (:=) instead" + moveErrorInfo(expr), "", "", - expr->at, CompilationError::cant_move); + expr->at, CompilationError::cant_type); } else if (expr->right->type->constant) { error("can't move from a constant value" + moveErrorInfo(expr), "", "", expr->at, CompilationError::cant_move); } else if (expr->right->type->isTemp(true, false)) { error("can't move temporary value" + moveErrorInfo(expr), "", "", - expr->at, CompilationError::cant_pass_temporary); + expr->at, CompilationError::cant_move); } else if (strictSmartPointers && !safeExpression(expr) && expr->right->type->needInScope()) { error("moving values which contain smart pointers is unsafe", "try `move(smart_ptr&) <| smart_ptr&` or `move_new(smart_ptr&) <| new [[YouTypeHere ...]]` instead", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_smart_pointer); } else if (expr->right->type->isPointer() && expr->right->type->smartPtr) { if (!expr->right->type->ref && !safeExpression(expr) && !expr->right->rtti_isAscend()) { error("moving from the smart pointer value requires unsafe", "", "try moving from reference instead", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_move); return Visitor::visit(expr); } } else if (expr->left->type->hasClasses() && !safeExpression(expr)) { error("moving classes requires unsafe" + moveErrorInfo(expr), "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_class); } else if ( forceInscopePod && !expr->podDelete && func && (func->module->allowPodInscope && (!func->fromGeneric || func->fromGeneric->module->allowPodInscope)) // both modules allow pod inscope && !func->hasUnsafe && isPodDelete(expr->left->type) // its a pod type @@ -587,20 +587,20 @@ namespace das { "can only copy compatible type", CompilationError::cant_copy, expr->at)) { } else if (!expr->left->type->isRef()) { error("can only copy to a reference" + copyErrorInfo(expr), "", "", - expr->at, CompilationError::cant_write_to_non_reference); + expr->at, CompilationError::cant_copy); } else if (!expr->allowConstantLValue && expr->left->type->constant) { error("can't write to a constant value" + copyErrorInfo(expr), "", "", - expr->at, CompilationError::cant_write_to_const); + expr->at, CompilationError::cant_write); } else if (!expr->allowCopyTemp && expr->right->type->isTemp(true, false)) { error("can't copy temporary value" + copyErrorInfo(expr), "", "", - expr->at, CompilationError::cant_pass_temporary); + expr->at, CompilationError::cant_copy); } else if (expr->left->type->hasClasses() && !safeExpression(expr)) { error("copying classes requires unsafe" + copyErrorInfo(expr), "", "", - expr->at, CompilationError::unsafe); + expr->at, CompilationError::unsafe_class); } if (!expr->left->type->canCopy()) { error("this type can't be copied" + copyErrorInfo(expr), - "", "use move (<-) or clone (:=) instead", expr->at, CompilationError::cant_copy); + "", "use move (<-) or clone (:=) instead", expr->at, CompilationError::cant_type); if (canRelaxAssign(expr->right)) { reportAstChanged(); return new ExprMove(expr->at, expr->left->clone(), expr->right->clone()); @@ -708,13 +708,13 @@ namespace das { // infer if (!isSameSmartPtrType(expr->left->type, expr->right->type, true)) { error("can only clone the same type " + describeType(expr->left->type) + " vs " + describeType(expr->right->type), "", "", - expr->at, CompilationError::operator_not_found); + expr->at, CompilationError::mismatching_clone_type); } else if (!expr->left->type->isRef()) { error("can only clone to a reference", "", "", - expr->at, CompilationError::cant_write_to_non_reference); + expr->at, CompilationError::cant_clone); } else if (expr->left->type->constant) { error("can't write to a constant value " + expr->left->describe(), "type " + describeType(expr->left->type), "", - expr->at, CompilationError::cant_write_to_const); + expr->at, CompilationError::cant_clone); } else if (!expr->left->type->canClone()) { reportCantClone("type " + describeType(expr->left->type) + " can't be cloned from " + describeType(expr->right->type), expr->left->type, expr->at); @@ -734,7 +734,7 @@ namespace das { } else if (cloneType->isPointer() && cloneType->smartPtr) { if ( !cloneType->firstType || !cloneType->firstType->annotation ) { error("can only clone smart pointer to handled type", "", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_clone_smart_pointer_type); return Visitor::visit(expr); } auto fnClone = makeCloneSmartPtr(expr->at, cloneType, expr->right->type); diff --git a/src/ast/ast_infer_type_report.cpp b/src/ast/ast_infer_type_report.cpp index f847e508af..3c8bf7d468 100644 --- a/src/ast/ast_infer_type_report.cpp +++ b/src/ast/ast_infer_type_report.cpp @@ -355,7 +355,9 @@ namespace das { if (nExtra > 0 && candidateFunctions.size() != 0) { ss << "also " << nExtra << " more candidates\n"; } - error(extra, ss.str(), "", at, cerror); + if (verbose) { + error(extra, ss.str(), "", at, cerror); + } } else { error(extra, "", "", at, cerror); } @@ -438,7 +440,9 @@ namespace das { if (nExtra > 0 && candidateFunctions.size() != 0) { ss << "also " << nExtra << " more candidates\n"; } - error(extra, ss.str(), "", at, cerror); + if (verbose) { + error(extra, ss.str(), "", at, cerror); + } } else { error(extra, "", "", at, cerror); } @@ -503,7 +507,9 @@ namespace das { ss << "also " << nExtra << " more candidates\n"; } } - error(extra, ss.str(), "", at, cerror); + if (verbose) { + error(extra, ss.str(), "", at, cerror); + } } else { error(extra, "", "", at, cerror); } @@ -517,9 +523,11 @@ namespace das { ss << "\tcan't clone '" << trait << ": " << describeType(subT) << "'\n"; } } }); - error(message, ss.str(), "", at, CompilationError::cant_copy); + if (verbose) { + error(message, ss.str(), "", at, CompilationError::cant_clone_type); + } } else { - error(message, "", "", at, CompilationError::cant_copy); + error(message, "", "", at, CompilationError::cant_clone_type); } } void InferTypes::reportCantCloneFromConst(const string &errorText, CompilationError errorCode, const TypeDeclPtr &type, const LineInfo &at) const { @@ -531,7 +539,9 @@ namespace das { ss << "\tcan't assign '" << trait << ": " << describeType(subT) << " = " << describeType(subT) << " const'\n"; } } }); - error(errorText + "; " + describeType(type), ss.str(), "", at, errorCode); + if (verbose) { + error(errorText + "; " + describeType(type), ss.str(), "", at, errorCode); + } } else { error(errorText, "", "", at, errorCode); } @@ -589,10 +599,10 @@ namespace das { } return true; }, moduleName); error("function not found " + expr->target, ss.str(), "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::lookup_function); } else { error("function not found " + expr->target, "", "", - expr->at, CompilationError::function_not_found); + expr->at, CompilationError::lookup_function); } } void InferTypes::reportMissingFinalizer(const string &message, const LineInfo &at, const TypeDeclPtr &ftype) { @@ -602,9 +612,9 @@ namespace das { fakeVar->type = new TypeDecl(*ftype); fakeCall->arguments.push_back(fakeVar); vector fakeTypes = {ftype}; - reportMissing(fakeCall, fakeTypes, message, true, CompilationError::function_already_declared); + reportMissing(fakeCall, fakeTypes, message, true, CompilationError::missing_finalizer); } else { - error(message, "", "", at, CompilationError::function_already_declared); + error(message, "", "", at, CompilationError::missing_finalizer); } } int InferTypes::sortCandidates(RankedMatchingFunctions &ranked, MatchingFunctions &candidates, int nArgs) { @@ -743,24 +753,24 @@ namespace das { if (isAssignmentOperator(expr_op)) { if (!expr_left->type->ref) { error("numeric operator '" + expr_op + "' left side must be reference.", "", "", - expr->at, CompilationError::operator_not_found); + expr->at, CompilationError::cant_assign_op); return true; } else if (expr_left->type->isConst()) { error("numeric operator '" + expr_op + "' left side can't be constant.", "", "", - expr->at, CompilationError::operator_not_found); + expr->at, CompilationError::cant_assign_op); return true; } else { if (verbose) { TextWriter tw; tw << "\t" << *expr_left << " " << expr_op << " " << das_to_string(expr_left->type->baseType) << "(" << *expr_right << ")\n"; error("numeric operator '" + expr_op + "' type mismatch. both sides have to be of the same type; " + - das_to_string(expr_left->type->baseType) + " " + expr_op + " " + das_to_string(expr_right->type->baseType) + " is not defined", - "", "try the following\n" + tw.str(), - expr->at, CompilationError::operator_not_found); + das_to_string(expr_left->type->baseType) + " " + expr_op + " " + das_to_string(expr_right->type->baseType) + " is not defined", + "", "try the following\n" + tw.str(), + expr->at, CompilationError::mismatching_numeric_type); return true; } else { error("numeric operator '" + expr_op + "' type mismatch. both sides have to be of the same type. ", "", "", - expr->at, CompilationError::operator_not_found); + expr->at, CompilationError::mismatching_numeric_type); return true; } } @@ -771,24 +781,24 @@ namespace das { tw << "\t" << *expr_left << " " << expr_op << " " << das_to_string(expr_left->type->baseType) << "(" << *expr_right << ")\n"; tw << "\t" << das_to_string(expr_right->type->baseType) << "(" << *expr_left << ") " << expr_op << " " << *expr_right << "\n"; error("numeric operator '" + expr_op + "' type mismatch. both sides have to be of the same type. " + - das_to_string(expr_left->type->baseType) + " " + expr_op + " " + das_to_string(expr_right->type->baseType) + " is not defined", - "", "try one of the following\n" + tw.str(), - expr->at, CompilationError::operator_not_found); + das_to_string(expr_left->type->baseType) + " " + expr_op + " " + das_to_string(expr_right->type->baseType) + " is not defined", + "", "try one of the following\n" + tw.str(), + expr->at, CompilationError::mismatching_numeric_type); return true; } else if (expr_left->type->isNumericStorage()) { error("numeric operator '" + expr_op + "' is not defined for storage types (int8, uint8, int16, uint16)", "\t" + das_to_string(expr_left->type->baseType) + " " + expr_op + " " + das_to_string(expr_right->type->baseType), - "", expr->at, CompilationError::operator_not_found); + "", expr->at, CompilationError::invalid_storage_type_op); return true; } else { error("numeric operator '" + expr_op + "' type mismatch", - "\t" + das_to_string(expr_left->type->baseType) + " " + expr_op + " " + das_to_string(expr_right->type->baseType), - "", expr->at, CompilationError::operator_not_found); + "\t" + das_to_string(expr_left->type->baseType) + " " + expr_op + " " + das_to_string(expr_right->type->baseType), + "", expr->at, CompilationError::mismatching_numeric_type); return true; } } else { error("numeric operator '" + expr_op + "' type mismatch", "", "", - expr->at, CompilationError::operator_not_found); + expr->at, CompilationError::mismatching_numeric_type); return true; } } diff --git a/src/ast/ast_lint.cpp b/src/ast/ast_lint.cpp index eecae97e99..edb346980b 100644 --- a/src/ast/ast_lint.cpp +++ b/src/ast/ast_lint.cpp @@ -230,7 +230,7 @@ namespace das { for ( auto expr : usedTypeExprs ) { program->error("type expression result is used, and not just passed", "consider default<" + expr->type->describe() + ">", "", - expr->at, CompilationError::invalid_type); + expr->at, CompilationError::invalid_type_expression); } } protected: @@ -245,7 +245,7 @@ namespace das { auto bif = (BuiltInFunction *) _func; if ( bif->cppName.empty() ) { program->error(_func->describe() + " has no cppName while onlyFastAot option is set", "", "", at, - CompilationError::only_fast_aot_no_cpp_name ); + CompilationError::missing_function_name ); } } } @@ -256,7 +256,7 @@ namespace das { Visitor::preVisitModule(mod); if ( !mod->name.empty() && !isValidModuleName(mod->name) ) { program->error("invalid module name '" + mod->name + "'", "", "", - LineInfo(), CompilationError::invalid_name ); + LineInfo(), CompilationError::invalid_module_name ); } } bool isValidEnumName(const string & str) const { @@ -269,7 +269,7 @@ namespace das { for ( auto & name : td->argNames ) { if (!isValidVarName(name)) { program->error("invalid type argument name '" + name + "'", "", "", - td->at, CompilationError::invalid_name ); + td->at, CompilationError::invalid_argument_name ); } } if ( td->firstType ) lintType(td->firstType); @@ -285,7 +285,7 @@ namespace das { if ( !td->isAuto() ) { if ( td->getSizeOf64()>0x7fffffff ) { program->error("alias '" + name + "' is too big", "", "", - td->at, CompilationError::invalid_type ); + td->at, CompilationError::exceeds_type_alias ); } } } @@ -293,14 +293,14 @@ namespace das { Visitor::preVisit(enu); if (!isValidEnumName(enu->name)) { program->error("invalid enumeration name '" + enu->name + "'", "", "", - enu->at, CompilationError::invalid_name ); + enu->at, CompilationError::invalid_enumeration_name ); } } virtual void preVisitEnumerationValue ( Enumeration * enu, const string & name, Expression * value, bool last ) override { Visitor::preVisitEnumerationValue(enu,name,value,last); if (!isValidEnumValueName(name)) { program->error("invalid enumeration value name '" + name + "'", "", "", - enu->at, CompilationError::invalid_name ); + enu->at, CompilationError::invalid_enumerator_name ); } } bool isValidStructureName(const string & str) const { @@ -313,11 +313,11 @@ namespace das { Visitor::preVisit(var); if (!isValidStructureName(var->name)) { program->error("invalid structure name '" + var->name + "'", "", "", - var->at, CompilationError::invalid_name ); + var->at, CompilationError::invalid_structure_name ); } if ( var->getSizeOf64()>0x7fffffff ) { program->error("structure '" + var->name + "' is too big", "", "", - var->at, CompilationError::invalid_type ); + var->at, CompilationError::exceeds_structure ); } } virtual void preVisitExpression ( Expression * expr ) override { @@ -327,7 +327,7 @@ namespace das { anyUnsafe = true; if ( checkUnsafe ) { program->error("unsafe in global initializer.", "unsafe are prohibited by CodeOfPolicies", "", - expr->at, CompilationError::unsafe_function); + expr->at, CompilationError::unsafe_global); } return; } @@ -352,12 +352,12 @@ namespace das { Visitor::preVisitStructureField(var, decl, last); if (!isValidVarName(decl.name)) { program->error("invalid structure field name " + decl.name, "", "", - decl.at, CompilationError::invalid_name ); + decl.at, CompilationError::invalid_field_name ); } if ( noLocalClassMembers ) { if ( !decl.type->ref && decl.type->hasClasses() ) { program->error("class can't contain local class declarations", decl.name + ": " + decl.type->describe(), "", - decl.at, CompilationError::invalid_structure_field_type); + decl.at, CompilationError::cant_field_class); } } } @@ -365,37 +365,37 @@ namespace das { Visitor::preVisitGlobalLet(var); if (!isValidVarName(var->name)) { program->error("invalid variable name '" + var->name + "'", "", "", - var->at, CompilationError::invalid_name ); + var->at, CompilationError::invalid_variable_name ); } if ( checkNoGlobalVariables && !var->generated ) { if ( checkNoGlobalVariablesAtAll ) { program->error("variable '" + var->name + "' is disabled via option no_global_variables_at_all", "", "", - var->at, CompilationError::no_global_variables ); + var->at, CompilationError::cant_global ); } else if ( !var->type->isConst() ) { program->error("variable '" + var->name + "' is not a constant, which is disabled via option no_global_variables", "", "", - var->at, CompilationError::no_global_variables ); + var->at, CompilationError::cant_global ); } } if ( checkNoGlobalHeap ) { if ( !var->type->isNoHeapType() ) { // note: this is too dangerous to allow even with generated program->error("variable '" + var->name + "' uses heap, which is disabled via option no_global_heap", "", "", - var->at, CompilationError::no_global_heap ); + var->at, CompilationError::cant_global ); } } if ( !var->init ) { if ( needAvoidNullPtr(var->type,true) ) { program->error("global variable of type '" + var->type->describe() + "' needs to be initialized to avoid null pointer", "", "", - var->at, CompilationError::cant_be_null); + var->at, CompilationError::missing_global); } } else { if ( needAvoidNullPtr(var->type,false) && var->init->rtti_isNullPtr() ) { program->error("global variable of type '" + var->type->describe() + "' can't be initialized with null", "", "", - var->init->at, CompilationError::cant_be_null); + var->init->at, CompilationError::cant_global); } } if ( var->type->getSizeOf64()>0x7fffffff ) { program->error("global variable '" + var->name + "' is too big", "", "", - var->at,CompilationError::invalid_variable_type); + var->at,CompilationError::exceeds_global); } } virtual void preVisitGlobalLetInit ( const VariablePtr & var, Expression * that ) override { @@ -415,7 +415,7 @@ namespace das { } } program->error("global variable initialization loop", ss.str(), "", - var->at, CompilationError::variable_not_found); + var->at, CompilationError::recursion_global); } tableLookupCollision.push_back(das_hash_set()); } @@ -423,7 +423,7 @@ namespace das { tableLookupCollision.pop_back(); if ( disableInit && !var->init->rtti_isConstant() ) { // we double check here, if it made it past infer program->error("[init] is disabled in the options or CodeOfPolicies", "", "", - var->at, CompilationError::no_init); + var->at, CompilationError::cant_global); } globalVar->index = -3; // initialized. -1 by default globalVar = nullptr; @@ -435,7 +435,7 @@ namespace das { if ( expr->variable->index!=-3 ) { if ( expr->variable->module==globalVar->module ) { program->error("global variable " + expr->name + " is initialized after " + globalVar->name + " (" + to_string(expr->variable->index) + ")", - "", "", expr->at, CompilationError::variable_not_found); + "", "", expr->at, CompilationError::invalid_global); } } } @@ -449,7 +449,7 @@ namespace das { auto & var = expr->iteratorVariables[i]; if (!isValidVarName(var->name)) { program->error("invalid variable name '" + var->name + "'", "", "", - var->at, CompilationError::invalid_name ); + var->at, CompilationError::invalid_variable_name ); } } } @@ -457,7 +457,7 @@ namespace das { Visitor::preVisit(expr); if ( needAvoidNullPtr(expr->subexpr->type,true) ) { program->error("can't delete " + expr->subexpr->type->describe() + ", it will create null pointer", "", "", - expr->subexpr->at, CompilationError::cant_be_null); + expr->subexpr->at, CompilationError::cant_expression); } } @@ -468,22 +468,22 @@ namespace das { for (const auto & var : expr->variables) { if (!isValidVarName(var->name)) { program->error("invalid variable name " + var->name, "", "", - var->at, CompilationError::invalid_name ); + var->at, CompilationError::invalid_variable_name ); } if ( !var->init ) { if ( needAvoidNullPtr(var->type,true) ) { program->error("local variable of type " + var->type->describe() + " needs to be initialized to avoid null pointer", "", "", - var->at, CompilationError::cant_be_null); + var->at, CompilationError::missing_local); } } else { if ( needAvoidNullPtr(var->type,false) && var->init->rtti_isNullPtr() ) { program->error("local variable of type " + var->type->describe() + " can't be initialized with null", "", "", - var->init->at, CompilationError::cant_be_null); + var->init->at, CompilationError::cant_local); } } if ( var->type->getSizeOf64()>0x7fffffff ) { program->error("local variable " + var->name + " is too big", "", "", - var->at,CompilationError::invalid_variable_type); + var->at,CompilationError::exceeds_local); } } } @@ -491,7 +491,7 @@ namespace das { Visitor::preVisit(expr); if ( expr->returnType && needAvoidNullPtr(expr->returnType,false) && expr->subexpr->rtti_isNullPtr() ) { program->error("can't return null", "", "", - expr->subexpr->at, CompilationError::cant_be_null); + expr->subexpr->at, CompilationError::cant_result); } } void verifyToTableMove ( ExprCall * expr ) { @@ -512,7 +512,7 @@ namespace das { seen.insert(mc->text.c_str()); } else { program->error("duplicate key in string=> table initialization", "", "", - mt->values[0]->at, CompilationError::duplicate_key); + mt->values[0]->at, CompilationError::already_declared_table); } } } @@ -530,7 +530,7 @@ namespace das { seen.insert(mc->value); } else { program->error("duplicate key in table initialization", "", "", - mt->values[0]->at, CompilationError::duplicate_key); + mt->values[0]->at, CompilationError::already_declared_table); } } } @@ -547,7 +547,7 @@ namespace das { seen.insert(mc->text.c_str()); } else { program->error("duplicate key in string=> set initialization", "", "", - arg->at, CompilationError::duplicate_key); + arg->at, CompilationError::already_declared_table); } } } @@ -560,7 +560,7 @@ namespace das { seen.insert(mc->value); } else { program->error("duplicate key in set initialization", "", "", - arg->at, CompilationError::duplicate_key); + arg->at, CompilationError::already_declared_table); } } } @@ -573,7 +573,7 @@ namespace das { if ( noWritingToNameless ) { if ( expr->write && !(expr->type->ref || expr->type->isPointer()) ) { program->error("dead write is prohibited by CodeOfPolicies", "\tin " + expr->describe(), "", - expr->at, CompilationError::no_writing_to_nameless); + expr->at, CompilationError::cant_expression); } } } @@ -595,7 +595,7 @@ namespace das { "this typically means the AST was modified after type inference " "without signalling that infer needs to run again - check the " "annotation patch() / pass apply() / substitution macro that produced this node", - "", expr->at, CompilationError::missing_node); + "", expr->at, CompilationError::internal_function_not_resolved_yet); return; } verifyOnlyFastAot(expr->func, expr->at); @@ -616,7 +616,7 @@ namespace das { } } program->error("function " + expr->func->getMangledName() + " is deprecated.","deprecated functions are prohibited by CodeOfPolicies", message, - expr->at, CompilationError::deprecated_function); + expr->at, CompilationError::cant_function); } for ( const auto & annDecl : expr->func->annotations ) { auto ann = annDecl->annotation; @@ -625,7 +625,7 @@ namespace das { string err; if ( !fnAnn->verifyCall(expr, annDecl->arguments, program->options, err) ) { program->error("call annotated by " + fnAnn->name + " failed", err, "", - expr->at, CompilationError::annotation_failed); + expr->at, CompilationError::runtime_function_annotation); } } } @@ -634,7 +634,7 @@ namespace das { for ( auto & arg : expr->arguments ) { if ( !arg->noNativeSideEffects ) { program->error("side effects may affect function " + expr->func->name + " evaluation order", "", "", - expr->at, CompilationError::aot_side_effects ); + expr->at, CompilationError::invalid_function_argument ); break; } } @@ -648,11 +648,11 @@ namespace das { !expr->arguments.at(1)->rtti_isMakeBlock()) { program->error("builtin_try_recover shouldn't be called directly.", "", "Use `try { ... } recover { ... }` instead.", - expr->at, CompilationError::invalid_argument_type ); + expr->at, CompilationError::invalid_function_argument ); } else if (exprReturns(static_cast(expr->arguments.front())->block)) { program->error("try { ... } recover { ... } can't have return inside in jit mode", "This feature is not implemented yet.", "", - expr->at, CompilationError::not_expecting_return_value ); + expr->at, CompilationError::cant_result ); } } for ( size_t i=0, is=expr->arguments.size(); i!=is; ++i ) { @@ -661,7 +661,7 @@ namespace das { const auto & argType = funArg->type; if ( needAvoidNullPtr(argType,false) && arg->rtti_isNullPtr() ) { program->error("can't pass null to function " + expr->func->describeName() + " argument " + funArg->name , "", "", - arg->at, CompilationError::cant_be_null); + arg->at, CompilationError::cant_argument); } } if ( expr->func->fromGeneric && expr->func->fromGeneric->module->name=="builtin" ) { @@ -720,7 +720,7 @@ namespace das { if ( checkAotSideEffects ) { if ( !expr->left->noNativeSideEffects || !expr->right->noNativeSideEffects ) { program->error("side effects may affect evaluation order", "", "", expr->at, - CompilationError::aot_side_effects ); + CompilationError::invalid_expression ); } } } @@ -730,7 +730,7 @@ namespace das { if ( checkAotSideEffects ) { if ( !expr->subexpr->noNativeSideEffects || !expr->left->noNativeSideEffects || !expr->right->noNativeSideEffects ) { program->error("side effects may affect evaluation order", "", "", expr->at, - CompilationError::aot_side_effects ); + CompilationError::invalid_expression ); } } } @@ -781,12 +781,12 @@ namespace das { */ if ( needAvoidNullPtr(expr->left->type,false) && expr->right->rtti_isNullPtr() ) { program->error("can't assign null pointer to " + expr->left->type->describe(), "", "", - expr->right->at, CompilationError::cant_be_null); + expr->right->at, CompilationError::cant_expression); } if ( noWritingToNameless && expr->left->rtti_isMakeLocal() ) { program->error("dead assignment to a temporary value, which is prohibited by CodeOfPolicies", getNamelessHint(expr->left, expr->right, "="), "", - expr->left->at, CompilationError::no_writing_to_nameless); + expr->left->at, CompilationError::cant_expression); } } virtual void preVisit ( ExprMove * expr ) override { @@ -795,17 +795,17 @@ namespace das { if ( checkAotSideEffects ) { if ( !expr->left->noNativeSideEffects || !expr->right->noNativeSideEffects ) { program->error("side effects may affect move evaluation order", "", "", - expr->at, CompilationError::aot_side_effects ); + expr->at, CompilationError::invalid_expression ); } } if ( needAvoidNullPtr(expr->left->type,false) && expr->right->rtti_isNullPtr() ) { program->error("can't assign null pointer to " + expr->left->type->describe(), "", "", - expr->right->at, CompilationError::cant_be_null); + expr->right->at, CompilationError::cant_expression); } if ( noWritingToNameless && expr->left->rtti_isMakeLocal() ) { program->error("dead move to a temporary value, which is prohibited by CodeOfPolicies", getNamelessHint(expr->left, expr->right, "<-"), "", - expr->left->at, CompilationError::no_writing_to_nameless); + expr->left->at, CompilationError::cant_expression); } } virtual void preVisit ( ExprClone * expr ) override { @@ -814,7 +814,7 @@ namespace das { if ( checkAotSideEffects ) { if ( !expr->left->noNativeSideEffects || !expr->right->noNativeSideEffects ) { program->error("side effects may affect clone evaluation order", "", "", - expr->at, CompilationError::aot_side_effects ); + expr->at, CompilationError::invalid_expression ); } } } @@ -822,29 +822,29 @@ namespace das { Visitor::preVisit(expr); if ( expr->subexpr->type->getSizeOf64()>0x7fffffff ) { program->error("can't ascend type which is too big", "", "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::exceeds_type); } if ( !expr->subexpr->type->getSizeOf64() ) { program->error("can't ascend (to heap) type of size 0", "", "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::invalid_type); } } virtual void preVisit ( ExprNew * expr ) override { Visitor::preVisit(expr); if ( expr->typeexpr->getSizeOf64()>0x7fffffff ) { program->error("can't new to a type that is too big", "", "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::exceeds_type); } if ( !expr->typeexpr->getSizeOf64() ) { program->error("can't new (to heap) type of size 0", "", "", - expr->at, CompilationError::invalid_new_type); + expr->at, CompilationError::invalid_type); } } virtual void preVisit ( ExprAssert * expr ) override { Visitor::preVisit(expr); if ( !expr->isVerify && !expr->arguments[0]->noSideEffects ) { program->error("assert expressions can't have side-effects (use verify instead)", "", "", - expr->at, CompilationError::assert_with_side_effects); + expr->at, CompilationError::invalid_expression); } } virtual void preVisit ( ExprUnsafe * expr ) override { @@ -880,12 +880,12 @@ namespace das { func = fn; if (!isValidFunctionName(fn->name)) { program->error("invalid function name " + fn->name, "", "", - fn->at, CompilationError::invalid_name ); + fn->at, CompilationError::invalid_function_name ); } if ( !fn->result->isVoid() && !fn->result->isAuto() ) { if ( !exprReturns(fn->body) ) { program->error("not all control paths return value", "", "", - fn->at, CompilationError::not_all_paths_return_value); + fn->at, CompilationError::missing_function_result); } } if ( !fn->safeImplicit ) { @@ -897,7 +897,7 @@ namespace das { anyUnsafe = true; if ( checkUnsafe ) { program->error("implicit argument " + arg->name, "implicit is unsafe and is prohibited by the CodeOfPolicies", "", - fn->at, CompilationError::unsafe_function); + fn->at, CompilationError::unsafe_argument); } } } @@ -908,13 +908,13 @@ namespace das { auto fann = static_cast(ann->annotation); string err; if ( !fann->lint(fn, *program->thisModuleGroup, ann->arguments, program->options, err) ) { - program->error("function annotation lint failed\n", err, "", fn->at, CompilationError::annotation_failed ); + program->error("function annotation lint failed\n", err, "", fn->at, CompilationError::runtime_function_annotation ); } } } if ( (fn->init | fn->shutdown) && disableInit ) { // we double-check here. we check in the infer first, but this here is for the case where macro does it later program->error("[init] is disabled in the options or CodeOfPolicies", "", "", - fn->at, CompilationError::no_init); + fn->at, CompilationError::cant_function); } if ( alwaysCallSuper && fn->isClassMethod && fn->classParent && fn->classParent->parent && fn->name==(fn->classParent->name+"`"+fn->classParent->name)) { isClassCtor = true; // detect class constructor, but only if we always call super @@ -923,7 +923,7 @@ namespace das { virtual FunctionPtr visit ( Function * fn ) override { if ( isClassCtor && !anySuperCalls ) { program->error("class constructor " + fn->name + " does not call super initializer", "", - "", fn->at, CompilationError::invalid_member_function); + "", fn->at, CompilationError::missing_function_body); } anySuperCalls = false; isClassCtor = false; @@ -934,18 +934,18 @@ namespace das { Visitor::preVisitArgument(fn, var, lastArg); if (!isValidVarName(var->name)) { program->error("invalid argument variable name " + var->name, "", "", - var->at, CompilationError::invalid_name ); + var->at, CompilationError::invalid_argument_name ); } if ( checkUnusedArgument ) { if ( !var->marked_used && var->isAccessUnused() ) { program->error("unused function argument " + var->name, "", "use [unused_argument(" + var->name + ")] if intentional", - var->at, CompilationError::unused_function_argument); + var->at, CompilationError::invalid_function_argument); } } if ( var->type->getSizeOf64()>0x7fffffff ) { program->error("argument variable " + var->name + " is too big", "", "", - var->at,CompilationError::invalid_variable_type); + var->at,CompilationError::exceeds_argument); } } virtual void preVisit ( ExprBlock * block ) override { @@ -954,38 +954,38 @@ namespace das { if ( !block->returnType->isVoid() && !block->returnType->isAuto() ) { if ( !exprReturns(block) ) { program->error("not all control paths of the block return value", "", "", - block->at, CompilationError::not_all_paths_return_value); + block->at, CompilationError::missing_block_result); } } } if (jitEnabled() && !block->finalList.empty() && block->hasExitByLabel) { program->error("jit blocks can't have finally and goto", "", "", - block->at, CompilationError::invalid_label); + block->at, CompilationError::cant_block); } } virtual void preVisitBlockArgument ( ExprBlock * block, const VariablePtr & var, bool lastArg ) override { Visitor::preVisitBlockArgument(block, var, lastArg); if (!isValidVarName(var->name)) { program->error("invalid block argument variable name " + var->name, "", "", - var->at, CompilationError::invalid_name ); + var->at, CompilationError::invalid_argument_name ); } if ( checkUnusedBlockArgument ) { if ( !var->marked_used && var->isAccessUnused() ) { program->error("unused block argument " + var->name, "", "use [unused_argument(" + var->name + ")] if intentional", - var->at, CompilationError::unused_block_argument); + var->at, CompilationError::invalid_block_argument); } } if ( var->type->getSizeOf64()>0x7fffffff ) { program->error("block argument variable " + var->name + " is too big", "", "", - var->at,CompilationError::invalid_variable_type); + var->at,CompilationError::exceeds_argument); } } virtual void preVisit ( ExprMakeStruct * mks ) override { Visitor::preVisit(mks); if ( mks->constructor && mks->constructor->arguments.size() ) { program->error("default arguments of constructors can't be used in make declarations", "its not yet implemented", "", - mks->at, CompilationError::unspecified); + mks->at, CompilationError::cant_argument_structure); } } virtual void preVisit ( ExprTypeDecl * expr ) override { @@ -1000,7 +1000,7 @@ namespace das { auto op2 = static_cast(expr); if ( op2->func && op2->func->builtIn && op2->func->sideEffectFlags==0 ) { program->error("top level no side effect operation " + op2->op, "", "", - expr->at, CompilationError::top_level_no_sideeffect_operation); + expr->at, CompilationError::invalid_expression); } } } @@ -1016,7 +1016,7 @@ namespace das { auto op2 = static_cast(expr); if ( op2->func && op2->func->builtIn && op2->func->sideEffectFlags==0 ) { program->error("top level no side effect operation " + op2->op, "", "", - expr->at, CompilationError::top_level_no_sideeffect_operation); + expr->at, CompilationError::invalid_expression); } } } @@ -1038,7 +1038,7 @@ namespace das { } else { program->error("potential table lookup collision for " + subexprText, "", "tab[key1] = tab[key2], or fun(tab[key1],tab[key2]) scenarios may produce undefined behavior", - expr->subexpr->at, CompilationError::table_lookup_collision); + expr->subexpr->at, CompilationError::invalid_table_expression); } } else { tableLookupCollision.back().insert(subexprHash); @@ -1143,7 +1143,7 @@ namespace das { auto it = ao.find(opt.name); if ( it != ao.end() ) { error("internal error: option '" + string(opt.name) + "' is already defined", - "", "", LineInfo(), CompilationError::internal_error); + "", "", LineInfo(), CompilationError::internal_options); } else { ao[opt.name] = opt.type; } @@ -1152,7 +1152,7 @@ namespace das { auto it = ao.find(opt.first); if ( it != ao.end() ) { error("internal error: option '" + opt.first + "' is already defined", - "", "", LineInfo(), CompilationError::internal_error); + "", "", LineInfo(), CompilationError::internal_options); } else { ao[opt.first] = opt.second; } @@ -1175,11 +1175,11 @@ namespace das { error("invalid option type for '" + opt.name + "', unexpected '" + das_to_string(opt.type) + "', expecting '" + das_to_string(optT) + "'", "", "", - LineInfo(), CompilationError::invalid_option); + LineInfo(), CompilationError::invalid_options); } else if ( optT==Type::none ){ if ( opt.name[0]!='_' ) { error("invalid option '" + opt.name + "'", "", "", - LineInfo(), CompilationError::invalid_option); + LineInfo(), CompilationError::invalid_options); } else { // custom user option (name starts with '_'), we don't care what's in there continue; @@ -1214,7 +1214,7 @@ namespace das { if ( expr->rtti_isTypeDecl() ) return expr; if ( expr->type->isAliasOrExpr() ) { program->error("internal error. leaking alias or expression type",expr->type->describe(),"", - expr->at,CompilationError::internal_error); + expr->at,CompilationError::internal_type); } return expr; } diff --git a/src/ast/ast_parse.cpp b/src/ast/ast_parse.cpp index 1a737690fc..f195b0958f 100644 --- a/src/ast/ast_parse.cpp +++ b/src/ast/ast_parse.cpp @@ -774,7 +774,7 @@ namespace das { das_yylex_destroy(scanner); } } else { - program->error(fileName + " not found", "","",LineInfo()); + program->error(fileName + " not found", "","",LineInfo(), CompilationError::lookup_file); program->isCompiling = false; daScriptEnvironment::getBound()->g_Program.reset(); daScriptEnvironment::getBound()->g_compilerLog = nullptr; @@ -790,6 +790,7 @@ namespace das { daScriptEnvironment::getBound()->g_compilingFileName = nullptr; daScriptEnvironment::getBound()->g_compilingModuleName = nullptr; sort(program->errors.begin(),program->errors.end()); + program->deduplicateErrors(); program->isCompiling = false; return program; } else { @@ -863,13 +864,14 @@ namespace das { daScriptEnvironment::getBound()->g_compilingFileName = nullptr; daScriptEnvironment::getBound()->g_compilingModuleName = nullptr; sort(program->errors.begin(), program->errors.end()); + program->deduplicateErrors(); program->isCompiling = false; if ( !program->failed() ) { if ( program->needMacroModule ) { if ( !program->thisModule->isModule ) { // checking if its a module program->error("Module " + fileName + " is not setup correctly for macros", "module Module_Name is required", "", LineInfo(), - CompilationError::module_does_not_have_a_name); + CompilationError::missing_module_name); } callCompilationCallback(moduleName, fileName, "macro_module"); auto timeM = ref_time_ticks(); @@ -974,7 +976,7 @@ namespace das { return true; program->error("Module " + mod.moduleName + " is not setup correctly for AOT", "module " + mod.moduleName + " is required", "", LineInfo(), - CompilationError::module_does_not_have_a_name); + CompilationError::missing_module_name); return false; } @@ -997,7 +999,7 @@ namespace das { if ( !reqM.first->builtIn ) { program->error("Shared module " + program->thisModule->name + " has incorrect dependency type.", "Can't require " + reqM.first->name + " because its not shared", "", LineInfo(), - CompilationError::module_required_from_shared); + CompilationError::invalid_module_require); regFromShar = true; } } @@ -1147,7 +1149,7 @@ namespace das { reportChain(err, nameless.chain); } program->error(err.str(), "", "", at, - CompilationError::module_not_found); + CompilationError::lookup_module); return program; } @@ -1238,7 +1240,7 @@ namespace das { bool allGood = addExtraDependency("builtin", builtin_path, missing, circular, notAllowed, req, dependencies, namelessReq, namelessMismatches, access, libGroup, policies, &logs); if ( !allGood ) { auto res = make_smart(); - res->error("internal error: failed to build builtin.das", logs.str(), "", LineInfo(), CompilationError::syntax_error); + res->error("internal error: failed to build builtin.das", logs.str(), "", LineInfo(), CompilationError::internal_module); return res; } for ( const auto & em : access->getExtraModules() ) { @@ -1246,7 +1248,7 @@ namespace das { } if ( !allGood ) { auto res = make_smart(); - res->error("internal error", logs.str(), "", LineInfo(), CompilationError::syntax_error); + res->error("internal error", logs.str(), "", LineInfo(), CompilationError::internal_module); return res; } if ( getPrerequisits(fileName, access, modName, req, missing, circular, notAllowed, chain, @@ -1256,7 +1258,7 @@ namespace das { if ( !verifyModuleNamesUnique(req, logs) ) { auto res = make_smart(); res->error("Several modules with invalid names", logs.str(), "", LineInfo(), - CompilationError::module_not_found); + CompilationError::already_declared_module); return res; } for ( const auto & mod : req) { @@ -1265,7 +1267,7 @@ namespace das { TextWriter err; err << "Module '" << modName << "' required for another builtin module (probably debugger/profiler/jit is enabled). Disable conflicting builtin modules.\n"; res->error(err.str(), logs.str(), "", LineInfo(), - CompilationError::module_not_found); + CompilationError::already_declared_module); return res; } } diff --git a/src/ast/ast_simulate.cpp b/src/ast/ast_simulate.cpp index 2444d08cc0..8a7ea8ec7c 100644 --- a/src/ast/ast_simulate.cpp +++ b/src/ast/ast_simulate.cpp @@ -618,7 +618,7 @@ namespace das if ( !node ) { if ( !err.empty() ) { context.thisProgram->error("integration error, function failed to simulate", err, "", - at, CompilationError::missing_node ); + at, CompilationError::internal_function_annotation ); return nullptr; } } else { @@ -913,7 +913,7 @@ namespace das } } if ( !cpy ) { - context.thisProgram->error("internal compilation error, can't generate structure initialization", "", "", mks->at); + context.thisProgram->error("internal compilation error, can't generate structure initialization", "", "", mks->at, CompilationError::internal_structure); } simlist.push_back(cpy); } @@ -1121,7 +1121,7 @@ namespace das } } if ( !cpy ) { - context.thisProgram->error("internal compilation error, can't generate array initialization", "", "", mka->at); + context.thisProgram->error("internal compilation error, can't generate array initialization", "", "", mka->at, CompilationError::internal_array); } simlist.push_back(cpy); } @@ -1222,7 +1222,7 @@ namespace das } } if ( !cpy ) { - context.thisProgram->error("internal compilation error, can't generate array initialization", "", "", mkt->at); + context.thisProgram->error("internal compilation error, can't generate array initialization", "", "", mkt->at, CompilationError::internal_tuple); } simlist.push_back(cpy); } @@ -1249,7 +1249,7 @@ namespace das // reader ExpressionPtr SimulateVisitor::visit(ExprReader * expr) { - context.thisProgram->error("internal compilation error, calling 'simulate' on reader", "", "", expr->at); + context.thisProgram->error("internal compilation error, calling 'simulate' on reader", "", "", expr->at, CompilationError::internal_macro); setE(expr, nullptr); return expr; } @@ -1257,7 +1257,7 @@ namespace das // label ExpressionPtr SimulateVisitor::visit(ExprLabel * expr) { - context.thisProgram->error("internal compilation error, calling 'simulate' on label", "", "", expr->at); + context.thisProgram->error("internal compilation error, calling 'simulate' on label", "", "", expr->at, CompilationError::internal_label); setE(expr, nullptr); return expr; } @@ -1300,11 +1300,11 @@ namespace das ExpressionPtr SimulateVisitor::visit(ExprAddr * expr) { const auto &at = expr->at; if ( !expr->func ) { - context.thisProgram->error("internal compilation error, ExprAddr func is null", "", "", at); + context.thisProgram->error("internal compilation error, ExprAddr func is null", "", "", at, CompilationError::internal_function); setE(expr, nullptr); return expr; } else if ( expr->func->index<0 ) { - context.thisProgram->error("internal compilation error, ExprAddr func->index is unused", "", "", at); + context.thisProgram->error("internal compilation error, ExprAddr func->index is unused", "", "", at, CompilationError::internal_function); setE(expr, nullptr); return expr; @@ -1349,7 +1349,7 @@ namespace das if ( auto resN = expr->type->annotation->simulateNullCoalescing(context, at, getE(expr->subexpr), getE(expr->defaultValue)) ) { setE(expr, resN); } else { - context.thisProgram->error("internal compilation error, simluateNullCoalescing returned null", "", "", at); + context.thisProgram->error("internal compilation error, simulateNullCoalescing returned null", "", "", at, CompilationError::internal_expression); } } else { setE(expr, context.code->makeValueNode(expr->type->getR2VType(), at, getE(expr->subexpr), getE(expr->defaultValue))); @@ -1442,7 +1442,7 @@ namespace das ExpressionPtr SimulateVisitor::visit(ExprMakeGenerator * expr) { const auto &at = expr->at; DAS_ASSERTF(0, "we should not be here ever, ExprMakeGenerator should completly fold during type inference."); - context.thisProgram->error("internal compilation error, generating node for ExprMakeGenerator", "", "", at); + context.thisProgram->error("internal compilation error, generating node for ExprMakeGenerator", "", "", at, CompilationError::internal_generator); setE(expr, nullptr); return expr; } @@ -1450,7 +1450,7 @@ namespace das ExpressionPtr SimulateVisitor::visit(ExprYield * expr) { const auto &at = expr->at; DAS_ASSERTF(0, "we should not be here ever, ExprYield should completly fold during type inference."); - context.thisProgram->error("internal compilation error, generating node for ExprYield", "", "", at); + context.thisProgram->error("internal compilation error, generating node for ExprYield", "", "", at, CompilationError::internal_generator); setE(expr, nullptr); return expr; } @@ -1458,7 +1458,7 @@ namespace das ExpressionPtr SimulateVisitor::visit(ExprArrayComprehension * expr) { const auto &at = expr->at; DAS_ASSERTF(0, "we should not be here ever, ExprArrayComprehension should completly fold during type inference."); - context.thisProgram->error("internal compilation error, generating node for ExprArrayComprehension", "", "", at); + context.thisProgram->error("internal compilation error, generating node for ExprArrayComprehension", "", "", at, CompilationError::internal_array); setE(expr, nullptr); return expr; } @@ -1502,7 +1502,7 @@ namespace das } } if (!foundOffset) { - context.thisProgram->error("internal compilation error, invoke method expects field", "", "", at); + context.thisProgram->error("internal compilation error, invoke method expects field", "", "", at, CompilationError::internal_field); setE(expr, nullptr); return expr; } @@ -1587,7 +1587,7 @@ namespace das setE(expr, context.code->makeValueNode(valueType, at, cont, val, valueTypeSize)); } else { DAS_ASSERTF(0, "we should not even be here. erase can only accept tables. infer type should have failed."); - context.thisProgram->error("internal compilation error, generating erase for non-table type", "", "", at); + context.thisProgram->error("internal compilation error, generating erase for non-table type", "", "", at, CompilationError::internal_table); setE(expr, nullptr); } return expr; @@ -1610,7 +1610,7 @@ namespace das setE(expr, context.code->makeValueNode(valueType, at, cont, val)); } else { DAS_ASSERTF(0, "we should not even be here. erase can only accept tables. infer type should have failed."); - context.thisProgram->error("internal compilation error, generating set insert for non-table type", "", "", at); + context.thisProgram->error("internal compilation error, generating set insert for non-table type", "", "", at, CompilationError::internal_table); setE(expr, nullptr); } return expr; @@ -1633,7 +1633,7 @@ namespace das setE(expr, context.code->makeValueNode(valueType, at, cont, val, valueTypeSize)); } else { DAS_ASSERTF(0, "we should not even be here. find can only accept tables. infer type should have failed."); - context.thisProgram->error("internal compilation error, generating find for non-table type", "", "", at); + context.thisProgram->error("internal compilation error, generating find for non-table type", "", "", at, CompilationError::internal_table); setE(expr, nullptr); } return expr; @@ -1656,7 +1656,7 @@ namespace das setE(expr, context.code->makeValueNode(valueType, at, cont, val, valueTypeSize)); } else { DAS_ASSERTF(0, "we should not even be here. find can only accept tables. infer type should have failed."); - context.thisProgram->error("internal compilation error, generating find for non-table type", "", "", at); + context.thisProgram->error("internal compilation error, generating find for non-table type", "", "", at, CompilationError::internal_table); setE(expr, nullptr); } return expr; @@ -1665,7 +1665,7 @@ namespace das ExpressionPtr SimulateVisitor::visit(ExprIs * expr) { const auto &at = expr->at; DAS_ASSERTF(0, "we should not even be here. 'is' should resolve to const during infer pass."); - context.thisProgram->error("internal compilation error, generating 'is'", "", "", at); + context.thisProgram->error("internal compilation error, generating 'is'", "", "", at, CompilationError::internal_expression); setE(expr, nullptr); return expr; } @@ -1680,14 +1680,14 @@ namespace das const auto &at = expr->at; if ( !expr->macro ) { DAS_ASSERTF(0, "we should not even be here. typeinfo should resolve to const during infer pass."); - context.thisProgram->error("internal compilation error, generating typeinfo(...)", "", "", at); + context.thisProgram->error("internal compilation error, generating typeinfo(...)", "", "", at, CompilationError::internal_macro); setE(expr, nullptr); } else { string errors; auto node = expr->macro->simluate(&context, (Expression*)expr, errors); if ( !node || !errors.empty() ) { context.thisProgram->error("typeinfo(" + expr->trait + "...) macro generated no node; " + errors, - "", "", at, CompilationError::typeinfo_macro_error); + "", "", at, CompilationError::runtime_macro); } setE(expr, node); } @@ -1717,7 +1717,7 @@ namespace das setE(expr, context.code->makeNode(at, sube, total, sze, persistent)); } else { context.thisProgram->error("internal compiler error: SimNode_DeleteClassPtr needs size expression", "", "", - at, CompilationError::missing_node ); + at, CompilationError::internal_expression ); setE(expr, nullptr); } } else { @@ -1737,7 +1737,7 @@ namespace das auto resN = ann->simulateDeletePtr(context, at, sube, total); if ( !resN ) { context.thisProgram->error("integration error, simulateDelete returned null", "", "", - at, CompilationError::missing_node ); + at, CompilationError::internal_expression ); } setE(expr, resN); } @@ -1747,7 +1747,7 @@ namespace das auto resN = ann->simulateDelete(context, at, sube, total); if ( !resN ) { context.thisProgram->error("integration error, simulateDelete returned null", "", "", - at, CompilationError::missing_node ); + at, CompilationError::internal_expression ); } setE(expr, resN); } else if ( expr->subexpr->type->baseType==Type::tLambda ) { @@ -1755,7 +1755,7 @@ namespace das setE(expr, context.code->makeNode(at, sube, total, errorMessage)); } else { DAS_ASSERTF(0, "we should not be here. this is delete for unsupported type. infer types should have failed."); - context.thisProgram->error("internal compiler error: generating node for unsupported ExprDelete", "", "", at); + context.thisProgram->error("internal compiler error: generating node for unsupported ExprDelete", "", "", at, CompilationError::internal_expression); setE(expr, nullptr); } return expr; @@ -1809,7 +1809,7 @@ namespace das pCall->cmresEval = expr->typeexpr->annotation->simulateGetNew(context, at); if ( !pCall->cmresEval ) { context.thisProgram->error("integration error, simulateGetNew returned null", "", "", - at, CompilationError::missing_node ); + at, CompilationError::internal_expression ); } setE(expr, pCall); return expr; @@ -1817,7 +1817,7 @@ namespace das newNode = expr->typeexpr->annotation->simulateGetNew(context, at); if ( !newNode ) { context.thisProgram->error("integration error, simulateGetNew returned null", "", "", - at, CompilationError::missing_node ); + at, CompilationError::internal_expression ); } } } else { @@ -1857,13 +1857,13 @@ namespace das result = expr->subexpr->type->annotation->simulateGetAtR2V(context, at, r2vType, expr->subexpr, expr->index, extraOffset); if ( !result ) { context.thisProgram->error("integration error, simulateGetAtR2V returned null", "", "", - at, CompilationError::missing_node ); + at, CompilationError::internal_expression ); } } else { result = expr->subexpr->type->annotation->simulateGetAt(context, at, r2vType, expr->subexpr, expr->index, extraOffset); if ( !result ) { context.thisProgram->error("integration error, simulateGetAt returned null", "", "", - at, CompilationError::missing_node ); + at, CompilationError::internal_expression ); } } return result; @@ -1887,7 +1887,7 @@ namespace das case Type::tInt64: return context.code->makeValueNode(r2vType->getR2VType(), at, prv, pidx, stride, extraOffset); case Type::tUInt64: return context.code->makeValueNode(r2vType->getR2VType(), at, prv, pidx, stride, extraOffset); default: - context.thisProgram->error("internal compilation error, generating ptr at for unsupported index type " + expr->index->type->describe(), "", "", at); + context.thisProgram->error("internal compilation error, generating ptr at for unsupported index type " + expr->index->type->describe(), "", "", at, CompilationError::internal_expression); return nullptr; }; } else { @@ -1897,7 +1897,7 @@ namespace das case Type::tInt64: return context.code->makeNode>(at, prv, pidx, stride, extraOffset); case Type::tUInt64: return context.code->makeNode>(at, prv, pidx, stride, extraOffset); default: - context.thisProgram->error("internal compilation error, generating ptr at for unsupported index type " + expr->index->type->describe(), "", "", at); + context.thisProgram->error("internal compilation error, generating ptr at for unsupported index type " + expr->index->type->describe(), "", "", at, CompilationError::internal_expression); return nullptr; }; } @@ -1910,7 +1910,7 @@ namespace das uint32_t idxC = cast::to(idxCE->value); if ( idxC >= range ) { context.thisProgram->error("index out of range " + to_string(idxC) + " of " + to_string(range) + ", " + expr->describe(), "", "", - at, CompilationError::index_out_of_range); + at, CompilationError::exceeds_array); return nullptr; } auto tnode = sv_trySimulate(expr->subexpr, extraOffset + idxC*stride, r2vType); @@ -1958,7 +1958,7 @@ namespace das case tFloat: setE(expr, (SimNode *) context.code->makeNode>(at, prv, pidx, range, errorMessage)); break; default: DAS_ASSERTF(0, "we should not even be here. infer type should have failed on unsupported_vector[blah]"); - context.thisProgram->error("internal compilation error, generating vector at for unsupported vector type.", "", "", at); + context.thisProgram->error("internal compilation error, generating vector at for unsupported vector type.", "", "", at, CompilationError::internal_expression); setE(expr, nullptr); } } @@ -2234,7 +2234,7 @@ namespace das const auto &at = expr->at; int offset = expr->value->type->getVectorFieldOffset(expr->fields[0]); if (offset==-1 ) { - context.thisProgram->error("internal compilation error, swizzle field offset of unsupported type", "", "", at); + context.thisProgram->error("internal compilation error, swizzle field offset of unsupported type", "", "", at, CompilationError::internal_expression); return nullptr; } if ( auto chain = sv_trySimulate(expr->value, uint32_t(offset) + extraOffset, r2vType) ) { @@ -2666,7 +2666,7 @@ namespace das ExpressionPtr SimulateVisitor::visit(ExprTag * expr) { const auto &at = expr->at; - context.thisProgram->error("internal compilation error, trying to simulate a tag", "", "", at); + context.thisProgram->error("internal compilation error, trying to simulate a tag", "", "", at, CompilationError::internal_macro); setE(expr, nullptr); return expr; } @@ -2680,7 +2680,7 @@ namespace das } else { auto retN = sv_makeMove(at, expr->left, expr->right); if ( !retN ) { - context.thisProgram->error("internal compilation error, can't generate move", "", "", at); + context.thisProgram->error("internal compilation error, can't generate move", "", "", at, CompilationError::internal_expression); } setE(expr, retN); } @@ -2702,7 +2702,7 @@ namespace das retN = sv_makeCopy(at, expr->left, expr->right); } if ( !retN ) { - context.thisProgram->error("internal compilation error, can't generate clone", "", "", at); + context.thisProgram->error("internal compilation error, can't generate clone", "", "", at, CompilationError::internal_expression); } setE(expr, retN); return expr; @@ -2717,7 +2717,7 @@ namespace das } else { auto retN = sv_makeCopy(at, expr->left, expr->right); if ( !retN ) { - context.thisProgram->error("internal compilation error, can't generate copy", "", "", at); + context.thisProgram->error("internal compilation error, can't generate copy", "", "", at, CompilationError::internal_expression); } setE(expr, retN); } @@ -2940,7 +2940,7 @@ namespace das sv_simulateBlock(pBlock, blk); sv_simulateFinal(pBlock, blk); } else { - context.thisProgram->error("internal error, expecting block", "", "", bod->at); + context.thisProgram->error("internal error, expecting block", "", "", bod->at, CompilationError::internal_block); } } @@ -3050,7 +3050,7 @@ namespace das } else if ( expr->sources[t]->type->isHandle() ) { if ( !result ) { context.thisProgram->error("integration error, simulateGetIterator returned null", "", "", - at, CompilationError::missing_node ); + at, CompilationError::internal_expression ); setE(expr, nullptr); return expr; } else { @@ -3068,7 +3068,7 @@ namespace das expr->sources[t]->type->getStride()); } else { DAS_ASSERTF(0, "we should not be here. we are doing iterator for on an unsupported type."); - context.thisProgram->error("internal compilation error, generating for-with-iterator", "", "", at); + context.thisProgram->error("internal compilation error, generating for-with-iterator", "", "", at, CompilationError::internal_expression); setE(expr, nullptr); return expr; } @@ -3114,7 +3114,7 @@ namespace das } } else { DAS_ASSERTF(0, "we should not be here yet. logic above assumes optimized for path of some kind."); - context.thisProgram->error("internal compilation error, generating for", "", "", at); + context.thisProgram->error("internal compilation error, generating for", "", "", at, CompilationError::internal_expression); setE(expr, nullptr); return expr; } @@ -3151,7 +3151,7 @@ namespace das } } else { DAS_ASSERTF(0, "we should not be here yet. logic above assumes optimized for path of some kind."); - context.thisProgram->error("internal compilation error, generating for", "", "", at); + context.thisProgram->error("internal compilation error, generating for", "", "", at, CompilationError::internal_expression); setE(expr, nullptr); return expr; } @@ -3187,7 +3187,7 @@ namespace das } } else { DAS_ASSERTF(0, "we should not be here yet. logic above assumes optimized for path of some kind."); - context.thisProgram->error("internal compilation error, generating for", "", "", at); + context.thisProgram->error("internal compilation error, generating for", "", "", at, CompilationError::internal_expression); setE(expr, nullptr); return expr; } @@ -3272,7 +3272,7 @@ namespace das simulateExpression(varExpr); auto retN = sv_makeMove(var->init->at, varExpr, var->init); if ( !retN ) { - context.thisProgram->error("internal compilation error, can't generate move", "", "", var->at); + context.thisProgram->error("internal compilation error, can't generate move", "", "", var->at, CompilationError::internal_expression); } return retN; } else if ( !var->init_via_move && (var->type->canCopy() || var->type->isGoodBlockType()) ) { @@ -3283,7 +3283,7 @@ namespace das simulateExpression(varExpr); auto retN = sv_makeCopy(var->init->at, varExpr, var->init); if ( !retN ) { - context.thisProgram->error("internal compilation error, can't generate copy", "", "", var->at); + context.thisProgram->error("internal compilation error, can't generate copy", "", "", var->at, CompilationError::internal_expression); } return retN; } else if ( var->isCtorInitialized() ) { @@ -3302,11 +3302,11 @@ namespace das } } if ( !retN ) { - context.thisProgram->error("internal compilation error, can't generate class constructor", "", "", var->at); + context.thisProgram->error("internal compilation error, can't generate class constructor", "", "", var->at, CompilationError::internal_class); } return retN; } else { - context.thisProgram->error("internal compilation error, initializing variable which can't be copied or moved", "", "", var->at); + context.thisProgram->error("internal compilation error, initializing variable which can't be copied or moved", "", "", var->at, CompilationError::internal_variable); return nullptr; } } @@ -3462,7 +3462,7 @@ namespace das } else if ( collision && collision->init ) { errorAt = &collision->init->debugInfo; } - error(message.str(), "", "", errorAt ? *errorAt : LineInfo()); + error(message.str(), "", "", errorAt ? *errorAt : LineInfo(), CompilationError::internal_global); return; } context.tabGMnLookup->insert({mnh, context.globalVariables[i].offset}); @@ -3482,7 +3482,7 @@ namespace das auto it = context.tabMnLookup->find(mnh); if ( it != context.tabMnLookup->end() ) { error("internal compiler error: function mangled name hash collision '" + fn->name + "'", - "", "", LineInfo()); + "", "", LineInfo(), CompilationError::internal_function); return; } context.tabMnLookup->insert({mnh, context.functions + fn->index}); @@ -3501,7 +3501,7 @@ namespace das auto it = context.tabAdLookup->find(s2d.first); if ( it != context.tabAdLookup->end() ) { error("internal compiler error: annotation data hash collision " + to_string(s2d.second), - "", "", LineInfo()); + "", "", LineInfo(), CompilationError::internal_annotation); return; } context.tabAdLookup->insert(s2d); @@ -3569,7 +3569,7 @@ namespace das auto time0 = ref_time_ticks(); #if !(DAS_ENABLE_KEEPALIVE) if ( policies.keep_alive ) { - error("keep_alive is not enabled in this build. Modify DAS_ENABLE_KEEPALIVE first", "", "", LineInfo()); + error("keep_alive is not enabled in this build. Modify DAS_ENABLE_KEEPALIVE first", "", "", LineInfo(), CompilationError::invalid_options); return false; } #endif @@ -3617,7 +3617,7 @@ namespace das return; if ( pvar->index<0 ) { error("Internal compiler errors. Simulating variable which is not used" + pvar->name, - "", "", LineInfo()); + "", "", LineInfo(), CompilationError::internal_variable); return; } auto & gvar = context.globalVariables[pvar->index]; @@ -3640,21 +3640,21 @@ namespace das } bool canAllocateVariables = true; if ( context.globalsSize >= policies.max_static_variables_size || context.globalsSize >= 0x100000000ul ) { - error("Global variables size exceeds " + to_string(policies.max_static_variables_size), "Global variables size is " + to_string(context.globalsSize) + " bytes", "", LineInfo()); + error("Global variables size exceeds " + to_string(policies.max_static_variables_size), "Global variables size is " + to_string(context.globalsSize) + " bytes", "", LineInfo(), CompilationError::exceeds_global); canAllocateVariables = false; } if ( context.sharedSize >= policies.max_static_variables_size || context.sharedSize >= 0x100000000ul ) { - error("Shared variables size exceeds " + to_string(policies.max_static_variables_size), "Shared variables size is " + to_string(context.sharedSize) + " bytes", "", LineInfo()); + error("Shared variables size exceeds " + to_string(policies.max_static_variables_size), "Shared variables size is " + to_string(context.sharedSize) + " bytes", "", LineInfo(), CompilationError::exceeds_global); canAllocateVariables = false; } if ( canAllocateVariables ) { context.allocateGlobalsAndShared(); if ( context.globalsSize && !context.globals ) { - error("Failed to allocate memory for global variables", "Global variables size is " + to_string(context.globalsSize) + " bytes", "", LineInfo()); + error("Failed to allocate memory for global variables", "Global variables size is " + to_string(context.globalsSize) + " bytes", "", LineInfo(), CompilationError::runtime_global); canAllocateVariables = false; } if ( context.sharedSize && !context.shared ) { - error("Failed to allocate memory for shared variables", "Shared variables size is " + to_string(context.sharedSize) + " bytes", "", LineInfo()); + error("Failed to allocate memory for shared variables", "Shared variables size is " + to_string(context.sharedSize) + " bytes", "", LineInfo(), CompilationError::runtime_global); canAllocateVariables = false; } context.totalVariables = totalVariables; @@ -3679,7 +3679,7 @@ namespace das if ( (pfun->init || pfun->shutdown) && disableInit ) { error("[init] is disabled in the options or CodeOfPolicies", "internal compiler error: [init] function made it all the way to simulate somehow", "", - pfun->at, CompilationError::no_init); + pfun->at, CompilationError::internal_function); } auto mangledName = pfun->getMangledName(); auto MNH = hash_blockz64((uint8_t *)mangledName.c_str()); @@ -3726,7 +3726,7 @@ namespace das if ( disableInit && !pvar->init->rtti_isConstant() ) { error("[init] is disabled in the options or CodeOfPolicies", "internal compiler error: [init] function made it all the way to simulate somehow", "", - pvar->at, CompilationError::no_init); + pvar->at, CompilationError::internal_global); } if ( pvar->init->rtti_isMakeLocal() ) { if ( pvar->global_shared ) { @@ -3794,7 +3794,7 @@ namespace das auto fna = static_cast(an->annotation); if (!fna->simulate(&context, &gfun)) { error("function " + pfun->describe() + " annotation " + fna->name + " simulation failed", "", "", - LineInfo(), CompilationError::cant_initialize); + LineInfo(), CompilationError::runtime_function_annotation); } } indexToFunction[pfun->index] = pfun; @@ -3911,7 +3911,7 @@ namespace das } if (!initScriptSuccess) { error("exception during init script", context.getException(), "", - context.exceptionAt, CompilationError::cant_initialize); + context.exceptionAt, CompilationError::runtime_function); context.clearException(); } if ( options.getBoolOption("log_total_compile_time",policies.log_total_compile_time) ) { @@ -3934,7 +3934,7 @@ namespace das library.foreach_in_order([&](Module * pm) -> bool { for ( auto & sm : pm->simulateMacros ) { if ( !sm->preSimulate(this, &context) ) { - error("simulate macro " + pm->name + "::" + sm->name + " failed to preSimulate", "", "", LineInfo()); + error("simulate macro " + pm->name + "::" + sm->name + " failed to preSimulate", "", "", LineInfo(), CompilationError::runtime_macro); bound_env->g_Program = boundProgram; return false; } @@ -3968,7 +3968,7 @@ namespace das library.foreach_in_order([&](Module * pm) -> bool { for ( auto & sm : pm->simulateMacros ) { if ( !sm->simulate(this, &context) ) { - error("simulate macro " + pm->name + "::" + sm->name + " failed to simulate", "", "", LineInfo()); + error("simulate macro " + pm->name + "::" + sm->name + " failed to simulate", "", "", LineInfo(), CompilationError::runtime_macro); bound_env->g_Program = boundProgram; return false; } diff --git a/src/ast/ast_validate.cpp b/src/ast/ast_validate.cpp index aae94b72c7..a6cc612672 100644 --- a/src/ast/ast_validate.cpp +++ b/src/ast/ast_validate.cpp @@ -68,7 +68,7 @@ namespace das { if ( it != seen.end() && it->second.at.fileInfo ) { extra += " at " + it->second.at.fileInfo->name + ":" + to_string(it->second.at.line); } - program->error(err, extra, "", td->at, CompilationError::unspecified); + program->error(err, extra, "", td->at, CompilationError::internal_type); } void reportDuplicateExpression ( Expression * expr ) { auto it = seen.find(expr); @@ -79,7 +79,7 @@ namespace das { if ( it != seen.end() && it->second.at.fileInfo ) { extra += " at " + it->second.at.fileInfo->name + ":" + to_string(it->second.at.line); } - program->error(err, extra, "", expr->at, CompilationError::unspecified); + program->error(err, extra, "", expr->at, CompilationError::internal_expression); } void trackTypeDeclTree ( TypeDecl * td, const char * field ) { if ( !td ) return; @@ -291,7 +291,7 @@ namespace das { auto td = static_cast(node); string err = "validate_ast: TypeDecl (gc_id=" + to_string(td->gc_id) + ") not reached by visitor: " + td->describe(); string extra = "module '" + mod->name + "'"; - error(err, extra, "", td->at, CompilationError::unspecified); + error(err, extra, "", td->at, CompilationError::internal_type); } } else if ( tag == GC_TAG_EXPRESSION ) { if ( vis.getSeen().find((void *)node) == vis.getSeen().end() ) { @@ -299,7 +299,7 @@ namespace das { string err = "validate_ast: Expression (gc_id=" + to_string(expr->gc_id) + ") not reached by visitor: "; if ( expr->__rtti ) err += expr->__rtti; string extra = "module '" + mod->name + "'"; - error(err, extra, "", expr->at, CompilationError::unspecified); + error(err, extra, "", expr->at, CompilationError::internal_expression); } } } diff --git a/src/builtin/module_builtin_ast.cpp b/src/builtin/module_builtin_ast.cpp index 7f976de74c..9a794058e8 100644 --- a/src/builtin/module_builtin_ast.cpp +++ b/src/builtin/module_builtin_ast.cpp @@ -349,17 +349,17 @@ namespace das { void ast_error ( ProgramPtr prog, const LineInfo & at, const char * message, Context * context, LineInfoArg * lineInfo ) { if ( !prog ) context->throw_error_at(lineInfo,"program can't be null (expecting compiling_program())"); - prog->error(message ? message : "macro error","","",at,CompilationError::macro_failed); + prog->error(message ? message : "macro error","","",at,CompilationError::runtime_macro); } void ast_performance_warning ( ProgramPtr prog, const LineInfo & at, const char * message, Context * context, LineInfoArg * lineInfo ) { if ( !prog ) context->throw_error_at(lineInfo,"program can't be null (expecting compiling_program())"); - prog->error(message ? message : "performance warning","","",at,CompilationError::performance_lint); + prog->error(message ? message : "performance warning","","",at,CompilationError::runtime_macro_performance); } void ast_style_warning ( ProgramPtr prog, const LineInfo & at, const char * message, Context * context, LineInfoArg * lineInfo ) { if ( !prog ) context->throw_error_at(lineInfo,"program can't be null (expecting compiling_program())"); - prog->error(message ? message : "style warning","","",at,CompilationError::style_lint); + prog->error(message ? message : "style warning","","",at,CompilationError::runtime_macro_style); } int32_t get_variant_field_offset ( TypeDecl * td, int32_t index, Context * context, LineInfoArg * at ) { diff --git a/src/builtin/module_builtin_ast_adapters.cpp b/src/builtin/module_builtin_ast_adapters.cpp index 3bdfb90517..7ac041ed79 100644 --- a/src/builtin/module_builtin_ast_adapters.cpp +++ b/src/builtin/module_builtin_ast_adapters.cpp @@ -25,7 +25,7 @@ namespace das { "macro caused exception during " + message, context->getException(), "", context->exceptionAt, - CompilationError::exception_during_macro + CompilationError::runtime_macro_exception ); bound->g_Program->macroException = true; } else { diff --git a/src/builtin/module_builtin_math.cpp b/src/builtin/module_builtin_math.cpp index 7990f13df0..a624d93d11 100644 --- a/src/builtin/module_builtin_math.cpp +++ b/src/builtin/module_builtin_math.cpp @@ -255,7 +255,7 @@ namespace das { uint32_t idxC = cast::to(idxCE->value); if ( idxC >= RowC ) { context.thisProgram->error("matrix index out of range", "", "", - subexpr->at, CompilationError::index_out_of_range); + subexpr->at, CompilationError::exceeds_array_index); return nullptr; } uint32_t stride = sizeof(float)*ColC; diff --git a/src/builtin/module_builtin_rtti.cpp b/src/builtin/module_builtin_rtti.cpp index fb3b8389fc..bd9f28ff6e 100644 --- a/src/builtin/module_builtin_rtti.cpp +++ b/src/builtin/module_builtin_rtti.cpp @@ -43,139 +43,271 @@ IMPLEMENT_EXTERNAL_TYPE_FACTORY(CodeOfPolicies,CodeOfPolicies) IMPLEMENT_EXTERNAL_TYPE_FACTORY(recursive_mutex,das::recursive_mutex) IMPLEMENT_EXTERNAL_TYPE_FACTORY(AstSerializer,das::AstSerializerState) -DAS_BASE_BIND_ENUM(das::CompilationError, CompilationError, - unspecified -// lexer errors - , mismatching_parentheses - , mismatching_curly_bracers - , string_constant_exceeds_file - , string_constant_exceeds_line - , unexpected_close_comment - , integer_constant_out_of_range - , comment_contains_eof - , invalid_escape_sequence - , invalid_line_directive -// parser errors - , syntax_error - , malformed_ast -// semantic erros - , invalid_type - , invalid_return_type - , invalid_argument_type - , invalid_structure_field_type - , invalid_array_type - , invalid_table_type - , invalid_argument_count - , invalid_variable_type - , invalid_new_type - , invalid_index_type - , invalid_annotation - , invalid_swizzle_mask - , invalid_initialization_type - , invalid_with_type - , invalid_override - , invalid_name - , invalid_array_dimension - , invalid_iteration_source - , invalid_loop - , invalid_label - , invalid_enumeration - , invalid_option - , invalid_member_function - - , function_already_declared - , argument_already_declared - , local_variable_already_declared - , global_variable_already_declared - , structure_field_already_declared - , structure_already_declared - , structure_already_has_initializer - , enumeration_already_declared - , enumeration_value_already_declared - , type_alias_already_declared - , field_already_initialized - - , type_not_found - , structure_not_found - , operator_not_found - , function_not_found - , variable_not_found - , handle_not_found - , annotation_not_found - , enumeration_not_found - , enumeration_value_not_found - , type_alias_not_found - , bitfield_not_found - - , cant_initialize - - , cant_dereference - , cant_index - , cant_get_field - , cant_write_to_const - , cant_move_to_const - , cant_write_to_non_reference - , cant_copy - , cant_move - , cant_pass_temporary - - , condition_must_be_bool - , condition_must_be_static - - , cant_pipe - - , invalid_block - , return_or_break_in_finally - - , module_not_found - , module_already_has_a_name - - , cant_new_handle - , bad_delete - - , cant_infer_generic - , cant_infer_missing_initializer - , cant_infer_mismatching_restrictions - - , invalid_cast - , incompatible_cast - , unsafe - - , index_out_of_range - - , expecting_return_value - , not_expecting_return_value - , invalid_return_semantics - , invalid_yield - - , typeinfo_reference - , typeinfo_auto - , typeinfo_undefined - , typeinfo_dim - , typeinfo_macro_error -// logic errors - , static_assert_failed - , run_failed - , annotation_failed - , concept_failed - - , not_all_paths_return_value - , assert_with_side_effects - , only_fast_aot_no_cpp_name - , aot_side_effects - , no_global_heap - , no_global_variables - , unused_function_argument - , unsafe_function - - , performance_lint - - , too_many_infer_passes - -// integration errors - - , missing_node - ) +class EnumerationCompilationError : public das::Enumeration { +private: + inline static const char *enumArrayName[] = { + "unspecified", "invalid_line", "invalid_string", "mismatching_curly_bracers", "mismatching_module_name", "mismatching_parens", + "exceeds_constant", "exceeds_file", "invalid_aka", "invalid_capture", "invalid_escape", "invalid_field", + "invalid_field_static", "invalid_function", "invalid_function_annotation", "invalid_function_static", "invalid_global_aka", "invalid_macro", + "invalid_module", "invalid_module_require", "invalid_name", "invalid_type_aka", "invalid_type_alias", "missing_module_name", + "exceeds_bitfield", "ambiguous_function_argument_type", "already_declared_enumeration", "already_declared_enumerator", "already_declared_field", "already_declared_field_static", + "already_declared_function_argument", "already_declared_global", "already_declared_global_bitfield", "already_declared_local", "already_declared_module", "already_declared_module_name", + "already_declared_structure", "already_declared_type_alias", "lookup_annotation", "lookup_enumeration", "lookup_file", "lookup_module", + "lookup_structure", "cant_structure", "runtime_annotation", "internal_module", "invalid_annotation", "invalid_annotation_field", + "invalid_annotation_macro", "invalid_annotation_type", "invalid_argument", "invalid_argument_global", "invalid_argument_name", "invalid_argument_type", + "invalid_array", "invalid_array_dimension", "invalid_array_dimension_type", "invalid_array_element_type", "invalid_array_type", "invalid_as", + "invalid_ascend_array_handle_type", "invalid_ascend_handle_type", "invalid_assert_argument_count", "invalid_assert_comment_type", "invalid_assert_condition_type", "invalid_bitfield", + "invalid_bitfield_cast_argument_count", "invalid_block_argument", "invalid_block_argument_count", "invalid_block_argument_init_type", "invalid_block_argument_type", "invalid_block_break", + "invalid_block_continue", "invalid_block_finally", "invalid_break", "invalid_capture_variable", "invalid_cast_function", "invalid_cast_structure", + "invalid_cast_structure_pointer", "invalid_cast_type", "invalid_class", "invalid_class_local", "invalid_class_tuple", "invalid_class_variant", + "invalid_clone_smart_pointer_type", "invalid_comprehension_element_type", "invalid_continue", "invalid_debug_argument_count", "invalid_debug_comment_type", "invalid_delete_size_type", + "invalid_delete_super_self_type", "invalid_enumeration", "invalid_enumeration_name", "invalid_enumerator", "invalid_enumerator_name", "invalid_enumerator_type", + "invalid_erase_argument_count", "invalid_expression", "invalid_field_name", "invalid_field_syntax", "invalid_field_type", "invalid_finally_in_generator_if", + "invalid_find_argument_count", "invalid_for_iterator_count", "invalid_for_iterator_tuple", "invalid_function_argument", "invalid_function_argument_count", "invalid_function_argument_type", + "invalid_function_argument_type_block", "invalid_function_name", "invalid_function_options", "invalid_function_result", "invalid_function_result_discarded", "invalid_function_result_type", + "invalid_function_type", "invalid_generator", "invalid_generator_argument_count", "invalid_generator_argument_type", "invalid_generator_result_type", "invalid_global", + "invalid_global_init_options", "invalid_global_init_type", "invalid_global_options", "invalid_global_self_init", "invalid_global_shared", "invalid_global_type", + "invalid_global_type_shared", "invalid_handle_index_type", "invalid_handle_safe_index_type", "invalid_if_condition_type", "invalid_index_type", "invalid_insert_argument_count", + "invalid_invoke_argument_count", "invalid_invoke_argument_type", "invalid_invoke_method_syntax", "invalid_invoke_target_type", "invalid_is", "invalid_is_expression", + "invalid_iteration_source_type", "invalid_key_exists_argument_count", "invalid_label_type", "invalid_local_in_scope", "invalid_local_in_scope_finally", "invalid_local_init", + "invalid_local_init_block", "invalid_local_init_constructor", "invalid_local_init_type", "invalid_local_tuple_expansion", "invalid_local_type", "invalid_macro_context", + "invalid_macro_read", "invalid_macro_tag", "invalid_macro_type", "invalid_memzero_argument", "invalid_memzero_argument_count", "invalid_memzero_argument_type", + "invalid_module_name", "invalid_new_class_syntax", "invalid_new_initializer_result_type", "invalid_new_initializer_type", "invalid_new_type", "invalid_null_coalescing_type", + "invalid_op3_expression", "invalid_pointer_arithmetic", "invalid_quote_argument_count", "invalid_result", "invalid_result_type", "invalid_return_semantics", + "invalid_safe_as", "invalid_safe_dereference_type", "invalid_safe_field_type", "invalid_static_assert_argument_count", "invalid_static_assert_comment_type", "invalid_static_assert_condition_type", + "invalid_static_if_condition", "invalid_storage_type_op", "invalid_string_builder_argument", "invalid_structure", "invalid_structure_annotation", "invalid_structure_array", + "invalid_structure_block_pipe", "invalid_structure_field_init", "invalid_structure_field_type", "invalid_structure_initializer_required", "invalid_structure_local", "invalid_structure_name", + "invalid_structure_template", "invalid_structure_tuple", "invalid_structure_type", "invalid_structure_variant", "invalid_super_call", "invalid_swizzle_mask", + "invalid_swizzle_type", "invalid_table", "invalid_table_argument_type", "invalid_table_expression", "invalid_table_index_type", "invalid_table_key_type", + "invalid_table_safe_index_type", "invalid_table_type", "invalid_tuple", "invalid_tuple_argument_type", "invalid_tuple_block", "invalid_tuple_key", + "invalid_tuple_key_type", "invalid_tuple_type", "invalid_tuple_variant", "invalid_type", "invalid_type_dimension", "invalid_type_expression", + "invalid_typeinfo", "invalid_typeinfo_annotation", "invalid_typeinfo_annotation_argument_type", "invalid_typeinfo_dim", "invalid_typeinfo_dim_table", "invalid_typeinfo_dim_table_type", + "invalid_typeinfo_function", "invalid_typeinfo_has_field_type", "invalid_typeinfo_mangled_subexpression", "invalid_typeinfo_module_subexpression", "invalid_typeinfo_offsetof_type", "invalid_typeinfo_struct_get_annotation_argument_type", + "invalid_typeinfo_struct_has_annotation_argument_type", "invalid_typeinfo_struct_has_annotation_type", "invalid_typeinfo_struct_modulename", "invalid_typeinfo_struct_name", "invalid_typeinfo_variant_index_type", "invalid_variable_name", + "invalid_variable_private", "invalid_variant", "invalid_variant_array", "invalid_variant_block", "invalid_variant_initializer_count", "invalid_variant_tuple", + "invalid_variant_type", "invalid_variant_unique", "invalid_while_condition_type", "invalid_with_array_type", "invalid_with_type", "invalid_yield", + "invalid_yield_in_block", "missing_annotation", "missing_assume_type", "missing_bitfield_init", "missing_block_argument_init", "missing_block_result", + "missing_enumeration_zero", "missing_finalizer", "missing_for_iterator", "missing_function_body", "missing_function_name", "missing_function_result", + "missing_global", "missing_global_init", "missing_global_shared_init", "missing_local", "missing_local_block_init", "missing_local_init", + "missing_local_reference_init", "missing_new_default_initializer", "missing_result", "missing_structure_field", "missing_typeinfo_subexpression", "mismatching_array_dimension", + "mismatching_array_element_type", "mismatching_block_argument_type", "mismatching_clone_type", "mismatching_function_argument", "mismatching_function_argument_count", "mismatching_numeric_type", + "mismatching_result_type", "mismatching_structure_dimension", "mismatching_tuple_argument_count", "mismatching_tuple_field_names", "mismatching_type", "mismatching_variant_dimension", + "exceeds_argument", "exceeds_array_index", "exceeds_call_depth", "exceeds_expression_recursion", "exceeds_function_argument", "exceeds_infer_passes", + "exceeds_local", "exceeds_new_argument", "exceeds_structure", "exceeds_tuple_index", "exceeds_type", "exceeds_type_alias", + "exceeds_typeinfo_sizeof", "ambiguous_annotation", "ambiguous_bitfield", "ambiguous_call_macro", "ambiguous_enumeration", "ambiguous_field", + "ambiguous_field_lookup", "ambiguous_finalizer", "ambiguous_function", "ambiguous_macro", "ambiguous_structure", "ambiguous_super_call", + "ambiguous_super_constructor", "ambiguous_type", "ambiguous_type_alias", "ambiguous_typeinfo_macro", "ambiguous_variable", "already_declared_assume_alias", + "already_declared_block_argument", "already_declared_function", "already_declared_label", "already_declared_local_variable", "already_declared_structure_field_init", "already_declared_table", + "already_declared_tuple_field", "already_declared_variable", "already_declared_with_shadow", "lookup_annotation_field", "lookup_argument_type", "lookup_bitfield", + "lookup_block_argument_type", "lookup_block_result_type", "lookup_cast_type", "lookup_constructor", "lookup_expression_type", "lookup_field", + "lookup_field_type", "lookup_function", "lookup_function_address_type", "lookup_function_argument_type", "lookup_function_mangled_name", "lookup_function_result_type", + "lookup_function_type", "lookup_generator_type", "lookup_global_type", "lookup_is_expression_type", "lookup_label", "lookup_local_type", + "lookup_macro", "lookup_method", "lookup_new_type", "lookup_safe_field_type", "lookup_structure_field", "lookup_structure_field_type", + "lookup_super_class", "lookup_super_constructor", "lookup_super_finalizer", "lookup_super_method", "lookup_tuple_field", "lookup_type", + "lookup_typeinfo_annotation", "lookup_typeinfo_annotation_argument", "lookup_typeinfo_macro", "lookup_typeinfo_offsetof_type", "lookup_typeinfo_type", "lookup_variable", + "lookup_variant_field", "lookup_variant_type", "cant_access_private_field", "cant_access_private_structure", "cant_address_function", "cant_address_template_function", + "cant_annotation_field", "cant_apply_op", "cant_argument", "cant_argument_structure", "cant_array_element", "cant_ascend", + "cant_assign_op", "cant_block", "cant_capture_variable", "cant_clone", "cant_clone_type", "cant_copy", + "cant_create_structure_annotation", "cant_delete", "cant_delete_local", "cant_delete_smart_pointer", "cant_delete_super", "cant_dereference", + "cant_expression", "cant_field_class", "cant_finalize_block_annotation", "cant_finalize_function_annotation", "cant_finalize_structure_annotation", "cant_function", + "cant_get_field", "cant_get_field_pointer", "cant_global", "cant_index", "cant_index_key", "cant_index_pointer", + "cant_index_table", "cant_initialize_array_element", "cant_initialize_private_field", "cant_initialize_structure_field", "cant_initialize_variant_field", "cant_iterate_iterator", + "cant_local", "cant_move", "cant_pointer", "cant_result", "cant_safe_get_field", "cant_safe_index", + "cant_safe_index_table", "cant_structure_field", "cant_take_pointer", "cant_tuple", "cant_type", "cant_variant_field", + "cant_write", "unsafe_address", "unsafe_argument", "unsafe_array_safe_index", "unsafe_capture_variable", "unsafe_cast", + "unsafe_class", "unsafe_class_initializer", "unsafe_class_local", "unsafe_class_stack_construction", "unsafe_delete", "unsafe_delete_pointer", + "unsafe_fixed_array_safe_index", "unsafe_function", "unsafe_function_call", "unsafe_global", "unsafe_global_pointer", "unsafe_local", + "unsafe_local_class", "unsafe_local_in_scope_required", "unsafe_local_reference", "unsafe_local_type", "unsafe_move", "unsafe_operator", + "unsafe_pointer_index", "unsafe_pointer_safe_index", "unsafe_return_block", "unsafe_return_function", "unsafe_return_reference", "unsafe_return_smart_pointer", + "unsafe_smart_pointer", "unsafe_structure_field", "unsafe_structure_uninitialized", "unsafe_structure_visibility", "unsafe_table_index", "unsafe_table_safe_index", + "unsafe_variant_field", "unsafe_variant_safe_as", "recursion_argument", "recursion_assume_alias", "recursion_function", "recursion_function_argument", + "recursion_global", "recursion_structure", "recursion_type_alias", "runtime_annotation_transform", "runtime_call_macro", "runtime_expression", + "runtime_macro_exception", "runtime_macro_infer", "runtime_macro_performance", "runtime_macro_style", "runtime_structure_annotation", "runtime_typeinfo_macro", + "not_resolved_yet_argument_type", "not_resolved_yet_array_dimension", "not_resolved_yet_array_type", "not_resolved_yet_bitfield_type", "not_resolved_yet_block", "not_resolved_yet_block_argument", + "not_resolved_yet_block_argument_init", "not_resolved_yet_class_type", "not_resolved_yet_comprehension_type", "not_resolved_yet_delete_size_type", "not_resolved_yet_dereference_type", "not_resolved_yet_enumerator", + "not_resolved_yet_expression_type", "not_resolved_yet_function", "not_resolved_yet_function_block", "not_resolved_yet_generator_block", "not_resolved_yet_index_type", "not_resolved_yet_invoke_argument_type", + "not_resolved_yet_is_expression_type", "not_resolved_yet_label_type", "not_resolved_yet_lambda_block", "not_resolved_yet_local_type", "not_resolved_yet_method_call", "not_resolved_yet_new_type", + "not_resolved_yet_null_coalescing_type", "not_resolved_yet_structure", "not_resolved_yet_structure_field", "not_resolved_yet_structure_type", "not_resolved_yet_table_type", "not_resolved_yet_tuple_type", + "not_resolved_yet_type", "not_resolved_yet_type_alias", "not_resolved_yet_typeinfo", "not_resolved_yet_typeinfo_alignof", "not_resolved_yet_typeinfo_dim", "not_resolved_yet_typeinfo_dim_table", + "not_resolved_yet_typeinfo_sizeof", "concept_failed", "condition_must_be_bool", "not_expecting_result", "static_assert_failed", "invalid_options", + "mismatching_runtime_type", "mismatching_runtime_type_hash", "exceeds_array", "exceeds_global", "exceeds_runtime_buffer", "cant_hash_block", + "cant_hash_context", "cant_hash_iterator", "cant_serialize_block", "cant_serialize_iterator", "cant_serialize_null_pointer", "cant_serialize_pointer", + "cant_serialize_table", "runtime_function", "runtime_function_annotation", "runtime_global", "runtime_macro", "internal_annotation", + "internal_array", "internal_array_type", "internal_block", "internal_block_missing_return_type", "internal_class", "internal_enumeration", + "internal_expression", "internal_field", "internal_function", "internal_function_annotation", "internal_function_changed", "internal_function_name", + "internal_function_not_resolved_yet", "internal_function_refresh", "internal_generator", "internal_generator_finalizer", "internal_generator_finalizer_multiple", "internal_generator_finalizer_name", + "internal_generator_function_name", "internal_generator_structure_name", "internal_global", "internal_label", "internal_lambda_finalizer_name", "internal_lambda_function_name", + "internal_lambda_in_scope_conversion", "internal_lambda_structure_name", "internal_macro", "internal_name", "internal_options", "internal_pod_analysis_infer", + "internal_relocate_infer", "internal_structure", "internal_structure_block", "internal_table", "internal_tuple", "internal_tuple_type", + "internal_type", "internal_type_alias", "internal_typeinfo_macro", "internal_variable", "missing_aot", "syntax_error", + "function_not_found", "function_already_declared", "invalid_return_type", "invalid_initialization_type", "invalid_private", "invalid_static", + "aot_side_effects", "cant_pipe", "enumeration_value_already_declared", "invalid_escape_sequence", "invalid_option", "module_already_has_a_name", + "type_alias_already_declared", "unsupported_read_macro" + }; +public: + EnumerationCompilationError() : das::Enumeration("CompilationError") { + external = true; + cppName = "das::CompilationError"; + baseType = (das::Type) das::ToBasicType< das::underlying_type< das::CompilationError >::type >::type; + das::CompilationError enumArray[] = { + das::CompilationError::unspecified, das::CompilationError::invalid_line, das::CompilationError::invalid_string, das::CompilationError::mismatching_curly_bracers, + das::CompilationError::mismatching_module_name, das::CompilationError::mismatching_parens, das::CompilationError::exceeds_constant, das::CompilationError::exceeds_file, + das::CompilationError::invalid_aka, das::CompilationError::invalid_capture, das::CompilationError::invalid_escape, das::CompilationError::invalid_field, + das::CompilationError::invalid_field_static, das::CompilationError::invalid_function, das::CompilationError::invalid_function_annotation, das::CompilationError::invalid_function_static, + das::CompilationError::invalid_global_aka, das::CompilationError::invalid_macro, das::CompilationError::invalid_module, das::CompilationError::invalid_module_require, + das::CompilationError::invalid_name, das::CompilationError::invalid_type_aka, das::CompilationError::invalid_type_alias, das::CompilationError::missing_module_name, + das::CompilationError::exceeds_bitfield, das::CompilationError::ambiguous_function_argument_type, das::CompilationError::already_declared_enumeration, das::CompilationError::already_declared_enumerator, + das::CompilationError::already_declared_field, das::CompilationError::already_declared_field_static, das::CompilationError::already_declared_function_argument, das::CompilationError::already_declared_global, + das::CompilationError::already_declared_global_bitfield, das::CompilationError::already_declared_local, das::CompilationError::already_declared_module, das::CompilationError::already_declared_module_name, + das::CompilationError::already_declared_structure, das::CompilationError::already_declared_type_alias, das::CompilationError::lookup_annotation, das::CompilationError::lookup_enumeration, + das::CompilationError::lookup_file, das::CompilationError::lookup_module, das::CompilationError::lookup_structure, das::CompilationError::cant_structure, + das::CompilationError::runtime_annotation, das::CompilationError::internal_module, das::CompilationError::invalid_annotation, das::CompilationError::invalid_annotation_field, + das::CompilationError::invalid_annotation_macro, das::CompilationError::invalid_annotation_type, das::CompilationError::invalid_argument, das::CompilationError::invalid_argument_global, + das::CompilationError::invalid_argument_name, das::CompilationError::invalid_argument_type, das::CompilationError::invalid_array, das::CompilationError::invalid_array_dimension, + das::CompilationError::invalid_array_dimension_type, das::CompilationError::invalid_array_element_type, das::CompilationError::invalid_array_type, das::CompilationError::invalid_as, + das::CompilationError::invalid_ascend_array_handle_type, das::CompilationError::invalid_ascend_handle_type, das::CompilationError::invalid_assert_argument_count, das::CompilationError::invalid_assert_comment_type, + das::CompilationError::invalid_assert_condition_type, das::CompilationError::invalid_bitfield, das::CompilationError::invalid_bitfield_cast_argument_count, das::CompilationError::invalid_block_argument, + das::CompilationError::invalid_block_argument_count, das::CompilationError::invalid_block_argument_init_type, das::CompilationError::invalid_block_argument_type, das::CompilationError::invalid_block_break, + das::CompilationError::invalid_block_continue, das::CompilationError::invalid_block_finally, das::CompilationError::invalid_break, das::CompilationError::invalid_capture_variable, + das::CompilationError::invalid_cast_function, das::CompilationError::invalid_cast_structure, das::CompilationError::invalid_cast_structure_pointer, das::CompilationError::invalid_cast_type, + das::CompilationError::invalid_class, das::CompilationError::invalid_class_local, das::CompilationError::invalid_class_tuple, das::CompilationError::invalid_class_variant, + das::CompilationError::invalid_clone_smart_pointer_type, das::CompilationError::invalid_comprehension_element_type, das::CompilationError::invalid_continue, das::CompilationError::invalid_debug_argument_count, + das::CompilationError::invalid_debug_comment_type, das::CompilationError::invalid_delete_size_type, das::CompilationError::invalid_delete_super_self_type, das::CompilationError::invalid_enumeration, + das::CompilationError::invalid_enumeration_name, das::CompilationError::invalid_enumerator, das::CompilationError::invalid_enumerator_name, das::CompilationError::invalid_enumerator_type, + das::CompilationError::invalid_erase_argument_count, das::CompilationError::invalid_expression, das::CompilationError::invalid_field_name, das::CompilationError::invalid_field_syntax, + das::CompilationError::invalid_field_type, das::CompilationError::invalid_finally_in_generator_if, das::CompilationError::invalid_find_argument_count, das::CompilationError::invalid_for_iterator_count, + das::CompilationError::invalid_for_iterator_tuple, das::CompilationError::invalid_function_argument, das::CompilationError::invalid_function_argument_count, das::CompilationError::invalid_function_argument_type, + das::CompilationError::invalid_function_argument_type_block, das::CompilationError::invalid_function_name, das::CompilationError::invalid_function_options, das::CompilationError::invalid_function_result, + das::CompilationError::invalid_function_result_discarded, das::CompilationError::invalid_function_result_type, das::CompilationError::invalid_function_type, das::CompilationError::invalid_generator, + das::CompilationError::invalid_generator_argument_count, das::CompilationError::invalid_generator_argument_type, das::CompilationError::invalid_generator_result_type, das::CompilationError::invalid_global, + das::CompilationError::invalid_global_init_options, das::CompilationError::invalid_global_init_type, das::CompilationError::invalid_global_options, das::CompilationError::invalid_global_self_init, + das::CompilationError::invalid_global_shared, das::CompilationError::invalid_global_type, das::CompilationError::invalid_global_type_shared, das::CompilationError::invalid_handle_index_type, + das::CompilationError::invalid_handle_safe_index_type, das::CompilationError::invalid_if_condition_type, das::CompilationError::invalid_index_type, das::CompilationError::invalid_insert_argument_count, + das::CompilationError::invalid_invoke_argument_count, das::CompilationError::invalid_invoke_argument_type, das::CompilationError::invalid_invoke_method_syntax, das::CompilationError::invalid_invoke_target_type, + das::CompilationError::invalid_is, das::CompilationError::invalid_is_expression, das::CompilationError::invalid_iteration_source_type, das::CompilationError::invalid_key_exists_argument_count, + das::CompilationError::invalid_label_type, das::CompilationError::invalid_local_in_scope, das::CompilationError::invalid_local_in_scope_finally, das::CompilationError::invalid_local_init, + das::CompilationError::invalid_local_init_block, das::CompilationError::invalid_local_init_constructor, das::CompilationError::invalid_local_init_type, das::CompilationError::invalid_local_tuple_expansion, + das::CompilationError::invalid_local_type, das::CompilationError::invalid_macro_context, das::CompilationError::invalid_macro_read, das::CompilationError::invalid_macro_tag, + das::CompilationError::invalid_macro_type, das::CompilationError::invalid_memzero_argument, das::CompilationError::invalid_memzero_argument_count, das::CompilationError::invalid_memzero_argument_type, + das::CompilationError::invalid_module_name, das::CompilationError::invalid_new_class_syntax, das::CompilationError::invalid_new_initializer_result_type, das::CompilationError::invalid_new_initializer_type, + das::CompilationError::invalid_new_type, das::CompilationError::invalid_null_coalescing_type, das::CompilationError::invalid_op3_expression, das::CompilationError::invalid_pointer_arithmetic, + das::CompilationError::invalid_quote_argument_count, das::CompilationError::invalid_result, das::CompilationError::invalid_result_type, das::CompilationError::invalid_return_semantics, + das::CompilationError::invalid_safe_as, das::CompilationError::invalid_safe_dereference_type, das::CompilationError::invalid_safe_field_type, das::CompilationError::invalid_static_assert_argument_count, + das::CompilationError::invalid_static_assert_comment_type, das::CompilationError::invalid_static_assert_condition_type, das::CompilationError::invalid_static_if_condition, das::CompilationError::invalid_storage_type_op, + das::CompilationError::invalid_string_builder_argument, das::CompilationError::invalid_structure, das::CompilationError::invalid_structure_annotation, das::CompilationError::invalid_structure_array, + das::CompilationError::invalid_structure_block_pipe, das::CompilationError::invalid_structure_field_init, das::CompilationError::invalid_structure_field_type, das::CompilationError::invalid_structure_initializer_required, + das::CompilationError::invalid_structure_local, das::CompilationError::invalid_structure_name, das::CompilationError::invalid_structure_template, das::CompilationError::invalid_structure_tuple, + das::CompilationError::invalid_structure_type, das::CompilationError::invalid_structure_variant, das::CompilationError::invalid_super_call, das::CompilationError::invalid_swizzle_mask, + das::CompilationError::invalid_swizzle_type, das::CompilationError::invalid_table, das::CompilationError::invalid_table_argument_type, das::CompilationError::invalid_table_expression, + das::CompilationError::invalid_table_index_type, das::CompilationError::invalid_table_key_type, das::CompilationError::invalid_table_safe_index_type, das::CompilationError::invalid_table_type, + das::CompilationError::invalid_tuple, das::CompilationError::invalid_tuple_argument_type, das::CompilationError::invalid_tuple_block, das::CompilationError::invalid_tuple_key, + das::CompilationError::invalid_tuple_key_type, das::CompilationError::invalid_tuple_type, das::CompilationError::invalid_tuple_variant, das::CompilationError::invalid_type, + das::CompilationError::invalid_type_dimension, das::CompilationError::invalid_type_expression, das::CompilationError::invalid_typeinfo, das::CompilationError::invalid_typeinfo_annotation, + das::CompilationError::invalid_typeinfo_annotation_argument_type, das::CompilationError::invalid_typeinfo_dim, das::CompilationError::invalid_typeinfo_dim_table, das::CompilationError::invalid_typeinfo_dim_table_type, + das::CompilationError::invalid_typeinfo_function, das::CompilationError::invalid_typeinfo_has_field_type, das::CompilationError::invalid_typeinfo_mangled_subexpression, das::CompilationError::invalid_typeinfo_module_subexpression, + das::CompilationError::invalid_typeinfo_offsetof_type, das::CompilationError::invalid_typeinfo_struct_get_annotation_argument_type, das::CompilationError::invalid_typeinfo_struct_has_annotation_argument_type, das::CompilationError::invalid_typeinfo_struct_has_annotation_type, + das::CompilationError::invalid_typeinfo_struct_modulename, das::CompilationError::invalid_typeinfo_struct_name, das::CompilationError::invalid_typeinfo_variant_index_type, das::CompilationError::invalid_variable_name, + das::CompilationError::invalid_variable_private, das::CompilationError::invalid_variant, das::CompilationError::invalid_variant_array, das::CompilationError::invalid_variant_block, + das::CompilationError::invalid_variant_initializer_count, das::CompilationError::invalid_variant_tuple, das::CompilationError::invalid_variant_type, das::CompilationError::invalid_variant_unique, + das::CompilationError::invalid_while_condition_type, das::CompilationError::invalid_with_array_type, das::CompilationError::invalid_with_type, das::CompilationError::invalid_yield, + das::CompilationError::invalid_yield_in_block, das::CompilationError::missing_annotation, das::CompilationError::missing_assume_type, das::CompilationError::missing_bitfield_init, + das::CompilationError::missing_block_argument_init, das::CompilationError::missing_block_result, das::CompilationError::missing_enumeration_zero, das::CompilationError::missing_finalizer, + das::CompilationError::missing_for_iterator, das::CompilationError::missing_function_body, das::CompilationError::missing_function_name, das::CompilationError::missing_function_result, + das::CompilationError::missing_global, das::CompilationError::missing_global_init, das::CompilationError::missing_global_shared_init, das::CompilationError::missing_local, + das::CompilationError::missing_local_block_init, das::CompilationError::missing_local_init, das::CompilationError::missing_local_reference_init, das::CompilationError::missing_new_default_initializer, + das::CompilationError::missing_result, das::CompilationError::missing_structure_field, das::CompilationError::missing_typeinfo_subexpression, das::CompilationError::mismatching_array_dimension, + das::CompilationError::mismatching_array_element_type, das::CompilationError::mismatching_block_argument_type, das::CompilationError::mismatching_clone_type, das::CompilationError::mismatching_function_argument, + das::CompilationError::mismatching_function_argument_count, das::CompilationError::mismatching_numeric_type, das::CompilationError::mismatching_result_type, das::CompilationError::mismatching_structure_dimension, + das::CompilationError::mismatching_tuple_argument_count, das::CompilationError::mismatching_tuple_field_names, das::CompilationError::mismatching_type, das::CompilationError::mismatching_variant_dimension, + das::CompilationError::exceeds_argument, das::CompilationError::exceeds_array_index, das::CompilationError::exceeds_call_depth, das::CompilationError::exceeds_expression_recursion, + das::CompilationError::exceeds_function_argument, das::CompilationError::exceeds_infer_passes, das::CompilationError::exceeds_local, das::CompilationError::exceeds_new_argument, + das::CompilationError::exceeds_structure, das::CompilationError::exceeds_tuple_index, das::CompilationError::exceeds_type, das::CompilationError::exceeds_type_alias, + das::CompilationError::exceeds_typeinfo_sizeof, das::CompilationError::ambiguous_annotation, das::CompilationError::ambiguous_bitfield, das::CompilationError::ambiguous_call_macro, + das::CompilationError::ambiguous_enumeration, das::CompilationError::ambiguous_field, das::CompilationError::ambiguous_field_lookup, das::CompilationError::ambiguous_finalizer, + das::CompilationError::ambiguous_function, das::CompilationError::ambiguous_macro, das::CompilationError::ambiguous_structure, das::CompilationError::ambiguous_super_call, + das::CompilationError::ambiguous_super_constructor, das::CompilationError::ambiguous_type, das::CompilationError::ambiguous_type_alias, das::CompilationError::ambiguous_typeinfo_macro, + das::CompilationError::ambiguous_variable, das::CompilationError::already_declared_assume_alias, das::CompilationError::already_declared_block_argument, das::CompilationError::already_declared_function, + das::CompilationError::already_declared_label, das::CompilationError::already_declared_local_variable, das::CompilationError::already_declared_structure_field_init, das::CompilationError::already_declared_table, + das::CompilationError::already_declared_tuple_field, das::CompilationError::already_declared_variable, das::CompilationError::already_declared_with_shadow, das::CompilationError::lookup_annotation_field, + das::CompilationError::lookup_argument_type, das::CompilationError::lookup_bitfield, das::CompilationError::lookup_block_argument_type, das::CompilationError::lookup_block_result_type, + das::CompilationError::lookup_cast_type, das::CompilationError::lookup_constructor, das::CompilationError::lookup_expression_type, das::CompilationError::lookup_field, + das::CompilationError::lookup_field_type, das::CompilationError::lookup_function, das::CompilationError::lookup_function_address_type, das::CompilationError::lookup_function_argument_type, + das::CompilationError::lookup_function_mangled_name, das::CompilationError::lookup_function_result_type, das::CompilationError::lookup_function_type, das::CompilationError::lookup_generator_type, + das::CompilationError::lookup_global_type, das::CompilationError::lookup_is_expression_type, das::CompilationError::lookup_label, das::CompilationError::lookup_local_type, + das::CompilationError::lookup_macro, das::CompilationError::lookup_method, das::CompilationError::lookup_new_type, das::CompilationError::lookup_safe_field_type, + das::CompilationError::lookup_structure_field, das::CompilationError::lookup_structure_field_type, das::CompilationError::lookup_super_class, das::CompilationError::lookup_super_constructor, + das::CompilationError::lookup_super_finalizer, das::CompilationError::lookup_super_method, das::CompilationError::lookup_tuple_field, das::CompilationError::lookup_type, + das::CompilationError::lookup_typeinfo_annotation, das::CompilationError::lookup_typeinfo_annotation_argument, das::CompilationError::lookup_typeinfo_macro, das::CompilationError::lookup_typeinfo_offsetof_type, + das::CompilationError::lookup_typeinfo_type, das::CompilationError::lookup_variable, das::CompilationError::lookup_variant_field, das::CompilationError::lookup_variant_type, + das::CompilationError::cant_access_private_field, das::CompilationError::cant_access_private_structure, das::CompilationError::cant_address_function, das::CompilationError::cant_address_template_function, + das::CompilationError::cant_annotation_field, das::CompilationError::cant_apply_op, das::CompilationError::cant_argument, das::CompilationError::cant_argument_structure, + das::CompilationError::cant_array_element, das::CompilationError::cant_ascend, das::CompilationError::cant_assign_op, das::CompilationError::cant_block, + das::CompilationError::cant_capture_variable, das::CompilationError::cant_clone, das::CompilationError::cant_clone_type, das::CompilationError::cant_copy, + das::CompilationError::cant_create_structure_annotation, das::CompilationError::cant_delete, das::CompilationError::cant_delete_local, das::CompilationError::cant_delete_smart_pointer, + das::CompilationError::cant_delete_super, das::CompilationError::cant_dereference, das::CompilationError::cant_expression, das::CompilationError::cant_field_class, + das::CompilationError::cant_finalize_block_annotation, das::CompilationError::cant_finalize_function_annotation, das::CompilationError::cant_finalize_structure_annotation, das::CompilationError::cant_function, + das::CompilationError::cant_get_field, das::CompilationError::cant_get_field_pointer, das::CompilationError::cant_global, das::CompilationError::cant_index, + das::CompilationError::cant_index_key, das::CompilationError::cant_index_pointer, das::CompilationError::cant_index_table, das::CompilationError::cant_initialize_array_element, + das::CompilationError::cant_initialize_private_field, das::CompilationError::cant_initialize_structure_field, das::CompilationError::cant_initialize_variant_field, das::CompilationError::cant_iterate_iterator, + das::CompilationError::cant_local, das::CompilationError::cant_move, das::CompilationError::cant_pointer, das::CompilationError::cant_result, + das::CompilationError::cant_safe_get_field, das::CompilationError::cant_safe_index, das::CompilationError::cant_safe_index_table, das::CompilationError::cant_structure_field, + das::CompilationError::cant_take_pointer, das::CompilationError::cant_tuple, das::CompilationError::cant_type, das::CompilationError::cant_variant_field, + das::CompilationError::cant_write, das::CompilationError::unsafe_address, das::CompilationError::unsafe_argument, das::CompilationError::unsafe_array_safe_index, + das::CompilationError::unsafe_capture_variable, das::CompilationError::unsafe_cast, das::CompilationError::unsafe_class, das::CompilationError::unsafe_class_initializer, + das::CompilationError::unsafe_class_local, das::CompilationError::unsafe_class_stack_construction, das::CompilationError::unsafe_delete, das::CompilationError::unsafe_delete_pointer, + das::CompilationError::unsafe_fixed_array_safe_index, das::CompilationError::unsafe_function, das::CompilationError::unsafe_function_call, das::CompilationError::unsafe_global, + das::CompilationError::unsafe_global_pointer, das::CompilationError::unsafe_local, das::CompilationError::unsafe_local_class, das::CompilationError::unsafe_local_in_scope_required, + das::CompilationError::unsafe_local_reference, das::CompilationError::unsafe_local_type, das::CompilationError::unsafe_move, das::CompilationError::unsafe_operator, + das::CompilationError::unsafe_pointer_index, das::CompilationError::unsafe_pointer_safe_index, das::CompilationError::unsafe_return_block, das::CompilationError::unsafe_return_function, + das::CompilationError::unsafe_return_reference, das::CompilationError::unsafe_return_smart_pointer, das::CompilationError::unsafe_smart_pointer, das::CompilationError::unsafe_structure_field, + das::CompilationError::unsafe_structure_uninitialized, das::CompilationError::unsafe_structure_visibility, das::CompilationError::unsafe_table_index, das::CompilationError::unsafe_table_safe_index, + das::CompilationError::unsafe_variant_field, das::CompilationError::unsafe_variant_safe_as, das::CompilationError::recursion_argument, das::CompilationError::recursion_assume_alias, + das::CompilationError::recursion_function, das::CompilationError::recursion_function_argument, das::CompilationError::recursion_global, das::CompilationError::recursion_structure, + das::CompilationError::recursion_type_alias, das::CompilationError::runtime_annotation_transform, das::CompilationError::runtime_call_macro, das::CompilationError::runtime_expression, + das::CompilationError::runtime_macro_exception, das::CompilationError::runtime_macro_infer, das::CompilationError::runtime_macro_performance, das::CompilationError::runtime_macro_style, + das::CompilationError::runtime_structure_annotation, das::CompilationError::runtime_typeinfo_macro, das::CompilationError::not_resolved_yet_argument_type, das::CompilationError::not_resolved_yet_array_dimension, + das::CompilationError::not_resolved_yet_array_type, das::CompilationError::not_resolved_yet_bitfield_type, das::CompilationError::not_resolved_yet_block, das::CompilationError::not_resolved_yet_block_argument, + das::CompilationError::not_resolved_yet_block_argument_init, das::CompilationError::not_resolved_yet_class_type, das::CompilationError::not_resolved_yet_comprehension_type, das::CompilationError::not_resolved_yet_delete_size_type, + das::CompilationError::not_resolved_yet_dereference_type, das::CompilationError::not_resolved_yet_enumerator, das::CompilationError::not_resolved_yet_expression_type, das::CompilationError::not_resolved_yet_function, + das::CompilationError::not_resolved_yet_function_block, das::CompilationError::not_resolved_yet_generator_block, das::CompilationError::not_resolved_yet_index_type, das::CompilationError::not_resolved_yet_invoke_argument_type, + das::CompilationError::not_resolved_yet_is_expression_type, das::CompilationError::not_resolved_yet_label_type, das::CompilationError::not_resolved_yet_lambda_block, das::CompilationError::not_resolved_yet_local_type, + das::CompilationError::not_resolved_yet_method_call, das::CompilationError::not_resolved_yet_new_type, das::CompilationError::not_resolved_yet_null_coalescing_type, das::CompilationError::not_resolved_yet_structure, + das::CompilationError::not_resolved_yet_structure_field, das::CompilationError::not_resolved_yet_structure_type, das::CompilationError::not_resolved_yet_table_type, das::CompilationError::not_resolved_yet_tuple_type, + das::CompilationError::not_resolved_yet_type, das::CompilationError::not_resolved_yet_type_alias, das::CompilationError::not_resolved_yet_typeinfo, das::CompilationError::not_resolved_yet_typeinfo_alignof, + das::CompilationError::not_resolved_yet_typeinfo_dim, das::CompilationError::not_resolved_yet_typeinfo_dim_table, das::CompilationError::not_resolved_yet_typeinfo_sizeof, das::CompilationError::concept_failed, + das::CompilationError::condition_must_be_bool, das::CompilationError::not_expecting_result, das::CompilationError::static_assert_failed, das::CompilationError::invalid_options, + das::CompilationError::mismatching_runtime_type, das::CompilationError::mismatching_runtime_type_hash, das::CompilationError::exceeds_array, das::CompilationError::exceeds_global, + das::CompilationError::exceeds_runtime_buffer, das::CompilationError::cant_hash_block, das::CompilationError::cant_hash_context, das::CompilationError::cant_hash_iterator, + das::CompilationError::cant_serialize_block, das::CompilationError::cant_serialize_iterator, das::CompilationError::cant_serialize_null_pointer, das::CompilationError::cant_serialize_pointer, + das::CompilationError::cant_serialize_table, das::CompilationError::runtime_function, das::CompilationError::runtime_function_annotation, das::CompilationError::runtime_global, + das::CompilationError::runtime_macro, das::CompilationError::internal_annotation, das::CompilationError::internal_array, das::CompilationError::internal_array_type, + das::CompilationError::internal_block, das::CompilationError::internal_block_missing_return_type, das::CompilationError::internal_class, das::CompilationError::internal_enumeration, + das::CompilationError::internal_expression, das::CompilationError::internal_field, das::CompilationError::internal_function, das::CompilationError::internal_function_annotation, + das::CompilationError::internal_function_changed, das::CompilationError::internal_function_name, das::CompilationError::internal_function_not_resolved_yet, das::CompilationError::internal_function_refresh, + das::CompilationError::internal_generator, das::CompilationError::internal_generator_finalizer, das::CompilationError::internal_generator_finalizer_multiple, das::CompilationError::internal_generator_finalizer_name, + das::CompilationError::internal_generator_function_name, das::CompilationError::internal_generator_structure_name, das::CompilationError::internal_global, das::CompilationError::internal_label, + das::CompilationError::internal_lambda_finalizer_name, das::CompilationError::internal_lambda_function_name, das::CompilationError::internal_lambda_in_scope_conversion, das::CompilationError::internal_lambda_structure_name, + das::CompilationError::internal_macro, das::CompilationError::internal_name, das::CompilationError::internal_options, das::CompilationError::internal_pod_analysis_infer, + das::CompilationError::internal_relocate_infer, das::CompilationError::internal_structure, das::CompilationError::internal_structure_block, das::CompilationError::internal_table, + das::CompilationError::internal_tuple, das::CompilationError::internal_tuple_type, das::CompilationError::internal_type, das::CompilationError::internal_type_alias, + das::CompilationError::internal_typeinfo_macro, das::CompilationError::internal_variable, das::CompilationError::missing_aot, das::CompilationError::syntax_error, + das::CompilationError::function_not_found, das::CompilationError::function_already_declared, das::CompilationError::invalid_return_type, das::CompilationError::invalid_initialization_type, + das::CompilationError::invalid_private, das::CompilationError::invalid_static, das::CompilationError::aot_side_effects, das::CompilationError::cant_pipe, + das::CompilationError::enumeration_value_already_declared, das::CompilationError::invalid_escape_sequence, das::CompilationError::invalid_option, das::CompilationError::module_already_has_a_name, + das::CompilationError::type_alias_already_declared, das::CompilationError::unsupported_read_macro + }; + for (uint32_t i = 0; i < sizeof(enumArray)/sizeof(enumArray[0]); ++i) + addI(enumArrayName[i], int64_t(enumArray[i]), das::LineInfo()); + } +}; +namespace das { + template <> + struct typeFactory< das::CompilationError > { + static TypeDeclPtr make(const ModuleLibrary & library ) { + return library.makeEnumType("CompilationError"); + } + }; +} das::FileAccessPtr get_file_access( char * pak );//link time resolved dependencies das::Context * get_context ( int stackSize=0 );//link time resolved dependencies diff --git a/src/builtin/module_builtin_runtime.cpp b/src/builtin/module_builtin_runtime.cpp index 5ae4ee5a5f..8515de1c5c 100644 --- a/src/builtin/module_builtin_runtime.cpp +++ b/src/builtin/module_builtin_runtime.cpp @@ -185,7 +185,7 @@ namespace das MakeFunctionUnsafeCallMacro() : CallMacro("make_function_unsafe") { } virtual ExpressionPtr visit ( Program * prog, Module *, ExprCallMacro * call ) override { if ( !call->inFunction ) { - prog->error("make_function_unsafe can only be used inside a function", "", "", call->at); + prog->error("make_function_unsafe can only be used inside a function", "", "", call->at, CompilationError::invalid_macro_context); return nullptr; } call->inFunction->unsafeOperation = true; diff --git a/src/parser/ds2_lexer.cpp b/src/parser/ds2_lexer.cpp index e8c6ab8720..3006140ccb 100644 --- a/src/parser/ds2_lexer.cpp +++ b/src/parser/ds2_lexer.cpp @@ -1586,7 +1586,7 @@ YY_RULE_SETUP string incFileName = yyextra->g_Access->getIncludeFileName(cfi->name,lFile); auto info = yyextra->g_Access->getFileInfo(incFileName); if ( !info ) { - das2_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName); + das2_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName, CompilationError::lookup_file); } else { yyextra->g_FileAccessStack.pop_back(); yyextra->g_FileAccessStack.push_back(info); @@ -1595,14 +1595,14 @@ YY_RULE_SETUP } } else { das2_yyfatalerror(yylloc_param,yyscanner,"can't process line directive " + string(yytext), - CompilationError::invalid_line_directive); return LEXER_ERROR; + CompilationError::invalid_line); return LEXER_ERROR; } } YY_BREAK case 2: YY_RULE_SETUP #line 101 "ds2_lexer.lpp" -das2_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::unexpected_close_comment); return LEXER_ERROR; +das2_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::invalid_line); return LEXER_ERROR; YY_BREAK case 3: YY_RULE_SETUP @@ -1699,14 +1699,14 @@ YY_RULE_SETUP case YY_STATE_EOF(c_comment): #line 157 "ds2_lexer.lpp" { - das2_yyfatalerror(yylloc_param,yyscanner,"end of file encountered inside c-style comment", CompilationError::comment_contains_eof); + das2_yyfatalerror(yylloc_param,yyscanner,"end of file encountered inside c-style comment", CompilationError::exceeds_file); BEGIN(normal); } YY_BREAK case YY_STATE_EOF(reader): #line 161 "ds2_lexer.lpp" { - das2_yyfatalerror(yylloc_param,yyscanner,"reader constant exceeds file", CompilationError::string_constant_exceeds_file); + das2_yyfatalerror(yylloc_param,yyscanner,"reader constant exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_OF_READ; } @@ -1743,7 +1743,7 @@ YY_RULE_SETUP #line 180 "ds2_lexer.lpp" { if ( yyextra->das_nested_sb ) { - das2_yyfatalerror(yylloc_param,yyscanner,"nested string constants are not allowed", CompilationError::nested_string_constant); + das2_yyfatalerror(yylloc_param,yyscanner,"nested string constants are not allowed", CompilationError::invalid_string); BEGIN(normal); return END_STRING; } @@ -1755,7 +1755,7 @@ YY_RULE_SETUP case YY_STATE_EOF(strb): #line 190 "ds2_lexer.lpp" { - das2_yyfatalerror(yylloc_param,yyscanner,"string constant exceeds file", CompilationError::string_constant_exceeds_file); + das2_yyfatalerror(yylloc_param,yyscanner,"string constant exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_STRING; } @@ -1809,7 +1809,7 @@ YY_RULE_SETUP case YY_STATE_EOF(strfmt): #line 216 "ds2_lexer.lpp" { - das2_yyfatalerror(yylloc_param,yyscanner,"string format exceeds file", CompilationError::string_constant_exceeds_file); + das2_yyfatalerror(yylloc_param,yyscanner,"string format exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_STRING; } @@ -1861,7 +1861,7 @@ YY_RULE_SETUP string incFileName = yyextra->g_Access->getIncludeFileName(cfi->name,yytext); auto info = yyextra->g_Access->getFileInfo(incFileName); if ( !info ) { - das2_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName); + das2_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName, CompilationError::lookup_file); } else { if ( yyextra->das_already_include.find(incFileName) == yyextra->das_already_include.end() ) { yyextra->das_already_include.insert(incFileName); @@ -2571,7 +2571,7 @@ YY_RULE_SETUP int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->ui64); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -2586,7 +2586,7 @@ YY_RULE_SETUP int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i64); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-1 ) { return LEXER_ERROR; } @@ -2602,7 +2602,7 @@ YY_RULE_SETUP uint8_t u8_const; auto res = fast_float::from_chars(temptext, temptext+templength, u8_const); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -2618,7 +2618,7 @@ YY_RULE_SETUP int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->ui); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-1 ) { return LEXER_ERROR; } @@ -2633,7 +2633,7 @@ YY_RULE_SETUP int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -2652,7 +2652,7 @@ YY_RULE_SETUP int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength ) { return LEXER_ERROR; } @@ -2667,7 +2667,7 @@ YY_RULE_SETUP skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui64, 16); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-2 ) { return LEXER_ERROR; } @@ -2682,7 +2682,7 @@ YY_RULE_SETUP skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui64, 16); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-1 ) { return LEXER_ERROR; } @@ -2699,7 +2699,7 @@ YY_RULE_SETUP uint8_t u8_const; auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext)-2, u8_const, 16); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-2 ) { return LEXER_ERROR; } @@ -2708,7 +2708,7 @@ YY_RULE_SETUP } else { auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui, 16); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-1 ) { return LEXER_ERROR; } @@ -2724,7 +2724,7 @@ YY_RULE_SETUP skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui, 16); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext) ) { return LEXER_ERROR; } @@ -2737,7 +2737,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -2750,7 +2750,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -2764,7 +2764,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -2777,7 +2777,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -2790,7 +2790,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -2803,7 +2803,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -2816,7 +2816,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -2829,7 +2829,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -2841,7 +2841,7 @@ YY_RULE_SETUP #line 616 "ds2_lexer.lpp" { if ( !yyextra->das_nested_parentheses ) { - das2_yyfatalerror(yylloc_param,yyscanner,"mismatching parentheses", CompilationError::mismatching_parentheses); + das2_yyfatalerror(yylloc_param,yyscanner,"mismatching parentheses", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_parentheses --; @@ -2861,7 +2861,7 @@ YY_RULE_SETUP #line 628 "ds2_lexer.lpp" { if ( !yyextra->das_nested_square_braces ) { - das2_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das2_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_square_braces --; @@ -4477,7 +4477,7 @@ void das2_collect_keywords ( Module * mod, yyscan_t yyscanner ) { auto it = yyextra->das_keywords.find(kwd.first); if ( it != yyextra->das_keywords.end() && it->second.keyword!=kwd.first ) { yyextra->g_Program->error("mismatching keyword " + kwd.first + " in module " + mod->name, - it->second.keyword + " is already defined","",LineInfo()); + it->second.keyword + " is already defined","",LineInfo(), CompilationError::mismatching_module_name); return; } yyextra->das_keywords[kwd.first] = DasKeyword{kwd.second,false,kwd.first}; @@ -4487,7 +4487,7 @@ void das2_collect_keywords ( Module * mod, yyscan_t yyscanner ) { auto it = yyextra->das_keywords.find(tfun); if ( it != yyextra->das_keywords.end() && it->second.keyword!=keyword ) { yyextra->g_Program->error("mismatching type function " + tfun + " in module " + mod->name, - it->second.keyword + " is already defined","",LineInfo()); + it->second.keyword + " is already defined","",LineInfo(), CompilationError::mismatching_module_name); return; } yyextra->das_keywords[tfun] = DasKeyword{false,true,keyword}; diff --git a/src/parser/ds2_lexer.lpp b/src/parser/ds2_lexer.lpp index 5015b6a973..5eee11f246 100644 --- a/src/parser/ds2_lexer.lpp +++ b/src/parser/ds2_lexer.lpp @@ -86,7 +86,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, string incFileName = yyextra->g_Access->getIncludeFileName(cfi->name,lFile); auto info = yyextra->g_Access->getFileInfo(incFileName); if ( !info ) { - das2_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName); + das2_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName, CompilationError::lookup_file); } else { yyextra->g_FileAccessStack.pop_back(); yyextra->g_FileAccessStack.push_back(info); @@ -95,10 +95,10 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } } else { das2_yyfatalerror(yylloc_param,yyscanner,"can't process line directive " + string(yytext), - CompilationError::invalid_line_directive); return LEXER_ERROR; + CompilationError::invalid_line); return LEXER_ERROR; } } -"*/" das2_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::unexpected_close_comment); return LEXER_ERROR; +"*/" das2_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::invalid_line); return LEXER_ERROR; "/*" { BEGIN(c_comment); yyextra->das_c_style_depth = 1; @@ -155,11 +155,11 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } } <> { - das2_yyfatalerror(yylloc_param,yyscanner,"end of file encountered inside c-style comment", CompilationError::comment_contains_eof); + das2_yyfatalerror(yylloc_param,yyscanner,"end of file encountered inside c-style comment", CompilationError::exceeds_file); BEGIN(normal); } <> { - das2_yyfatalerror(yylloc_param,yyscanner,"reader constant exceeds file", CompilationError::string_constant_exceeds_file); + das2_yyfatalerror(yylloc_param,yyscanner,"reader constant exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_OF_READ; } @@ -179,7 +179,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } \{ { if ( yyextra->das_nested_sb ) { - das2_yyfatalerror(yylloc_param,yyscanner,"nested string constants are not allowed", CompilationError::nested_string_constant); + das2_yyfatalerror(yylloc_param,yyscanner,"nested string constants are not allowed", CompilationError::invalid_string); BEGIN(normal); return END_STRING; } @@ -188,7 +188,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, return BEGIN_STRING_EXPR; } <> { - das2_yyfatalerror(yylloc_param,yyscanner,"string constant exceeds file", CompilationError::string_constant_exceeds_file); + das2_yyfatalerror(yylloc_param,yyscanner,"string constant exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_STRING; } @@ -214,7 +214,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, return STRING_CHARACTER; } <> { - das2_yyfatalerror(yylloc_param,yyscanner,"string format exceeds file", CompilationError::string_constant_exceeds_file); + das2_yyfatalerror(yylloc_param,yyscanner,"string format exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_STRING; } @@ -241,7 +241,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, string incFileName = yyextra->g_Access->getIncludeFileName(cfi->name,yytext); auto info = yyextra->g_Access->getFileInfo(incFileName); if ( !info ) { - das2_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName); + das2_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName, CompilationError::lookup_file); } else { if ( yyextra->das_already_include.find(incFileName) == yyextra->das_already_include.end() ) { yyextra->das_already_include.insert(incFileName); @@ -417,7 +417,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->ui64); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -428,7 +428,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i64); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-1 ) { return LEXER_ERROR; } @@ -440,7 +440,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, uint8_t u8_const; auto res = fast_float::from_chars(temptext, temptext+templength, u8_const); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -452,7 +452,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->ui); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-1 ) { return LEXER_ERROR; } @@ -463,7 +463,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -478,7 +478,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength ) { return LEXER_ERROR; } @@ -489,7 +489,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui64, 16); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-2 ) { return LEXER_ERROR; } @@ -500,7 +500,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui64, 16); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-1 ) { return LEXER_ERROR; } @@ -513,7 +513,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, uint8_t u8_const; auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext)-2, u8_const, 16); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-2 ) { return LEXER_ERROR; } @@ -522,7 +522,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } else { auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui, 16); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-1 ) { return LEXER_ERROR; } @@ -534,7 +534,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui, 16); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext) ) { return LEXER_ERROR; } @@ -543,7 +543,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, ([0-9]*)?\.[0-9]+([eE][+\-]?[0-9]+)?(f|F)? { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -552,7 +552,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9][0-9]*\.[0-9]+?([eE][+\-]?[0-9]+)?(f|F)? { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -562,7 +562,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9]+(f|F) { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -571,7 +571,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9]+[eE][+\-]?[0-9]+(f|F)? { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -580,7 +580,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, ([0-9]*)?\.[0-9]+([eE][+\-]?[0-9]+)?(lf|d) { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -589,7 +589,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9][0-9]*\.[0-9]+?([eE][+\-]?[0-9]+)?(lf|d)? { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -598,7 +598,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9]+(lf|d) { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -607,7 +607,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9]+[eE][+\-]?[0-9]+(lf|d) { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das2_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -615,7 +615,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } \) { if ( !yyextra->das_nested_parentheses ) { - das2_yyfatalerror(yylloc_param,yyscanner,"mismatching parentheses", CompilationError::mismatching_parentheses); + das2_yyfatalerror(yylloc_param,yyscanner,"mismatching parentheses", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_parentheses --; @@ -627,7 +627,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } \] { if ( !yyextra->das_nested_square_braces ) { - das2_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das2_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_square_braces --; @@ -807,7 +807,7 @@ void das2_collect_keywords ( Module * mod, yyscan_t yyscanner ) { auto it = yyextra->das_keywords.find(kwd.first); if ( it != yyextra->das_keywords.end() && it->second.keyword!=kwd.first ) { yyextra->g_Program->error("mismatching keyword " + kwd.first + " in module " + mod->name, - it->second.keyword + " is already defined","",LineInfo()); + it->second.keyword + " is already defined","",LineInfo(), CompilationError::mismatching_module_name); return; } yyextra->das_keywords[kwd.first] = DasKeyword{kwd.second,false,kwd.first}; @@ -817,7 +817,7 @@ void das2_collect_keywords ( Module * mod, yyscan_t yyscanner ) { auto it = yyextra->das_keywords.find(tfun); if ( it != yyextra->das_keywords.end() && it->second.keyword!=keyword ) { yyextra->g_Program->error("mismatching type function " + tfun + " in module " + mod->name, - it->second.keyword + " is already defined","",LineInfo()); + it->second.keyword + " is already defined","",LineInfo(), CompilationError::mismatching_module_name); return; } yyextra->das_keywords[tfun] = DasKeyword{false,true,keyword}; diff --git a/src/parser/ds2_parser.cpp b/src/parser/ds2_parser.cpp index 6c8c24afd6..ddaa162460 100644 --- a/src/parser/ds2_parser.cpp +++ b/src/parser/ds2_parser.cpp @@ -5464,7 +5464,7 @@ YYLTYPE yylloc = yyloc_default; case 3: /* program: program module_declaration */ { if ( yyextra->das_has_type_declarations ) { - das2_yyerror(scanner,"module name has to be first declaration",tokAt(scanner,(yylsp[0])), CompilationError::syntax_error); + das2_yyerror(scanner,"module name has to be first declaration",tokAt(scanner,(yylsp[0])), CompilationError::invalid_module); } } break; @@ -5545,7 +5545,7 @@ YYLTYPE yylloc = yyloc_default; yyextra->g_Program->library.renameModule(yyextra->g_Program->thisModule.get(),*(yyvsp[-3].s)); } else if ( yyextra->g_Program->thisModule->name != *(yyvsp[-3].s) ){ das2_yyerror(scanner,"this module already has a name " + yyextra->g_Program->thisModule->name,tokAt(scanner,(yylsp[-3])), - CompilationError::module_already_has_a_name); + CompilationError::already_declared_module_name); } if ( !yyextra->g_Program->policies.ignore_shared_modules ) { yyextra->g_Program->promoteToBuiltin = (yyvsp[-2].b); @@ -5610,7 +5610,7 @@ YYLTYPE yylloc = yyloc_default; { bool err; auto esconst = unescapeString(*(yyvsp[0].s),&err); - if ( err ) das2_yyerror(scanner,"invalid escape sequence",tokAt(scanner,(yylsp[-1])), CompilationError::invalid_escape_sequence); + if ( err ) das2_yyerror(scanner,"invalid escape sequence",tokAt(scanner,(yylsp[-1])), CompilationError::invalid_escape); auto sc = new ExprConstString(tokAt(scanner,(yylsp[0])),esconst); delete (yyvsp[0].s); static_cast((yyvsp[-1].pExpression))->elements.push_back(sc); @@ -5670,17 +5670,17 @@ YYLTYPE yylloc = yyloc_default; auto macros = yyextra->g_Program->getReaderMacro(*(yyvsp[0].s)); if ( macros.size()==0 ) { das2_yyerror(scanner,"reader macro " + *(yyvsp[0].s) + " not found",tokAt(scanner,(yylsp[0])), - CompilationError::unsupported_read_macro); + CompilationError::lookup_macro); } else if ( macros.size()>1 ) { string options; for ( auto & x : macros ) { options += "\t" + x->module->name + "::" + x->name + "\n"; } das2_yyerror(scanner,"too many options for the reader macro " + *(yyvsp[0].s) + "\n" + options, tokAt(scanner,(yylsp[0])), - CompilationError::unsupported_read_macro); + CompilationError::ambiguous_macro); } else if ( yychar != '~' ) { das2_yyerror(scanner,"expecting ~ after the reader macro", tokAt(scanner,(yylsp[0])), - CompilationError::syntax_error); + CompilationError::invalid_macro); } else { yyextra->g_ReaderMacro = macros.back(); yyextra->g_ReaderExpr = new ExprReader(tokAt(scanner,(yylsp[-1])),yyextra->g_ReaderMacro); @@ -5716,7 +5716,7 @@ YYLTYPE yylloc = yyloc_default; yyextra->g_Program->options.push_back(opt); } else { das2_yyerror(scanner,"option " + opt.name + " is not allowed here", - tokAt(scanner,(yylsp[0])), CompilationError::invalid_option); + tokAt(scanner,(yylsp[0])), CompilationError::invalid_options); } } delete (yyvsp[0].aaList); @@ -6279,7 +6279,7 @@ YYLTYPE yylloc = yyloc_default; } else { (yyval.fa)->annotation = new Annotation(*(yyvsp[0].s)); das2_yyerror(scanner,"annotation " + *(yyvsp[0].s) + " is not found", - tokAt(scanner,(yylsp[0])), CompilationError::invalid_annotation); + tokAt(scanner,(yylsp[0])), CompilationError::lookup_annotation); } } else { (yyval.fa)->annotation = new Annotation(*(yyvsp[0].s)); @@ -6300,7 +6300,7 @@ YYLTYPE yylloc = yyloc_default; } else { (yyval.fa)->annotation = new Annotation(*(yyvsp[-3].s)); das2_yyerror(scanner,"annotation " + *(yyvsp[-3].s) + " is not found", - tokAt(scanner,(yylsp[-3])), CompilationError::invalid_annotation); + tokAt(scanner,(yylsp[-3])), CompilationError::lookup_annotation); } } else { (yyval.fa)->annotation = new Annotation(*(yyvsp[-3].s)); @@ -6940,7 +6940,7 @@ YYLTYPE yylloc = yyloc_default; if ( !yyextra->g_Program->addFunction((yyvsp[0].pFuncDecl)) ) { das2_yyerror(scanner,"function is already defined " + (yyvsp[0].pFuncDecl)->getMangledName(),(yyvsp[0].pFuncDecl)->at, - CompilationError::function_already_declared); + CompilationError::already_declared_function); } } (yyvsp[0].pFuncDecl)->delRef(); @@ -9193,7 +9193,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.pEnumList) = new Enumeration(); if ( !(yyval.pEnumList)->add((yyvsp[0].pEnumPair)->name,(yyvsp[0].pEnumPair)->expr,(yyvsp[0].pEnumPair)->at) ) { das2_yyerror(scanner,"enumeration already declared " + (yyvsp[0].pEnumPair)->name, (yyvsp[0].pEnumPair)->at, - CompilationError::enumeration_value_already_declared); + CompilationError::already_declared_enumerator); } if ( !yyextra->g_CommentReaders.empty() ) { for ( auto & crd : yyextra->g_CommentReaders ) { @@ -9208,7 +9208,7 @@ YYLTYPE yylloc = yyloc_default; { if ( !(yyvsp[-2].pEnumList)->add((yyvsp[0].pEnumPair)->name,(yyvsp[0].pEnumPair)->expr,(yyvsp[0].pEnumPair)->at) ) { das2_yyerror(scanner,"enumeration already declared " + (yyvsp[0].pEnumPair)->name, (yyvsp[0].pEnumPair)->at, - CompilationError::enumeration_value_already_declared); + CompilationError::already_declared_enumerator); } if ( !yyextra->g_CommentReaders.empty() ) { for ( auto & crd : yyextra->g_CommentReaders ) { @@ -9247,12 +9247,12 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[0].pTypeDecl)->isPrivateAlias = !(yyvsp[-4].b); if ( (yyvsp[0].pTypeDecl)->baseType == Type::alias ) { das2_yyerror(scanner,"alias cannot be defined in terms of another alias "+*(yyvsp[-3].s),tokAt(scanner,(yylsp[-3])), - CompilationError::invalid_type); + CompilationError::invalid_type_alias); } (yyvsp[0].pTypeDecl)->alias = *(yyvsp[-3].s); if ( !yyextra->g_Program->addAlias((yyvsp[0].pTypeDecl)) ) { das2_yyerror(scanner,"type alias is already defined "+*(yyvsp[-3].s),tokAt(scanner,(yylsp[-3])), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto pubename = tokAt(scanner,(yylsp[0])); @@ -9793,7 +9793,7 @@ YYLTYPE yylloc = yyloc_default; auto maxBits = (yyval.pTypeDecl)->maxBitfieldBits(); if ( (yyval.pTypeDecl)->argNames.size()>maxBits ) { das_yyerror(scanner,"only " + to_string(maxBits) + " different bits are allowed in a bitfield",tokAt(scanner,(yylsp[-5])), - CompilationError::invalid_type); + CompilationError::exceeds_bitfield); } (yyval.pTypeDecl)->at = tokAt(scanner,(yylsp[-5])); delete (yyvsp[-2].pNameList); @@ -9852,10 +9852,10 @@ YYLTYPE yylloc = yyloc_default; { if ( (yyvsp[-1].pTypeDecl)->baseType==Type::typeDecl ) { das2_yyerror(scanner,"type declaration can`t be used as array base type",tokAt(scanner,(yylsp[-1])), - CompilationError::invalid_type); + CompilationError::invalid_array_type); } else if ( (yyvsp[-1].pTypeDecl)->baseType==Type::typeMacro ) { das2_yyerror(scanner,"macro can`t be used as array base type",tokAt(scanner,(yylsp[-1])), - CompilationError::invalid_type); + CompilationError::invalid_array_type); } (yyvsp[-1].pTypeDecl)->dim.insert((yyvsp[-1].pTypeDecl)->dim.begin(), (yyvsp[0].pTypeDecl)->dim.begin(), (yyvsp[0].pTypeDecl)->dim.end()); (yyvsp[-1].pTypeDecl)->dimExpr.insert((yyvsp[-1].pTypeDecl)->dimExpr.begin(), (yyvsp[0].pTypeDecl)->dimExpr.begin(), (yyvsp[0].pTypeDecl)->dimExpr.end()); @@ -10372,7 +10372,7 @@ YYLTYPE yylloc = yyloc_default; deleteVariableDeclarationList((yyvsp[-3].pVarDeclList)); if ( !yyextra->g_Program->addAlias(vtype) ) { das2_yyerror(scanner,"type alias is already defined "+*(yyvsp[-8].s),tokAt(scanner,(yylsp[-8])), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,(yylsp[-8])); @@ -10427,7 +10427,7 @@ YYLTYPE yylloc = yyloc_default; deleteVariableDeclarationList((yyvsp[-3].pVarDeclList)); if ( !yyextra->g_Program->addAlias(vtype) ) { das2_yyerror(scanner,"type alias is already defined "+*(yyvsp[-8].s),tokAt(scanner,(yylsp[-8])), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,(yylsp[-8])); @@ -10485,7 +10485,7 @@ YYLTYPE yylloc = yyloc_default; auto maxBits = btype->maxBitfieldBits(); if ( btype->argNames.size()>maxBits ) { das_yyerror(scanner,"only " + to_string(maxBits) + " different bits are allowed in a bitfield",tokAt(scanner,(yylsp[-9])), - CompilationError::invalid_type); + CompilationError::exceeds_bitfield); } for ( auto & p : *(yyvsp[-3].pNameExprList) ) { if ( get<1>(p) ) { @@ -10494,7 +10494,7 @@ YYLTYPE yylloc = yyloc_default; } if ( !yyextra->g_Program->addAlias(btype) ) { das2_yyerror(scanner,"type alias is already defined "+*(yyvsp[-9].s),tokAt(scanner,(yylsp[-9])), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,(yylsp[-9])); @@ -11360,7 +11360,7 @@ void das2_yyerror ( DAS2_YYLTYPE * lloc, yyscan_t scanner, const string & error if ( !yyextra->das_suppress_errors ) { yyextra->g_Program->error(error,"","",LineInfo(yyextra->g_FileAccessStack.back(), lloc->first_column,lloc->first_line,lloc->last_column,lloc->last_line), - CompilationError::syntax_error); + CompilationError::invalid_expression); } } diff --git a/src/parser/ds2_parser.ypp b/src/parser/ds2_parser.ypp index ad080954a9..2d3aa9ccd4 100644 --- a/src/parser/ds2_parser.ypp +++ b/src/parser/ds2_parser.ypp @@ -566,7 +566,7 @@ program : | program module_declaration { if ( yyextra->das_has_type_declarations ) { - das2_yyerror(scanner,"module name has to be first declaration",tokAt(scanner,@module_declaration), CompilationError::syntax_error); + das2_yyerror(scanner,"module name has to be first declaration",tokAt(scanner,@module_declaration), CompilationError::invalid_module); } } | program structure_declaration { yyextra->das_has_type_declarations = true; } @@ -626,7 +626,7 @@ module_declaration yyextra->g_Program->library.renameModule(yyextra->g_Program->thisModule.get(),*$name); } else if ( yyextra->g_Program->thisModule->name != *$name ){ das2_yyerror(scanner,"this module already has a name " + yyextra->g_Program->thisModule->name,tokAt(scanner,@name), - CompilationError::module_already_has_a_name); + CompilationError::already_declared_module_name); } if ( !yyextra->g_Program->policies.ignore_shared_modules ) { yyextra->g_Program->promoteToBuiltin = $mtype; @@ -666,7 +666,7 @@ string_builder_body | string_builder_body[sb] character_sequence[sconst] %prec STRING_CHARACTER { bool err; auto esconst = unescapeString(*$sconst,&err); - if ( err ) das2_yyerror(scanner,"invalid escape sequence",tokAt(scanner,@sb), CompilationError::invalid_escape_sequence); + if ( err ) das2_yyerror(scanner,"invalid escape sequence",tokAt(scanner,@sb), CompilationError::invalid_escape); auto sc = new ExprConstString(tokAt(scanner,@sconst),esconst); delete $sconst; static_cast($sb)->elements.push_back(sc); @@ -720,17 +720,17 @@ expr_reader auto macros = yyextra->g_Program->getReaderMacro(*$mark); if ( macros.size()==0 ) { das2_yyerror(scanner,"reader macro " + *$mark + " not found",tokAt(scanner,@mark), - CompilationError::unsupported_read_macro); + CompilationError::lookup_macro); } else if ( macros.size()>1 ) { string options; for ( auto & x : macros ) { options += "\t" + x->module->name + "::" + x->name + "\n"; } das2_yyerror(scanner,"too many options for the reader macro " + *$mark + "\n" + options, tokAt(scanner,@mark), - CompilationError::unsupported_read_macro); + CompilationError::ambiguous_macro); } else if ( yychar != '~' ) { das2_yyerror(scanner,"expecting ~ after the reader macro", tokAt(scanner,@mark), - CompilationError::syntax_error); + CompilationError::invalid_macro); } else { yyextra->g_ReaderMacro = macros.back(); yyextra->g_ReaderExpr = new ExprReader(tokAt(scanner,@loc),yyextra->g_ReaderMacro); @@ -761,7 +761,7 @@ options_declaration yyextra->g_Program->options.push_back(opt); } else { das2_yyerror(scanner,"option " + opt.name + " is not allowed here", - tokAt(scanner,@list), CompilationError::invalid_option); + tokAt(scanner,@list), CompilationError::invalid_options); } } delete $list; @@ -1159,7 +1159,7 @@ annotation_declaration_basic } else { $$->annotation = new Annotation(*$name); das2_yyerror(scanner,"annotation " + *$name + " is not found", - tokAt(scanner,@name), CompilationError::invalid_annotation); + tokAt(scanner,@name), CompilationError::lookup_annotation); } } else { $$->annotation = new Annotation(*$name); @@ -1177,7 +1177,7 @@ annotation_declaration_basic } else { $$->annotation = new Annotation(*$name); das2_yyerror(scanner,"annotation " + *$name + " is not found", - tokAt(scanner,@name), CompilationError::invalid_annotation); + tokAt(scanner,@name), CompilationError::lookup_annotation); } } else { $$->annotation = new Annotation(*$name); @@ -1439,7 +1439,7 @@ global_function_declaration if ( !yyextra->g_Program->addFunction($func) ) { das2_yyerror(scanner,"function is already defined " + $func->getMangledName(),$func->at, - CompilationError::function_already_declared); + CompilationError::already_declared_function); } } $func->delRef(); @@ -2796,7 +2796,7 @@ enum_list $$ = new Enumeration(); if ( !$$->add($eE->name,$eE->expr,$eE->at) ) { das2_yyerror(scanner,"enumeration already declared " + $eE->name, $eE->at, - CompilationError::enumeration_value_already_declared); + CompilationError::already_declared_enumerator); } if ( !yyextra->g_CommentReaders.empty() ) { for ( auto & crd : yyextra->g_CommentReaders ) { @@ -2808,7 +2808,7 @@ enum_list | enum_list[pE] commas enum_expression[eE] { if ( !$pE->add($eE->name,$eE->expr,$eE->at) ) { das2_yyerror(scanner,"enumeration already declared " + $eE->name, $eE->at, - CompilationError::enumeration_value_already_declared); + CompilationError::already_declared_enumerator); } if ( !yyextra->g_CommentReaders.empty() ) { for ( auto & crd : yyextra->g_CommentReaders ) { @@ -2839,12 +2839,12 @@ single_alias $tdecl->isPrivateAlias = !$pubA; if ( $tdecl->baseType == Type::alias ) { das2_yyerror(scanner,"alias cannot be defined in terms of another alias "+*$name,tokAt(scanner,@name), - CompilationError::invalid_type); + CompilationError::invalid_type_alias); } $tdecl->alias = *$name; if ( !yyextra->g_Program->addAlias($tdecl) ) { das2_yyerror(scanner,"type alias is already defined "+*$name,tokAt(scanner,@name), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto pubename = tokAt(scanner,@tdecl); @@ -3189,7 +3189,7 @@ bitfield_type_declaration auto maxBits = $$->maxBitfieldBits(); if ( $$->argNames.size()>maxBits ) { das_yyerror(scanner,"only " + to_string(maxBits) + " different bits are allowed in a bitfield",tokAt(scanner,@basicType), - CompilationError::invalid_type); + CompilationError::exceeds_bitfield); } $$->at = tokAt(scanner,@basicType); delete $nl; @@ -3238,10 +3238,10 @@ type_declaration_no_options | type_declaration_no_options_no_dim[typeDecl] dim_list[dimlist] { if ( $typeDecl->baseType==Type::typeDecl ) { das2_yyerror(scanner,"type declaration can`t be used as array base type",tokAt(scanner,@typeDecl), - CompilationError::invalid_type); + CompilationError::invalid_array_type); } else if ( $typeDecl->baseType==Type::typeMacro ) { das2_yyerror(scanner,"macro can`t be used as array base type",tokAt(scanner,@typeDecl), - CompilationError::invalid_type); + CompilationError::invalid_array_type); } $typeDecl->dim.insert($typeDecl->dim.begin(), $dimlist->dim.begin(), $dimlist->dim.end()); $typeDecl->dimExpr.insert($typeDecl->dimExpr.begin(), $dimlist->dimExpr.begin(), $dimlist->dimExpr.end()); @@ -3511,7 +3511,7 @@ tuple_alias_declaration deleteVariableDeclarationList($list); if ( !yyextra->g_Program->addAlias(vtype) ) { das2_yyerror(scanner,"type alias is already defined "+*$vname,tokAt(scanner,@vname), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,@vname); @@ -3550,7 +3550,7 @@ variant_alias_declaration deleteVariableDeclarationList($list); if ( !yyextra->g_Program->addAlias(vtype) ) { das2_yyerror(scanner,"type alias is already defined "+*$vname,tokAt(scanner,@vname), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,@vname); @@ -3592,7 +3592,7 @@ bitfield_alias_declaration auto maxBits = btype->maxBitfieldBits(); if ( btype->argNames.size()>maxBits ) { das_yyerror(scanner,"only " + to_string(maxBits) + " different bits are allowed in a bitfield",tokAt(scanner,@vname), - CompilationError::invalid_type); + CompilationError::exceeds_bitfield); } for ( auto & p : *$list ) { if ( get<1>(p) ) { @@ -3601,7 +3601,7 @@ bitfield_alias_declaration } if ( !yyextra->g_Program->addAlias(btype) ) { das2_yyerror(scanner,"type alias is already defined "+*$vname,tokAt(scanner,@vname), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,@vname); @@ -4041,7 +4041,7 @@ void das2_yyerror ( DAS2_YYLTYPE * lloc, yyscan_t scanner, const string & error if ( !yyextra->das_suppress_errors ) { yyextra->g_Program->error(error,"","",LineInfo(yyextra->g_FileAccessStack.back(), lloc->first_column,lloc->first_line,lloc->last_column,lloc->last_line), - CompilationError::syntax_error); + CompilationError::invalid_expression); } } diff --git a/src/parser/ds_lexer.cpp b/src/parser/ds_lexer.cpp index c900fde427..b6de502ddf 100644 --- a/src/parser/ds_lexer.cpp +++ b/src/parser/ds_lexer.cpp @@ -1696,7 +1696,7 @@ YY_RULE_SETUP string incFileName = yyextra->g_Access->getIncludeFileName(cfi->name,lFile); auto info = yyextra->g_Access->getFileInfo(incFileName); if ( !info ) { - das_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName); + das_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName, CompilationError::lookup_file); } else { yyextra->g_FileAccessStack.pop_back(); yyextra->g_FileAccessStack.push_back(info); @@ -1705,14 +1705,14 @@ YY_RULE_SETUP } } else { das_yyfatalerror(yylloc_param,yyscanner,"can't process line directive " + string(yytext), - CompilationError::invalid_line_directive); return LEXER_ERROR; + CompilationError::invalid_line); return LEXER_ERROR; } } YY_BREAK case 2: YY_RULE_SETUP #line 101 "ds_lexer.lpp" -das_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::unexpected_close_comment); return LEXER_ERROR; +das_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::invalid_line); return LEXER_ERROR; YY_BREAK case 3: YY_RULE_SETUP @@ -1730,7 +1730,7 @@ YY_RULE_SETUP case 4: YY_RULE_SETUP #line 111 "ds_lexer.lpp" -das_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::unexpected_close_comment); return LEXER_ERROR; +das_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::invalid_line); return LEXER_ERROR; YY_BREAK case 5: YY_RULE_SETUP @@ -1845,14 +1845,14 @@ YY_RULE_SETUP case YY_STATE_EOF(c_comment): #line 181 "ds_lexer.lpp" { - das_yyfatalerror(yylloc_param,yyscanner,"end of file encountered inside c-style comment", CompilationError::comment_contains_eof); + das_yyfatalerror(yylloc_param,yyscanner,"end of file encountered inside c-style comment", CompilationError::exceeds_file); BEGIN(normal); } YY_BREAK case YY_STATE_EOF(reader): #line 185 "ds_lexer.lpp" { - das_yyfatalerror(yylloc_param,yyscanner,"reader constant exceeds file", CompilationError::string_constant_exceeds_file); + das_yyfatalerror(yylloc_param,yyscanner,"reader constant exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_OF_READ; } @@ -1889,7 +1889,7 @@ YY_RULE_SETUP #line 204 "ds_lexer.lpp" { if ( yyextra->das_nested_sb ) { - das_yyfatalerror(yylloc_param,yyscanner,"nested string constants are not allowed", CompilationError::nested_string_constant); + das_yyfatalerror(yylloc_param,yyscanner,"nested string constants are not allowed", CompilationError::invalid_string); BEGIN(normal); return END_STRING; } @@ -1901,7 +1901,7 @@ YY_RULE_SETUP case YY_STATE_EOF(strb): #line 214 "ds_lexer.lpp" { - das_yyfatalerror(yylloc_param,yyscanner,"string constant exceeds file", CompilationError::string_constant_exceeds_file); + das_yyfatalerror(yylloc_param,yyscanner,"string constant exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_STRING; } @@ -1956,7 +1956,7 @@ YY_RULE_SETUP case YY_STATE_EOF(strfmt): #line 241 "ds_lexer.lpp" { - das_yyfatalerror(yylloc_param,yyscanner,"string format exceeds file", CompilationError::string_constant_exceeds_file); + das_yyfatalerror(yylloc_param,yyscanner,"string format exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_STRING; } @@ -2050,14 +2050,14 @@ YY_RULE_SETUP #ifdef FLEX_DEBUG printf("INVALID INDENT at %i, emit BEGIN_STRING\n", yyextra->das_current_line_indent); #endif - das_yyfatalerror(yylloc_param,yyscanner,"invalid indentation"); // pretend tab was pressed + das_yyfatalerror(yylloc_param,yyscanner,"invalid indentation", CompilationError::invalid_line); // pretend tab was pressed return BEGIN_STRING; } if ( yyextra->das_current_line_indent % yyextra->das_tab_size ) { #ifdef FLEX_DEBUG printf("INVALID INDENT at %i, emit {\n", yyextra->das_current_line_indent); #endif - das_yyfatalerror(yylloc_param,yyscanner,"invalid indentation"); // pretend tab was pressed + das_yyfatalerror(yylloc_param,yyscanner,"invalid indentation", CompilationError::invalid_line); // pretend tab was pressed yyextra->das_current_line_indent = (yyextra->das_current_line_indent + yyextra->das_tab_size) & ~(yyextra->das_tab_size-1); } yylval_param->i = yyextra->das_indent_level; @@ -2132,7 +2132,7 @@ YY_RULE_SETUP string incFileName = yyextra->g_Access->getIncludeFileName(cfi->name,yytext); auto info = yyextra->g_Access->getFileInfo(incFileName); if ( !info ) { - das_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName); + das_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName, CompilationError::lookup_file); } else { if ( yyextra->das_already_include.find(incFileName) == yyextra->das_already_include.end() ) { yyextra->das_already_include.insert(incFileName); @@ -2858,7 +2858,7 @@ YY_RULE_SETUP int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->ui64); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -2873,7 +2873,7 @@ YY_RULE_SETUP int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i64); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-1 ) { return LEXER_ERROR; } @@ -2889,7 +2889,7 @@ YY_RULE_SETUP uint8_t u8_const; auto res = fast_float::from_chars(temptext, temptext+templength, u8_const); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -2905,7 +2905,7 @@ YY_RULE_SETUP int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->ui); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-1 ) { return LEXER_ERROR; } @@ -2920,7 +2920,7 @@ YY_RULE_SETUP int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -2939,7 +2939,7 @@ YY_RULE_SETUP int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength ) { return LEXER_ERROR; } @@ -2954,7 +2954,7 @@ YY_RULE_SETUP skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui64, 16); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-2 ) { return LEXER_ERROR; } @@ -2969,7 +2969,7 @@ YY_RULE_SETUP skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui64, 16); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-1 ) { return LEXER_ERROR; } @@ -2986,7 +2986,7 @@ YY_RULE_SETUP uint8_t u8_const; auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext)-2, u8_const, 16); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-2 ) { return LEXER_ERROR; } @@ -2995,7 +2995,7 @@ YY_RULE_SETUP } else { auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui, 16); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-1 ) { return LEXER_ERROR; } @@ -3011,7 +3011,7 @@ YY_RULE_SETUP skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui, 16); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext) ) { return LEXER_ERROR; } @@ -3024,7 +3024,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -3037,7 +3037,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -3051,7 +3051,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -3064,7 +3064,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -3077,7 +3077,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -3090,7 +3090,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -3103,7 +3103,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -3116,7 +3116,7 @@ YY_RULE_SETUP { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -3128,7 +3128,7 @@ YY_RULE_SETUP #line 749 "ds_lexer.lpp" { if ( !yyextra->das_nested_parentheses ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching parentheses", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching parentheses", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_parentheses --; @@ -3148,7 +3148,7 @@ YY_RULE_SETUP #line 761 "ds_lexer.lpp" { if ( !yyextra->das_nested_square_braces ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_square_braces --; @@ -3652,7 +3652,7 @@ YY_RULE_SETUP #line 987 "ds_lexer.lpp" { if ( yyextra->das_nested_curly_braces < 2 ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_curly_bracers); return LEXER_ERROR; } const auto txt = string(yytext); @@ -3672,11 +3672,11 @@ YY_RULE_SETUP #line 1003 "ds_lexer.lpp" { if ( !yyextra->das_nested_curly_braces ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_curly_bracers); return LEXER_ERROR; } if ( !yyextra->das_nested_square_braces ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } const auto txt = string(yytext); @@ -3697,11 +3697,11 @@ YY_RULE_SETUP #line 1024 "ds_lexer.lpp" { if ( !yyextra->das_nested_curly_braces ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_curly_bracers); return LEXER_ERROR; } if ( !yyextra->das_nested_square_braces ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } const auto txt = string(yytext); @@ -3722,7 +3722,7 @@ YY_RULE_SETUP #line 1045 "ds_lexer.lpp" { if ( yyextra->das_nested_square_braces < 2) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_square_braces -= 2; @@ -3743,7 +3743,7 @@ YY_RULE_SETUP #line 1062 "ds_lexer.lpp" { if ( yyextra->das_nested_square_braces < 2) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_square_braces -= 2; @@ -5067,7 +5067,7 @@ void das_collect_keywords ( Module * mod, yyscan_t yyscanner ) { auto it = yyextra->das_keywords.find(kwd.first); if ( it != yyextra->das_keywords.end() && it->second.keyword!=kwd.first ) { yyextra->g_Program->error("mismatching keyword " + kwd.first + " in module " + mod->name, - it->second.keyword + " is already defined","",LineInfo()); + it->second.keyword + " is already defined","",LineInfo(), CompilationError::mismatching_module_name); return; } yyextra->das_keywords[kwd.first] = DasKeyword{kwd.second,false,kwd.first}; @@ -5077,7 +5077,7 @@ void das_collect_keywords ( Module * mod, yyscan_t yyscanner ) { auto it = yyextra->das_keywords.find(tfun); if ( it != yyextra->das_keywords.end() && it->second.keyword!=keyword ) { yyextra->g_Program->error("mismatching type function " + tfun + " in module " + mod->name, - it->second.keyword + " is already defined","",LineInfo()); + it->second.keyword + " is already defined","",LineInfo(), CompilationError::mismatching_module_name); return; } yyextra->das_keywords[tfun] = DasKeyword{false,true,keyword}; diff --git a/src/parser/ds_lexer.lpp b/src/parser/ds_lexer.lpp index d013a34f0a..69b4ce4a5b 100644 --- a/src/parser/ds_lexer.lpp +++ b/src/parser/ds_lexer.lpp @@ -86,7 +86,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, string incFileName = yyextra->g_Access->getIncludeFileName(cfi->name,lFile); auto info = yyextra->g_Access->getFileInfo(incFileName); if ( !info ) { - das_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName); + das_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName, CompilationError::lookup_file); } else { yyextra->g_FileAccessStack.pop_back(); yyextra->g_FileAccessStack.push_back(info); @@ -95,10 +95,10 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } } else { das_yyfatalerror(yylloc_param,yyscanner,"can't process line directive " + string(yytext), - CompilationError::invalid_line_directive); return LEXER_ERROR; + CompilationError::invalid_line); return LEXER_ERROR; } } -"*/" das_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::unexpected_close_comment); return LEXER_ERROR; +"*/" das_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::invalid_line); return LEXER_ERROR; "/*" { BEGIN(c_comment); yyextra->das_c_style_depth = 1; @@ -108,7 +108,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, for ( auto & crd : yyextra->g_CommentReaders ) crd->open(false, tak); } } -"*/" das_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::unexpected_close_comment); return LEXER_ERROR; +"*/" das_yyfatalerror(yylloc_param,yyscanner,"Unexpected */", CompilationError::invalid_line); return LEXER_ERROR; "/*" { BEGIN(c_comment); yyextra->das_c_style_depth = 1; @@ -179,11 +179,11 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } } <> { - das_yyfatalerror(yylloc_param,yyscanner,"end of file encountered inside c-style comment", CompilationError::comment_contains_eof); + das_yyfatalerror(yylloc_param,yyscanner,"end of file encountered inside c-style comment", CompilationError::exceeds_file); BEGIN(normal); } <> { - das_yyfatalerror(yylloc_param,yyscanner,"reader constant exceeds file", CompilationError::string_constant_exceeds_file); + das_yyfatalerror(yylloc_param,yyscanner,"reader constant exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_OF_READ; } @@ -203,7 +203,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } \{ { if ( yyextra->das_nested_sb ) { - das_yyfatalerror(yylloc_param,yyscanner,"nested string constants are not allowed", CompilationError::nested_string_constant); + das_yyfatalerror(yylloc_param,yyscanner,"nested string constants are not allowed", CompilationError::invalid_string); BEGIN(normal); return END_STRING; } @@ -212,7 +212,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, return BEGIN_STRING_EXPR; } <> { - das_yyfatalerror(yylloc_param,yyscanner,"string constant exceeds file", CompilationError::string_constant_exceeds_file); + das_yyfatalerror(yylloc_param,yyscanner,"string constant exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_STRING; } @@ -239,7 +239,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, return STRING_CHARACTER; } <> { - das_yyfatalerror(yylloc_param,yyscanner,"string format exceeds file", CompilationError::string_constant_exceeds_file); + das_yyfatalerror(yylloc_param,yyscanner,"string format exceeds file", CompilationError::exceeds_file); BEGIN(normal); return END_STRING; } @@ -294,14 +294,14 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, #ifdef FLEX_DEBUG printf("INVALID INDENT at %i, emit BEGIN_STRING\n", yyextra->das_current_line_indent); #endif - das_yyfatalerror(yylloc_param,yyscanner,"invalid indentation"); // pretend tab was pressed + das_yyfatalerror(yylloc_param,yyscanner,"invalid indentation", CompilationError::invalid_line); // pretend tab was pressed return BEGIN_STRING; } if ( yyextra->das_current_line_indent % yyextra->das_tab_size ) { #ifdef FLEX_DEBUG printf("INVALID INDENT at %i, emit {\n", yyextra->das_current_line_indent); #endif - das_yyfatalerror(yylloc_param,yyscanner,"invalid indentation"); // pretend tab was pressed + das_yyfatalerror(yylloc_param,yyscanner,"invalid indentation", CompilationError::invalid_line); // pretend tab was pressed yyextra->das_current_line_indent = (yyextra->das_current_line_indent + yyextra->das_tab_size) & ~(yyextra->das_tab_size-1); } yylval_param->i = yyextra->das_indent_level; @@ -362,7 +362,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, string incFileName = yyextra->g_Access->getIncludeFileName(cfi->name,yytext); auto info = yyextra->g_Access->getFileInfo(incFileName); if ( !info ) { - das_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName); + das_yyfatalerror(yylloc_param,yyscanner,"can't open "+incFileName, CompilationError::lookup_file); } else { if ( yyextra->das_already_include.find(incFileName) == yyextra->das_already_include.end() ) { yyextra->das_already_include.insert(incFileName); @@ -550,7 +550,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->ui64); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -561,7 +561,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i64); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-1 ) { return LEXER_ERROR; } @@ -573,7 +573,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, uint8_t u8_const; auto res = fast_float::from_chars(temptext, temptext+templength, u8_const); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -585,7 +585,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->ui); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-1 ) { return LEXER_ERROR; } @@ -596,7 +596,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength-2 ) { return LEXER_ERROR; } @@ -611,7 +611,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, int templength = skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext, temptext+templength, yylval_param->i); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"int constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+templength ) { return LEXER_ERROR; } @@ -622,7 +622,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui64, 16); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-2 ) { return LEXER_ERROR; } @@ -633,7 +633,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui64, 16); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"int64 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-1 ) { return LEXER_ERROR; } @@ -646,7 +646,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, uint8_t u8_const; auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext)-2, u8_const, 16); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint8 constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-2 ) { return LEXER_ERROR; } @@ -655,7 +655,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } else { auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui, 16); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext)-1 ) { return LEXER_ERROR; } @@ -667,7 +667,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, skip_underscode(yytext,temptext,temptext+sizeof(temptext)); auto res = fast_float::from_chars(temptext + 2, temptext+strlen(temptext), yylval_param->ui, 16); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::integer_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"uint constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() || res.ptr != temptext+strlen(temptext) ) { return LEXER_ERROR; } @@ -676,7 +676,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, ([0-9]*)?\.[0-9]+([eE][+\-]?[0-9]+)?(f|F)? { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -685,7 +685,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9][0-9]*\.[0-9]+?([eE][+\-]?[0-9]+)?(f|F)? { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -695,7 +695,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9]+(f|F) { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -704,7 +704,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9]+[eE][+\-]?[0-9]+(f|F)? { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->fd); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"float constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -713,7 +713,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, ([0-9]*)?\.[0-9]+([eE][+\-]?[0-9]+)?(lf|d) { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -722,7 +722,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9][0-9]*\.[0-9]+?([eE][+\-]?[0-9]+)?(lf|d)? { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -731,7 +731,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9]+(lf|d) { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -740,7 +740,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, [0-9]+[eE][+\-]?[0-9]+(lf|d) { auto res = fast_float::from_chars(yytext, yytext+strlen(yytext), yylval_param->d); if ( res.ec == std::errc::result_out_of_range ) { - das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::floating_point_constant_out_of_range); + das_yyfatalerror(yylloc_param,yyscanner,"double constant out of range", CompilationError::exceeds_constant); } else if ( res.ec != std::errc() ) { return LEXER_ERROR; } @@ -748,7 +748,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } \) { if ( !yyextra->das_nested_parentheses ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching parentheses", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching parentheses", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_parentheses --; @@ -760,7 +760,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, } \] { if ( !yyextra->das_nested_square_braces ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_square_braces --; @@ -986,7 +986,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, ";"([ \t\n\r]*|[\/][*][^*]*[*]+([^*\/][^*]*[*]+)*[\/]|\/\/.*\n)*"}}" { if ( yyextra->das_nested_curly_braces < 2 ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_curly_bracers); return LEXER_ERROR; } const auto txt = string(yytext); @@ -1002,11 +1002,11 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, ";"([ \t\n\r]*|[\/][*][^*]*[*]+([^*\/][^*]*[*]+)*[\/]|\/\/.*\n)*"}]" { if ( !yyextra->das_nested_curly_braces ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_curly_bracers); return LEXER_ERROR; } if ( !yyextra->das_nested_square_braces ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } const auto txt = string(yytext); @@ -1023,11 +1023,11 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, ","([ \t\n\r]*|[\/][*][^*]*[*]+([^*\/][^*]*[*]+)*[\/]|\/\/.*\n)*"}]" { if ( !yyextra->das_nested_curly_braces ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching curly braces", CompilationError::mismatching_curly_bracers); return LEXER_ERROR; } if ( !yyextra->das_nested_square_braces ) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } const auto txt = string(yytext); @@ -1044,7 +1044,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, ";"([ \t\n\r]*|[\/][*][^*]*[*]+([^*\/][^*]*[*]+)*[\/]|\/\/.*\n)*"]]" { if ( yyextra->das_nested_square_braces < 2) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_square_braces -= 2; @@ -1061,7 +1061,7 @@ void das_accept_cpp_comment ( vector & crdi, yyscan_t scanner, ","([ \t\n\r]*|[\/][*][^*]*[*]+([^*\/][^*]*[*]+)*[\/]|\/\/.*\n)*"]]" { if ( yyextra->das_nested_square_braces < 2) { - das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parentheses); + das_yyfatalerror(yylloc_param,yyscanner,"mismatching square braces", CompilationError::mismatching_parens); return LEXER_ERROR; } yyextra->das_nested_square_braces -= 2; @@ -1169,7 +1169,7 @@ void das_collect_keywords ( Module * mod, yyscan_t yyscanner ) { auto it = yyextra->das_keywords.find(kwd.first); if ( it != yyextra->das_keywords.end() && it->second.keyword!=kwd.first ) { yyextra->g_Program->error("mismatching keyword " + kwd.first + " in module " + mod->name, - it->second.keyword + " is already defined","",LineInfo()); + it->second.keyword + " is already defined","",LineInfo(), CompilationError::mismatching_module_name); return; } yyextra->das_keywords[kwd.first] = DasKeyword{kwd.second,false,kwd.first}; @@ -1179,7 +1179,7 @@ void das_collect_keywords ( Module * mod, yyscan_t yyscanner ) { auto it = yyextra->das_keywords.find(tfun); if ( it != yyextra->das_keywords.end() && it->second.keyword!=keyword ) { yyextra->g_Program->error("mismatching type function " + tfun + " in module " + mod->name, - it->second.keyword + " is already defined","",LineInfo()); + it->second.keyword + " is already defined","",LineInfo(), CompilationError::mismatching_module_name); return; } yyextra->das_keywords[tfun] = DasKeyword{false,true,keyword}; diff --git a/src/parser/ds_parser.cpp b/src/parser/ds_parser.cpp index 0c2db0628b..6b8a6d4724 100644 --- a/src/parser/ds_parser.cpp +++ b/src/parser/ds_parser.cpp @@ -6608,7 +6608,7 @@ YYLTYPE yylloc = yyloc_default; case 3: /* program: program module_declaration */ { if ( yyextra->das_has_type_declarations ) { - das_yyerror(scanner,"module name has to be first declaration",tokAt(scanner,(yylsp[0])), CompilationError::syntax_error); + das_yyerror(scanner,"module name has to be first declaration",tokAt(scanner,(yylsp[0])), CompilationError::invalid_module); } } break; @@ -6689,7 +6689,7 @@ YYLTYPE yylloc = yyloc_default; yyextra->g_Program->library.renameModule(yyextra->g_Program->thisModule.get(),*(yyvsp[-3].s)); } else if ( yyextra->g_Program->thisModule->name != *(yyvsp[-3].s) ){ das_yyerror(scanner,"this module already has a name " + yyextra->g_Program->thisModule->name,tokAt(scanner,(yylsp[-3])), - CompilationError::module_already_has_a_name); + CompilationError::already_declared_module_name); } if ( !yyextra->g_Program->policies.ignore_shared_modules ) { yyextra->g_Program->promoteToBuiltin = (yyvsp[-2].b); @@ -6754,7 +6754,7 @@ YYLTYPE yylloc = yyloc_default; { bool err; auto esconst = unescapeString(*(yyvsp[0].s),&err); - if ( err ) das_yyerror(scanner,"invalid escape sequence",tokAt(scanner,(yylsp[-1])), CompilationError::invalid_escape_sequence); + if ( err ) das_yyerror(scanner,"invalid escape sequence",tokAt(scanner,(yylsp[-1])), CompilationError::invalid_escape); auto sc = new ExprConstString(tokAt(scanner,(yylsp[0])),esconst); delete (yyvsp[0].s); static_cast((yyvsp[-1].pExpression))->elements.push_back(sc); @@ -6814,17 +6814,17 @@ YYLTYPE yylloc = yyloc_default; auto macros = yyextra->g_Program->getReaderMacro(*(yyvsp[0].s)); if ( macros.size()==0 ) { das_yyerror(scanner,"reader macro " + *(yyvsp[0].s) + " not found",tokAt(scanner,(yylsp[0])), - CompilationError::unsupported_read_macro); + CompilationError::lookup_macro); } else if ( macros.size()>1 ) { string options; for ( auto & x : macros ) { options += "\t" + x->module->name + "::" + x->name + "\n"; } das_yyerror(scanner,"too many options for the reader macro " + *(yyvsp[0].s) + "\n" + options, tokAt(scanner,(yylsp[0])), - CompilationError::unsupported_read_macro); + CompilationError::ambiguous_macro); } else if ( yychar != '~' ) { das_yyerror(scanner,"expecting ~ after the reader macro", tokAt(scanner,(yylsp[0])), - CompilationError::syntax_error); + CompilationError::invalid_macro); } else { yyextra->g_ReaderMacro = macros.back(); yyextra->g_ReaderExpr = new ExprReader(tokAt(scanner,(yylsp[-1])),yyextra->g_ReaderMacro); @@ -6872,7 +6872,7 @@ YYLTYPE yylloc = yyloc_default; yyextra->g_Program->options.push_back(opt); } else { das_yyerror(scanner,"option " + opt.name + " is not allowed here", - tokAt(scanner,(yylsp[0])), CompilationError::invalid_option); + tokAt(scanner,(yylsp[0])), CompilationError::invalid_options); } } delete (yyvsp[0].aaList); @@ -7295,7 +7295,7 @@ YYLTYPE yylloc = yyloc_default; } else { (yyval.fa)->annotation = new Annotation(*(yyvsp[0].s)); das2_yyerror(scanner,"annotation " + *(yyvsp[0].s) + " is not found", - tokAt(scanner,(yylsp[0])), CompilationError::invalid_annotation); + tokAt(scanner,(yylsp[0])), CompilationError::lookup_annotation); } } else { das_yyerror(scanner,"annotation " + *(yyvsp[0].s) + " is not allowed here", @@ -7315,7 +7315,7 @@ YYLTYPE yylloc = yyloc_default; } else { (yyval.fa)->annotation = new Annotation(*(yyvsp[-3].s)); das2_yyerror(scanner,"annotation " + *(yyvsp[-3].s) + " is not found", - tokAt(scanner,(yylsp[-3])), CompilationError::invalid_annotation); + tokAt(scanner,(yylsp[-3])), CompilationError::lookup_annotation); } } else { das_yyerror(scanner,"annotation " + *(yyvsp[-3].s) + " is not allowed here", @@ -7926,7 +7926,7 @@ YYLTYPE yylloc = yyloc_default; if ( !yyextra->g_Program->addFunction((yyvsp[0].pFuncDecl)) ) { das_yyerror(scanner,"function is already defined " + (yyvsp[0].pFuncDecl)->getMangledName(),(yyvsp[0].pFuncDecl)->at, - CompilationError::function_already_declared); + CompilationError::already_declared_function); } } (yyvsp[0].pFuncDecl)->delRef(); @@ -8233,7 +8233,7 @@ YYLTYPE yylloc = yyloc_default; auto pMS = (ExprMakeStruct *) pipeCall; if ( pMS->block ) { das_yyerror(scanner,"can't pipe into [[ make structure ]]. it already has where closure", - tokAt(scanner,(yylsp[-1])),CompilationError::cant_pipe); + tokAt(scanner,(yylsp[-1])),CompilationError::cant_expression); delete (yyvsp[0].pExpression); } else { pMS->block = (yyvsp[0].pExpression); @@ -8241,7 +8241,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.pExpression) = (yyvsp[-2].pExpression); } else { das_yyerror(scanner,"can only pipe into function call or [[ make structure ]]", - tokAt(scanner,(yylsp[-1])),CompilationError::cant_pipe); + tokAt(scanner,(yylsp[-1])),CompilationError::cant_expression); delete (yyvsp[0].pExpression); (yyval.pExpression) = (yyvsp[-2].pExpression); } @@ -9951,7 +9951,7 @@ YYLTYPE yylloc = yyloc_default; case 609: /* struct_variable_declaration_list: struct_variable_declaration_list '[' annotation_list ']' semicolon */ { das_yyerror(scanner,"structure field or class method annotation expected to remain on the same line with the field or the class", - tokAt(scanner,(yylsp[-2])), CompilationError::syntax_error); + tokAt(scanner,(yylsp[-2])), CompilationError::invalid_annotation); delete (yyvsp[-2].faList); (yyval.pVarDeclList) = (yyvsp[-4].pVarDeclList); } @@ -10379,7 +10379,7 @@ YYLTYPE yylloc = yyloc_default; das_checkName(scanner,*(yyvsp[-1].s),tokAt(scanner,(yylsp[-1]))); if ( !(yyvsp[-2].pEnumList)->add(*(yyvsp[-1].s),nullptr,tokAt(scanner,(yylsp[-1]))) ) { das_yyerror(scanner,"enumeration already declared " + *(yyvsp[-1].s), tokAt(scanner,(yylsp[-1])), - CompilationError::enumeration_value_already_declared); + CompilationError::already_declared_enumerator); } if ( !yyextra->g_CommentReaders.empty() ) { auto tokName = tokAt(scanner,(yylsp[-1])); @@ -10397,7 +10397,7 @@ YYLTYPE yylloc = yyloc_default; das_checkName(scanner,*(yyvsp[-3].s),tokAt(scanner,(yylsp[-3]))); if ( !(yyvsp[-4].pEnumList)->add(*(yyvsp[-3].s),(yyvsp[-1].pExpression),tokAt(scanner,(yylsp[-3]))) ) { das_yyerror(scanner,"enumeration value already declared " + *(yyvsp[-3].s), tokAt(scanner,(yylsp[-3])), - CompilationError::enumeration_value_already_declared); + CompilationError::already_declared_enumerator); } if ( !yyextra->g_CommentReaders.empty() ) { auto tokName = tokAt(scanner,(yylsp[-3])); @@ -10437,12 +10437,12 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[0].pTypeDecl)->isPrivateAlias = !(yyvsp[-4].b); if ( (yyvsp[0].pTypeDecl)->baseType == Type::alias ) { das_yyerror(scanner,"alias cannot be defined in terms of another alias "+*(yyvsp[-3].s),tokAt(scanner,(yylsp[-3])), - CompilationError::invalid_type); + CompilationError::invalid_type_alias); } (yyvsp[0].pTypeDecl)->alias = *(yyvsp[-3].s); if ( !yyextra->g_Program->addAlias((yyvsp[0].pTypeDecl)) ) { das_yyerror(scanner,"type alias is already defined "+*(yyvsp[-3].s),tokAt(scanner,(yylsp[-3])), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto pubename = tokAt(scanner,(yylsp[0])); @@ -10969,7 +10969,7 @@ YYLTYPE yylloc = yyloc_default; auto maxBits = (yyval.pTypeDecl)->maxBitfieldBits(); if ( (yyval.pTypeDecl)->argNames.size()>maxBits ) { das_yyerror(scanner,"only " + to_string(maxBits) + " different bits are allowed in a bitfield",tokAt(scanner,(yylsp[-5])), - CompilationError::invalid_type); + CompilationError::exceeds_bitfield); } (yyval.pTypeDecl)->at = tokAt(scanner,(yylsp[-5])); delete (yyvsp[-2].pNameList); @@ -11024,10 +11024,10 @@ YYLTYPE yylloc = yyloc_default; { if ( (yyvsp[-1].pTypeDecl)->baseType==Type::typeDecl ) { das_yyerror(scanner,"type declaration can`t be used as array base type",tokAt(scanner,(yylsp[-1])), - CompilationError::invalid_type); + CompilationError::invalid_array_type); } else if ( (yyvsp[-1].pTypeDecl)->baseType==Type::typeMacro ) { das_yyerror(scanner,"macro can`t be used as array base type",tokAt(scanner,(yylsp[-1])), - CompilationError::invalid_type); + CompilationError::invalid_array_type); } (yyvsp[-1].pTypeDecl)->dim.insert((yyvsp[-1].pTypeDecl)->dim.begin(), (yyvsp[0].pTypeDecl)->dim.begin(), (yyvsp[0].pTypeDecl)->dim.end()); (yyvsp[-1].pTypeDecl)->dimExpr.insert((yyvsp[-1].pTypeDecl)->dimExpr.begin(), (yyvsp[0].pTypeDecl)->dimExpr.begin(), (yyvsp[0].pTypeDecl)->dimExpr.end()); @@ -11502,7 +11502,7 @@ YYLTYPE yylloc = yyloc_default; deleteVariableDeclarationList((yyvsp[-2].pVarDeclList)); if ( !yyextra->g_Program->addAlias(vtype) ) { das_yyerror(scanner,"type alias is already defined "+*(yyvsp[-6].s),tokAt(scanner,(yylsp[-6])), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,(yylsp[-6])); @@ -11554,7 +11554,7 @@ YYLTYPE yylloc = yyloc_default; deleteVariableDeclarationList((yyvsp[-2].pVarDeclList)); if ( !yyextra->g_Program->addAlias(vtype) ) { das_yyerror(scanner,"type alias is already defined "+*(yyvsp[-6].s),tokAt(scanner,(yylsp[-6])), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,(yylsp[-6])); @@ -11609,7 +11609,7 @@ YYLTYPE yylloc = yyloc_default; auto maxBits = btype->maxBitfieldBits(); if ( btype->argNames.size()>maxBits ) { das_yyerror(scanner,"only " + to_string(maxBits) + " different bits are allowed in a bitfield",tokAt(scanner,(yylsp[-7])), - CompilationError::invalid_type); + CompilationError::exceeds_bitfield); } for ( auto & p : *(yyvsp[-2].pNameExprList) ) { if ( get<1>(p) ) { @@ -11618,7 +11618,7 @@ YYLTYPE yylloc = yyloc_default; } if ( !yyextra->g_Program->addAlias(btype) ) { das_yyerror(scanner,"type alias is already defined "+*(yyvsp[-7].s),tokAt(scanner,(yylsp[-7])), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,(yylsp[-7])); @@ -12638,7 +12638,7 @@ void das_yyerror ( DAS_YYLTYPE * lloc, yyscan_t scanner, const string & error ) if ( !yyextra->das_suppress_errors ) { yyextra->g_Program->error(error,"","",LineInfo(yyextra->g_FileAccessStack.back(), lloc->first_column,lloc->first_line,lloc->last_column,lloc->last_line), - CompilationError::syntax_error); + CompilationError::invalid_expression); } } diff --git a/src/parser/ds_parser.ypp b/src/parser/ds_parser.ypp index 2eee05087b..366ddd9c8f 100644 --- a/src/parser/ds_parser.ypp +++ b/src/parser/ds_parser.ypp @@ -569,7 +569,7 @@ program : | program module_declaration { if ( yyextra->das_has_type_declarations ) { - das_yyerror(scanner,"module name has to be first declaration",tokAt(scanner,@module_declaration), CompilationError::syntax_error); + das_yyerror(scanner,"module name has to be first declaration",tokAt(scanner,@module_declaration), CompilationError::invalid_module); } } | program structure_declaration { yyextra->das_has_type_declarations = true; } @@ -619,7 +619,7 @@ module_declaration yyextra->g_Program->library.renameModule(yyextra->g_Program->thisModule.get(),*$name); } else if ( yyextra->g_Program->thisModule->name != *$name ){ das_yyerror(scanner,"this module already has a name " + yyextra->g_Program->thisModule->name,tokAt(scanner,@name), - CompilationError::module_already_has_a_name); + CompilationError::already_declared_module_name); } if ( !yyextra->g_Program->policies.ignore_shared_modules ) { yyextra->g_Program->promoteToBuiltin = $mtype; @@ -659,7 +659,7 @@ string_builder_body | string_builder_body[sb] character_sequence[sconst] %prec STRING_CHARACTER { bool err; auto esconst = unescapeString(*$sconst,&err); - if ( err ) das_yyerror(scanner,"invalid escape sequence",tokAt(scanner,@sb), CompilationError::invalid_escape_sequence); + if ( err ) das_yyerror(scanner,"invalid escape sequence",tokAt(scanner,@sb), CompilationError::invalid_escape); auto sc = new ExprConstString(tokAt(scanner,@sconst),esconst); delete $sconst; static_cast($sb)->elements.push_back(sc); @@ -713,17 +713,17 @@ expr_reader auto macros = yyextra->g_Program->getReaderMacro(*$mark); if ( macros.size()==0 ) { das_yyerror(scanner,"reader macro " + *$mark + " not found",tokAt(scanner,@mark), - CompilationError::unsupported_read_macro); + CompilationError::lookup_macro); } else if ( macros.size()>1 ) { string options; for ( auto & x : macros ) { options += "\t" + x->module->name + "::" + x->name + "\n"; } das_yyerror(scanner,"too many options for the reader macro " + *$mark + "\n" + options, tokAt(scanner,@mark), - CompilationError::unsupported_read_macro); + CompilationError::ambiguous_macro); } else if ( yychar != '~' ) { das_yyerror(scanner,"expecting ~ after the reader macro", tokAt(scanner,@mark), - CompilationError::syntax_error); + CompilationError::invalid_macro); } else { yyextra->g_ReaderMacro = macros.back(); yyextra->g_ReaderExpr = new ExprReader(tokAt(scanner,@loc),yyextra->g_ReaderMacro); @@ -766,7 +766,7 @@ options_declaration yyextra->g_Program->options.push_back(opt); } else { das_yyerror(scanner,"option " + opt.name + " is not allowed here", - tokAt(scanner,@list), CompilationError::invalid_option); + tokAt(scanner,@list), CompilationError::invalid_options); } } delete $list; @@ -1041,7 +1041,7 @@ annotation_declaration_basic } else { $$->annotation = new Annotation(*$name); das2_yyerror(scanner,"annotation " + *$name + " is not found", - tokAt(scanner,@name), CompilationError::invalid_annotation); + tokAt(scanner,@name), CompilationError::lookup_annotation); } } else { das_yyerror(scanner,"annotation " + *$name + " is not allowed here", @@ -1058,7 +1058,7 @@ annotation_declaration_basic } else { $$->annotation = new Annotation(*$name); das2_yyerror(scanner,"annotation " + *$name + " is not found", - tokAt(scanner,@name), CompilationError::invalid_annotation); + tokAt(scanner,@name), CompilationError::lookup_annotation); } } else { das_yyerror(scanner,"annotation " + *$name + " is not allowed here", @@ -1306,7 +1306,7 @@ global_function_declaration if ( !yyextra->g_Program->addFunction($func) ) { das_yyerror(scanner,"function is already defined " + $func->getMangledName(),$func->at, - CompilationError::function_already_declared); + CompilationError::already_declared_function); } } $func->delRef(); @@ -1505,7 +1505,7 @@ expr_pipe auto pMS = (ExprMakeStruct *) pipeCall; if ( pMS->block ) { das_yyerror(scanner,"can't pipe into [[ make structure ]]. it already has where closure", - tokAt(scanner,@loc),CompilationError::cant_pipe); + tokAt(scanner,@loc),CompilationError::cant_expression); delete $arg; } else { pMS->block = $arg; @@ -1513,7 +1513,7 @@ expr_pipe $$ = $fncall; } else { das_yyerror(scanner,"can only pipe into function call or [[ make structure ]]", - tokAt(scanner,@loc),CompilationError::cant_pipe); + tokAt(scanner,@loc),CompilationError::cant_expression); delete $arg; $$ = $fncall; } @@ -2464,7 +2464,7 @@ struct_variable_declaration_list } | struct_variable_declaration_list[list] '[' annotation_list[annL] ']' semicolon { das_yyerror(scanner,"structure field or class method annotation expected to remain on the same line with the field or the class", - tokAt(scanner,@annL), CompilationError::syntax_error); + tokAt(scanner,@annL), CompilationError::invalid_annotation); delete $annL; $$ = $list; } @@ -2776,7 +2776,7 @@ enum_list das_checkName(scanner,*$name,tokAt(scanner,@name)); if ( !$pE->add(*$name,nullptr,tokAt(scanner,@name)) ) { das_yyerror(scanner,"enumeration already declared " + *$name, tokAt(scanner,@name), - CompilationError::enumeration_value_already_declared); + CompilationError::already_declared_enumerator); } if ( !yyextra->g_CommentReaders.empty() ) { auto tokName = tokAt(scanner,@name); @@ -2791,7 +2791,7 @@ enum_list das_checkName(scanner,*$name,tokAt(scanner,@name)); if ( !$pE->add(*$name,$value,tokAt(scanner,@name)) ) { das_yyerror(scanner,"enumeration value already declared " + *$name, tokAt(scanner,@name), - CompilationError::enumeration_value_already_declared); + CompilationError::already_declared_enumerator); } if ( !yyextra->g_CommentReaders.empty() ) { auto tokName = tokAt(scanner,@name); @@ -2823,12 +2823,12 @@ single_alias $tdecl->isPrivateAlias = !$pubA; if ( $tdecl->baseType == Type::alias ) { das_yyerror(scanner,"alias cannot be defined in terms of another alias "+*$name,tokAt(scanner,@name), - CompilationError::invalid_type); + CompilationError::invalid_type_alias); } $tdecl->alias = *$name; if ( !yyextra->g_Program->addAlias($tdecl) ) { das_yyerror(scanner,"type alias is already defined "+*$name,tokAt(scanner,@name), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto pubename = tokAt(scanner,@tdecl); @@ -3149,7 +3149,7 @@ bitfield_type_declaration auto maxBits = $$->maxBitfieldBits(); if ( $$->argNames.size()>maxBits ) { das_yyerror(scanner,"only " + to_string(maxBits) + " different bits are allowed in a bitfield",tokAt(scanner,@basicType), - CompilationError::invalid_type); + CompilationError::exceeds_bitfield); } $$->at = tokAt(scanner,@basicType); delete $nl; @@ -3191,10 +3191,10 @@ type_declaration_no_options | type_declaration_no_options[typeDecl] dim_list[dimlist] { if ( $typeDecl->baseType==Type::typeDecl ) { das_yyerror(scanner,"type declaration can`t be used as array base type",tokAt(scanner,@typeDecl), - CompilationError::invalid_type); + CompilationError::invalid_array_type); } else if ( $typeDecl->baseType==Type::typeMacro ) { das_yyerror(scanner,"macro can`t be used as array base type",tokAt(scanner,@typeDecl), - CompilationError::invalid_type); + CompilationError::invalid_array_type); } $typeDecl->dim.insert($typeDecl->dim.begin(), $dimlist->dim.begin(), $dimlist->dim.end()); $typeDecl->dimExpr.insert($typeDecl->dimExpr.begin(), $dimlist->dimExpr.begin(), $dimlist->dimExpr.end()); @@ -3440,7 +3440,7 @@ tuple_alias_declaration deleteVariableDeclarationList($list); if ( !yyextra->g_Program->addAlias(vtype) ) { das_yyerror(scanner,"type alias is already defined "+*$vname,tokAt(scanner,@vname), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,@vname); @@ -3476,7 +3476,7 @@ variant_alias_declaration deleteVariableDeclarationList($list); if ( !yyextra->g_Program->addAlias(vtype) ) { das_yyerror(scanner,"type alias is already defined "+*$vname,tokAt(scanner,@vname), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,@vname); @@ -3515,7 +3515,7 @@ bitfield_alias_declaration auto maxBits = btype->maxBitfieldBits(); if ( btype->argNames.size()>maxBits ) { das_yyerror(scanner,"only " + to_string(maxBits) + " different bits are allowed in a bitfield",tokAt(scanner,@vname), - CompilationError::invalid_type); + CompilationError::exceeds_bitfield); } for ( auto & p : *$list ) { if ( get<1>(p) ) { @@ -3524,7 +3524,7 @@ bitfield_alias_declaration } if ( !yyextra->g_Program->addAlias(btype) ) { das_yyerror(scanner,"type alias is already defined "+*$vname,tokAt(scanner,@vname), - CompilationError::type_alias_already_declared); + CompilationError::already_declared_type_alias); } if ( !yyextra->g_CommentReaders.empty() ) { auto atvname = tokAt(scanner,@vname); @@ -4103,7 +4103,7 @@ void das_yyerror ( DAS_YYLTYPE * lloc, yyscan_t scanner, const string & error ) if ( !yyextra->das_suppress_errors ) { yyextra->g_Program->error(error,"","",LineInfo(yyextra->g_FileAccessStack.back(), lloc->first_column,lloc->first_line,lloc->last_column,lloc->last_line), - CompilationError::syntax_error); + CompilationError::invalid_expression); } } diff --git a/src/parser/parser_impl.cpp b/src/parser/parser_impl.cpp index 85417ee706..25ff2778f3 100644 --- a/src/parser/parser_impl.cpp +++ b/src/parser/parser_impl.cpp @@ -121,13 +121,13 @@ namespace das { auto pVarType = new TypeDecl(*pDecl->pTypeDecl); if ( pDecl->pInit ) { das_yyerror(scanner,"can't have default values in a type declaration", - (*pDecl->pNameList)[ai].at,CompilationError::cant_initialize); + (*pDecl->pNameList)[ai].at,CompilationError::cant_type); } pType->argTypes.push_back(pVarType); if ( needNames && pDecl->pNameList && !(*pDecl->pNameList)[ai].name.empty() ) { if ( !(*pDecl->pNameList)[ai].aka.empty() ) { das_yyerror(scanner,"type declaration can't have an aka", (*pDecl->pNameList)[ai].at, - CompilationError::invalid_aka); + CompilationError::invalid_type_aka); } anyNames = true; } @@ -154,11 +154,11 @@ namespace das { if ( ann.size()==1 ) { return ann.back(); } else if ( ann.size()==0 ) { - das_yyerror(scanner,"annotation " + name + " not found", at, CompilationError::annotation_not_found ); + das_yyerror(scanner,"annotation " + name + " not found", at, CompilationError::lookup_annotation ); return nullptr; } else { string candidates = yyextra->g_Program->describeCandidates(ann); - das_yyerror(scanner,"too many options for annotation " + name + "\n" + candidates, at, CompilationError::annotation_not_found ); + das_yyerror(scanner,"too many options for annotation " + name + "\n" + candidates, at, CompilationError::ambiguous_annotation ); return nullptr; } } @@ -177,7 +177,7 @@ namespace das { string err; if ( !ann->apply(func, *yyextra->g_Program->thisModuleGroup, pA->arguments, err) ) { das_yyerror(scanner,"macro [" +pA->annotation->name + "] failed to apply to a function " + func->name + "\n" + err, at, - CompilationError::invalid_annotation); + CompilationError::runtime_annotation); } else if ( ann->name=="type_function" && ann->module->name=="$" ) { // this is awkward. we need this so that [type_function] can be used in the same module auto mod = func->module ? func->module : extra->g_Program->thisModule.get(); @@ -242,7 +242,7 @@ namespace das { pStruct->parent = structs.back(); if ( pStruct->parent->sealed ) { das_yyerror(scanner,"can't derive from a sealed class or structure "+*parent,atParent, - CompilationError::invalid_override); + CompilationError::cant_structure); } pStruct->annotations.clear(); pStruct->genCtor = false; @@ -250,11 +250,11 @@ namespace das { } else if ( structs.size()==0 ) { das_yyerror(scanner,"parent structure not found " + *parent,atParent, - CompilationError::structure_not_found); + CompilationError::lookup_structure); } else { string candidates = yyextra->g_Program->describeCandidates(structs); das_yyerror(scanner,"too many options for " + *parent + "\n" + candidates,atParent, - CompilationError::structure_not_found); + CompilationError::ambiguous_structure); } delete parent; } @@ -264,7 +264,7 @@ namespace das { pStruct->sealed = sealed; if ( !yyextra->g_Program->addStructure(pStruct) ) { das_yyerror(scanner,"structure is already defined "+*name,atName, - CompilationError::structure_already_declared); + CompilationError::already_declared_structure); delete name; return nullptr; } else { @@ -277,7 +277,7 @@ namespace das { bool ast_structureAlias ( yyscan_t scanner, string * name, TypeDecl * typeDecl, const LineInfo & atName ) { if (!typeDecl->alias.empty()) { das_yyerror(scanner,"alias is already defined "+typeDecl->alias, atName, - CompilationError::invalid_type); + CompilationError::already_declared_type_alias); delete name; delete typeDecl; return false; @@ -286,13 +286,13 @@ namespace das { delete name; if ( !yyextra->g_thisStructure ) { das_yyerror(scanner,"typedef outside of structure", atName, - CompilationError::invalid_type); + CompilationError::invalid_type_alias); delete typeDecl; return false; } if ( yyextra->g_thisStructure->aliases.find(typeDecl->alias) ) { das_yyerror(scanner,"alias is already defined "+typeDecl->alias, atName, - CompilationError::invalid_type); + CompilationError::already_declared_type_alias); delete typeDecl; return false; } @@ -308,10 +308,10 @@ namespace das { if ( pStruct->parent && pStruct->parent->isClass != pStruct->isClass ) { if ( pStruct->isClass ) { das_yyerror(scanner,"class can only derive from a class", pStruct->at, - CompilationError::invalid_override); + CompilationError::invalid_class); } else { das_yyerror(scanner,"structure can only derive from a structure", pStruct->at, - CompilationError::invalid_override); + CompilationError::invalid_structure); } delete annL; deleteVariableDeclarationList(list); @@ -322,7 +322,7 @@ namespace das { auto virtfin = makeClassFinalize(pStruct); if ( !yyextra->g_Program->addFunction(virtfin) ) { das_yyerror(scanner,"built-in finalizer is already defined " + virtfin->getMangledName(), - virtfin->at, CompilationError::function_already_declared); + virtfin->at, CompilationError::internal_function); } } for ( auto & ffd : pStruct->fields ) { @@ -342,17 +342,17 @@ namespace das { */ if ( (pDecl->override || pDecl->sealed) && pDecl->isStatic ) { das_yyerror(scanner,"static member can't be sealed or override "+name_at.name,name_at.at, - CompilationError::invalid_static); + CompilationError::invalid_field_static); } if ( pDecl->isStatic && pDecl->annotation ) { das_yyerror(scanner,"static member can't have an annotation "+name_at.name,name_at.at, - CompilationError::invalid_static); + CompilationError::invalid_field_static); } auto oldFd = (Structure::FieldDeclaration *) pStruct->findField(name_at.name); if ( !oldFd ) { if ( pDecl->override ) { das_yyerror(scanner,"structure field is not overriding anything "+name_at.name,name_at.at, - CompilationError::invalid_override); + CompilationError::invalid_field); } else { TypeDeclPtr td = nullptr; ExpressionPtr init = nullptr; @@ -374,7 +374,7 @@ namespace das { pVar->private_variable = pDecl->isPrivate || pStruct->privateStructure; if ( !pStruct->module->addVariable(pVar,true) ) { das_yyerror(scanner,"static variable already exists "+name_at.name,name_at.at, - CompilationError::invalid_static); + CompilationError::already_declared_global); } pStruct->hasStaticMembers = true; } else { @@ -392,11 +392,11 @@ namespace das { if ( pDecl->isStatic ) { das_yyerror(scanner,"static structure field is already declared "+name_at.name +", can't have both member at static at the same name",name_at.at, - CompilationError::invalid_static); + CompilationError::already_declared_field_static); } else if ( pDecl->sealed || pDecl->override ) { if ( oldFd->sealed ) { das_yyerror(scanner,"structure field "+name_at.name+" is sealed", - name_at.at, CompilationError::invalid_override); + name_at.at, CompilationError::invalid_field); } if ( pDecl->pInit ) { if ( pDecl->pNameList->size()>1 ) { @@ -413,7 +413,7 @@ namespace das { } else { das_yyerror(scanner,"structure field is already declared "+name_at.name +", use override to replace initial value instead",name_at.at, - CompilationError::invalid_override); + CompilationError::already_declared_field); } } } @@ -445,7 +445,7 @@ namespace das { string err; if ( !ann->touch(pStruct, *yyextra->g_Program->thisModuleGroup, pA->arguments, err) ) { das_yyerror(scanner,"macro [" +pA->annotation->name + "] failed to apply to the structure " + pStruct->name + "\n" + err, - loc, CompilationError::invalid_annotation); + loc, CompilationError::runtime_annotation); } } else if ( pA->annotation->rtti_isStructureTypeAnnotation() ) { if ( annL->size()!=1 ) { @@ -455,7 +455,7 @@ namespace das { if ( !yyextra->g_Program->addStructureHandle(pStruct, static_cast(pA->annotation), pA->arguments) ) { das_yyerror(scanner,"handled structure is already defined "+pStruct->name, loc, - CompilationError::structure_already_declared); + CompilationError::already_declared_structure); } else { pStruct->module->removeStructure(pStruct); } @@ -481,7 +481,7 @@ namespace das { pEnum->at = atName; if ( !yyextra->g_Program->addEnumeration(pEnum) ) { das_yyerror(scanner,"enumeration is already defined "+pEnum->name, atName, - CompilationError::enumeration_already_declared); + CompilationError::already_declared_enumeration); return pEnum; } else { return pEnum; @@ -503,7 +503,7 @@ namespace das { string err; if ( !ann->touch(pEnum, *yyextra->g_Program->thisModuleGroup, pA->arguments, err) ) { das_yyerror(scanner,"macro [" +pA->annotation->name + "] failed to finalize the enumeration " + pEnum->name + "\n" + err, atannL, - CompilationError::invalid_annotation); + CompilationError::runtime_annotation); } } } @@ -522,7 +522,7 @@ namespace das { pVar->aka = name_at.aka; if ( !name_at.aka.empty() ) { das_yyerror(scanner,"global variable " + name_at.name + " can't have an aka",name_at.at, - CompilationError::invalid_aka); + CompilationError::invalid_global_aka); } pVar->at = name_at.at; if ( pDecl->pNameList->size()>1 ) { @@ -548,7 +548,7 @@ namespace das { pVar->private_variable = !pub_var; if ( !yyextra->g_Program->addVariable(pVar) ) das_yyerror(scanner,"global variable is already declared " + name_at.name,name_at.at, - CompilationError::global_variable_already_declared); + CompilationError::already_declared_global); } } } @@ -566,7 +566,7 @@ namespace das { pVar->bitfield_constant = true; if ( !yyextra->g_Program->addVariable(pVar) ) { das_yyerror(scanner,"global bitfield constant is already declared " + name,expr->at, - CompilationError::global_variable_already_declared); + CompilationError::already_declared_global_bitfield); } } @@ -580,7 +580,7 @@ namespace das { pVar->aka = name_at.aka; if ( !name_at.aka.empty() ) { das_yyerror(scanner,"global variable " + name_at.name + " can't have an aka",name_at.at, - CompilationError::invalid_aka); + CompilationError::invalid_global_aka); } pVar->at = name_at.at; if ( pDecl->pNameList->size()>1 ) { @@ -612,7 +612,7 @@ namespace das { } if ( !yyextra->g_Program->addVariable(pVar) ) das_yyerror(scanner,"global variable is already declared " + name_at.name,name_at.at, - CompilationError::global_variable_already_declared); + CompilationError::already_declared_global); } } delete pDecl; @@ -627,23 +627,23 @@ namespace das { if ( yyextra->g_thisStructure ) { if ( yyextra->g_Program->policies.no_members_functions_in_struct && !yyextra->g_thisStructure->isClass ) { das_yyerror(scanner,"structure can't have a member function", - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function); } else if ( func->isGeneric() ) { das_yyerror(scanner,"generic function can't be a member of a class " + func->getMangledName(), - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function); } else if ( func->name==yyextra->g_thisStructure->name || func->name=="finalize" ) { das_yyerror(scanner,"initializers and finalizers can't be abstract " + func->getMangledName(), - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function); } else if ( annL!=nullptr ) { das_yyerror(scanner,"abstract functions can't have annotations " + func->getMangledName(), - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function_annotation); delete annL; } else if ( func->result->baseType==Type::autoinfer ) { das_yyerror(scanner,"abstract functions must specify return type explicitly " + func->getMangledName(), - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::missing_function_result); } else if ( isOpName(func->name) ) { das_yyerror(scanner,"abstract functions can't be operators " + func->getMangledName(), - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function); } else { auto varName = func->name; func->name = yyextra->g_thisStructure->name + "`" + func->name; @@ -686,13 +686,13 @@ namespace das { // opt.type has matching options opt.option1 and opt.option2 das_yyerror(scanner,"generic function argument " + arg->name + " of type " + opt.optionType->describe() + " has matching options " + opt.option1->describe() + " and " + opt.option2->describe(), - opt.optionType->at, CompilationError::invalid_type); + opt.optionType->at, CompilationError::ambiguous_function_argument_type); } } } if ( !yyextra->g_Program->addGeneric(func) ) { das_yyerror(scanner,"generic function is already defined " + func->getMangledName(), - func->at, CompilationError::function_already_declared); + func->at, CompilationError::already_declared_function); } } @@ -705,17 +705,17 @@ namespace das { auto isGeneric = func->isGeneric(); if ( !yyextra->g_thisStructure ) { das_yyerror(scanner,"internal error or invalid macro. member function is declared outside of a class", - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::internal_function); } else if ( yyextra->g_Program->policies.no_members_functions_in_struct && !yyextra->g_thisStructure->isClass ) { das_yyerror(scanner,"structure can't have a member function", - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function); } else if ( isGeneric && !isStatic ) { das_yyerror(scanner,"generic function can't be a member of a class " + func->getMangledName(), - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function); } else if ( isOpName(func->name) ) { if ( ovr ) { das_yyerror(scanner,"can't override an operator " + func->getMangledName(), - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function); } if ( isStatic ) { func->isClassMethod = true; @@ -729,7 +729,7 @@ namespace das { runFunctionAnnotations(scanner, nullptr, func, annL, annLAt); if ( !yyextra->g_Program->addFunction(func) ) { das_yyerror(scanner,"function is already defined " + func->getMangledName(), - func->at, CompilationError::function_already_declared); + func->at, CompilationError::already_declared_function); } func->delRef(); } else { @@ -769,17 +769,17 @@ namespace das { } else { if ( ovr ) { das_yyerror(scanner,"can't override an initializer or a finalizer " + func->getMangledName(), - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function); } if ( cnst ) { das_yyerror(scanner,"can't have a constant initializer or a finalizer " + func->getMangledName(), - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function); } if ( isStatic ) { // its just a regular function named as the class if ( func->name=="finalize" ) { das_yyerror(scanner,"finalizer can't be static " + func->getMangledName(), - func->at, CompilationError::invalid_member_function); + func->at, CompilationError::invalid_function_static); } func->isClassMethod = true; func->isStaticClassMethod = true; @@ -788,8 +788,8 @@ namespace das { } else if ( func->name!="finalize" ) { auto ctr = makeClassConstructor(yyextra->g_thisStructure, func); if ( !yyextra->g_Program->addFunction(ctr) ) { - das_yyerror(scanner,"intializer is already defined " + ctr->getMangledName(), - ctr->at, CompilationError::function_already_declared); + das_yyerror(scanner,"initializer is already defined " + ctr->getMangledName(), + ctr->at, CompilationError::already_declared_function); } func->name = yyextra->g_thisStructure->name + "`" + yyextra->g_thisStructure->name; modifyToClassMember(func, yyextra->g_thisStructure, false, false); @@ -809,7 +809,7 @@ namespace das { runFunctionAnnotations(scanner, yyextra, func, annL, annLAt); if ( !yyextra->g_Program->addFunction(func) ) { das_yyerror(scanner,"function is already defined " + func->getMangledName(), - func->at, CompilationError::function_already_declared); + func->at, CompilationError::already_declared_function); } } func->delRef(); @@ -827,10 +827,10 @@ namespace das { if ( enums.size() ) candidates += yyextra->g_Program->describeCandidates(enums); if ( aliases.size() ) candidates += yyextra->g_Program->describeCandidates(aliases); das_yyerror(scanner,"too many options for the " + *ena + "\n" + candidates, enaAt, - CompilationError::type_not_found); + CompilationError::ambiguous_enumeration); } else if ( enums.size()==0 && aliases.size()==0 ) { das_yyerror(scanner,"enumeration or bitfield not found " + *ena, enaAt, - CompilationError::type_not_found); + CompilationError::lookup_enumeration); } else if ( enums.size()==1 ) { pEnum = enums.back(); } else if ( aliases.size()==1 ) { @@ -848,11 +848,11 @@ namespace das { resConst = bitConst; } else { das_yyerror(scanner,"enumeration or bitfield not found " + *ena, enaAt, - CompilationError::bitfield_not_found); + CompilationError::lookup_bitfield); } } else { das_yyerror(scanner,"expecting enumeration or bitfield " + *ena, enaAt, - CompilationError::syntax_error); + CompilationError::invalid_type); } } if ( pEnum ) { @@ -908,7 +908,7 @@ namespace das { closure->arguments.push_back(pVar); } else { das_yyerror(scanner,"block argument is already declared " + name_at.name, - name_at.at,CompilationError::argument_already_declared); + name_at.at,CompilationError::already_declared_block_argument); } } } @@ -931,7 +931,7 @@ namespace das { string err; if ( !ann->apply(closure, *yyextra->g_Program->thisModuleGroup, pA->arguments, err) ) { das_yyerror(scanner,"macro [" +pA->annotation->name + "] failed to apply to the block\n" + err, annLAt, - CompilationError::invalid_annotation); + CompilationError::runtime_annotation); } } else { das_yyerror(scanner,"blocks are only allowed function macros", annLAt, @@ -983,7 +983,7 @@ namespace das { pLet->variables.push_back(pVar); } else { das_yyerror(scanner,"local variable is already declared " + name_at.name,name_at.at, - CompilationError::local_variable_already_declared); + CompilationError::already_declared_local); } } } @@ -1032,7 +1032,7 @@ namespace das { pLet->variables.push_back(pVar); } else { das_yyerror(scanner,"local variable is already declared " + name_at.name,name_at.at, - CompilationError::local_variable_already_declared); + CompilationError::already_declared_local); } } } @@ -1076,7 +1076,7 @@ namespace das { pFunction->arguments.push_back(pVar); } else { das_yyerror(scanner,"function argument is already declared " + name_at.name,name_at.at, - CompilationError::argument_already_declared); + CompilationError::already_declared_function_argument); } } } @@ -1108,7 +1108,7 @@ namespace das { if ( ita !=yyextra->das_module_alias.end() ) { if ( ita->second != info.moduleName ) { das_yyerror(scanner,"module alias already used " + malias + " as " + ita->second,atName, - CompilationError::module_not_found); + CompilationError::already_declared_module); } } else { yyextra->das_module_alias[malias] = info.moduleName; @@ -1117,7 +1117,7 @@ namespace das { } else { yyextra->g_Program->allRequireDecl.push_back(make_tuple((Module *)nullptr,*name,info.fileName,pub,atName)); das_yyerror(scanner,"required module not found " + *name,atName, - CompilationError::module_not_found); + CompilationError::lookup_module); } delete name; if ( modalias) delete modalias; @@ -1178,22 +1178,22 @@ namespace das { if ( pMS->block ) { if ( pMS->type ) { das_yyerror(scanner,"can't pipe into make " + pMS->type->describe() + ". it already has where closure", - locAt,CompilationError::cant_pipe); + locAt,CompilationError::cant_expression); } else { das_yyerror(scanner,"can't pipe into make struct. it already has where closure", - locAt,CompilationError::cant_pipe); + locAt,CompilationError::cant_expression); } delete arg; } else if ( !arg->rtti_isMakeBlock() ) { das_yyerror(scanner,"can't pipe into make struct. argument must be a block", - locAt,CompilationError::cant_pipe); + locAt,CompilationError::cant_expression); delete arg; } else { auto mkb = (ExprMakeBlock *) arg; auto blk = (ExprBlock *) mkb->block; if ( blk->arguments.size() != 1 ) { das_yyerror(scanner,"can't pipe into make struct. block must have exactly one argument (that structure itself)", - locAt,CompilationError::cant_pipe); + locAt,CompilationError::cant_expression); delete arg; } else { pMS->block = arg; @@ -1202,7 +1202,7 @@ namespace das { return fncall; } else { das_yyerror(scanner,"can only pipe into function call or make type", - locAt,CompilationError::cant_pipe); + locAt,CompilationError::cant_expression); delete arg; return fncall; } @@ -1232,7 +1232,7 @@ namespace das { pField->value = ast_rpipe(scanner, arg, pField->value, locAt); return fncall; } else { - das_yyerror(scanner,"can only rpipe into a function call",locAt,CompilationError::cant_pipe); + das_yyerror(scanner,"can only rpipe into a function call",locAt,CompilationError::cant_expression); return fncall; } } @@ -1286,7 +1286,7 @@ namespace das { else if ( op=="move" ) mode = CaptureMode::capture_by_move; else if ( op=="copy" ) mode = CaptureMode::capture_by_copy; else if ( op=="ref" ) mode = CaptureMode::capture_by_reference; - else yyextra->g_Program->error("unknown capture mode " + op, "", "", at, CompilationError::syntax_error); + else yyextra->g_Program->error("unknown capture mode " + op, "", "", at, CompilationError::invalid_capture); return new CaptureEntry(name,mode); } diff --git a/tests/class_boost/failed_explicit_const_non_static.das b/tests/class_boost/failed_explicit_const_non_static.das index 4b4d86c295..93e47bf957 100644 --- a/tests/class_boost/failed_explicit_const_non_static.das +++ b/tests/class_boost/failed_explicit_const_non_static.das @@ -1,7 +1,7 @@ // [explicit_const_class_method] applied to a non-static class method // verifies the static-only guard in daslib/class_boost.das ClassMethodMacro.apply options gen2 -expect 30111 // invalid_annotation +expect 20800 // invalid_annotation require daslib/class_boost diff --git a/tests/constexpr/failed_test_constexpr.das b/tests/constexpr/failed_test_constexpr.das index f5d14d8923..cdfc406718 100644 --- a/tests/constexpr/failed_test_constexpr.das +++ b/tests/constexpr/failed_test_constexpr.das @@ -1,5 +1,5 @@ options gen2 -expect 40102:1 +expect 50501 // Verify that [constexpr] annotation rejects non-constant arguments. // The call `foo("ouch", BOO)` must fail because BOO is a global variable, diff --git a/tests/dasSQLITE/failed_add_column_no_sql_table.das b/tests/dasSQLITE/failed_add_column_no_sql_table.das index 3b18103a4d..6493394f7a 100644 --- a/tests/dasSQLITE/failed_add_column_no_sql_table.das +++ b/tests/dasSQLITE/failed_add_column_no_sql_table.das @@ -2,7 +2,7 @@ options gen2 // AddColumnMacro must reject a struct without [sql_table] — there's no table // identifier to ALTER, so the call is meaningless. -expect 40104:1 +expect 50503 require sqlite/sqlite_migrate diff --git a/tests/dasSQLITE/failed_add_column_nonliteral_default.das b/tests/dasSQLITE/failed_add_column_nonliteral_default.das index 26a77eee9b..5574144678 100644 --- a/tests/dasSQLITE/failed_add_column_nonliteral_default.das +++ b/tests/dasSQLITE/failed_add_column_nonliteral_default.das @@ -3,7 +3,7 @@ options gen2 // AddColumnMacro requires the DEFAULT to be a compile-time literal: int / float / // double / bool / string. Runtime expressions (function calls, variables, arithmetic) // are rejected with a fixit pointing to db |> exec(…). -expect 40104:1 +expect 50503 require sqlite/sqlite_migrate diff --git a/tests/dasSQLITE/failed_add_column_pk_rejected.das b/tests/dasSQLITE/failed_add_column_pk_rejected.das index e8e5c706b8..71bb21504c 100644 --- a/tests/dasSQLITE/failed_add_column_pk_rejected.das +++ b/tests/dasSQLITE/failed_add_column_pk_rejected.das @@ -2,7 +2,7 @@ options gen2 // AddColumnMacro must reject @sql_primary_key fields — SQLite cannot add a PK column // to an existing table; this requires a table rebuild (chunk 14c struct_convert). -expect 40104:1 +expect 50503 require sqlite/sqlite_migrate diff --git a/tests/dasSQLITE/failed_add_column_unique_rejected.das b/tests/dasSQLITE/failed_add_column_unique_rejected.das index 393d39d234..9042ea2fd7 100644 --- a/tests/dasSQLITE/failed_add_column_unique_rejected.das +++ b/tests/dasSQLITE/failed_add_column_unique_rejected.das @@ -2,7 +2,7 @@ options gen2 // AddColumnMacro must reject @sql_unique fields — SQLite cannot add a UNIQUE // column to an existing table inline; the user should use create_unique_index instead. -expect 40104:1 +expect 50503 require sqlite/sqlite_migrate diff --git a/tests/dasSQLITE/failed_add_column_unknown_field.das b/tests/dasSQLITE/failed_add_column_unknown_field.das index 0d37a98650..78b8ea780f 100644 --- a/tests/dasSQLITE/failed_add_column_unknown_field.das +++ b/tests/dasSQLITE/failed_add_column_unknown_field.das @@ -2,7 +2,7 @@ options gen2 // AddColumnMacro must reject a field name that doesn't exist on the struct, // with the same wording the [sql_index] structure annotation uses. -expect 40104:1 +expect 50503 require sqlite/sqlite_migrate diff --git a/tests/dasSQLITE/failed_create_index_empty_fields.das b/tests/dasSQLITE/failed_create_index_empty_fields.das index a9dbe50f33..c446edd727 100644 --- a/tests/dasSQLITE/failed_create_index_empty_fields.das +++ b/tests/dasSQLITE/failed_create_index_empty_fields.das @@ -2,7 +2,7 @@ options gen2 // CreateIndexMacro must reject an empty-string field name — equivalent to "fields=()". // Mirrors [sql_index]'s "missing or empty `fields=`" error. -expect 40104:1 +expect 50503 require sqlite/sqlite_migrate diff --git a/tests/dasSQLITE/failed_create_index_unknown_field.das b/tests/dasSQLITE/failed_create_index_unknown_field.das index 42e9b63865..e9a34268cc 100644 --- a/tests/dasSQLITE/failed_create_index_unknown_field.das +++ b/tests/dasSQLITE/failed_create_index_unknown_field.das @@ -2,7 +2,7 @@ options gen2 // CreateIndexMacro must reject field names that don't exist on the struct, // with the same wording the [sql_index] structure annotation uses. -expect 40104:1 +expect 50503 require sqlite/sqlite_migrate diff --git a/tests/dasSQLITE/failed_create_view.das b/tests/dasSQLITE/failed_create_view.das index adf59fd39c..e1b10232f7 100644 --- a/tests/dasSQLITE/failed_create_view.das +++ b/tests/dasSQLITE/failed_create_view.das @@ -2,7 +2,7 @@ options gen2 // _create_view shape errors. Each block triggers exactly one macro_error // (40104) from `SqlCreateViewMacro`. -expect 40104:6 +expect 50503:6 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_each_sql_terminals.das b/tests/dasSQLITE/failed_each_sql_terminals.das index a14ca93137..d1b5c5b204 100644 --- a/tests/dasSQLITE/failed_each_sql_terminals.das +++ b/tests/dasSQLITE/failed_each_sql_terminals.das @@ -3,7 +3,7 @@ options gen2 // _each_sql rejects materializing terminals — _to_array, _first, _first_opt, // and aggregates each fire a macro_error pointing at `_sql(...)` for the // scalar / single-row form. -expect 40104:4 +expect 50503:4 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_pred_json_path_typo.das b/tests/dasSQLITE/failed_pred_json_path_typo.das index f2171c6991..3859ae10b3 100644 --- a/tests/dasSQLITE/failed_pred_json_path_typo.das +++ b/tests/dasSQLITE/failed_pred_json_path_typo.das @@ -13,7 +13,7 @@ options gen2 // macro's failure path properly propagates (without the SqlQuery.hadError // fix, the macro_error was queued but operator handlers like `==` wrapped // the empty fragment as `" = ?"` and analyze_predicate treated it as success). -expect 40104:3, 30503:3 +expect 30928:2, 30831, 50503:3 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_register_function.das b/tests/dasSQLITE/failed_register_function.das index 822fe72c67..eb9b2f6135 100644 --- a/tests/dasSQLITE/failed_register_function.das +++ b/tests/dasSQLITE/failed_register_function.das @@ -8,7 +8,7 @@ options gen2 // 3. pointer argument // 4. lambda passed instead of @@fn (not a function pointer) // 5. > 4 arguments -expect 40104:5 +expect 50503:5 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_schema_from_field_not_in_db.das b/tests/dasSQLITE/failed_schema_from_field_not_in_db.das index fb043b4427..cfc2742c86 100644 --- a/tests/dasSQLITE/failed_schema_from_field_not_in_db.das +++ b/tests/dasSQLITE/failed_schema_from_field_not_in_db.das @@ -1,7 +1,7 @@ options gen2 // Hand-declared field that doesn't exist in the schema_from .db → compile error. -expect 30111:1 +expect 20800 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_schema_from_file_missing.das b/tests/dasSQLITE/failed_schema_from_file_missing.das index 4b5dd07191..3593467cef 100644 --- a/tests/dasSQLITE/failed_schema_from_file_missing.das +++ b/tests/dasSQLITE/failed_schema_from_file_missing.das @@ -1,7 +1,7 @@ options gen2 // `schema_from=` points to a path that doesn't exist. -expect 30111:1 +expect 20800 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_schema_from_nullable_loose.das b/tests/dasSQLITE/failed_schema_from_nullable_loose.das index 60d31b8f8b..3dcfd4c404 100644 --- a/tests/dasSQLITE/failed_schema_from_nullable_loose.das +++ b/tests/dasSQLITE/failed_schema_from_nullable_loose.das @@ -1,7 +1,7 @@ options gen2 // User declares Option against a NOT NULL INTEGER PRIMARY KEY column → compile error. -expect 30111:1 +expect 20800 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_schema_from_nullable_strict.das b/tests/dasSQLITE/failed_schema_from_nullable_strict.das index ebb9976774..81661ac0f5 100644 --- a/tests/dasSQLITE/failed_schema_from_nullable_strict.das +++ b/tests/dasSQLITE/failed_schema_from_nullable_strict.das @@ -1,7 +1,7 @@ options gen2 // User declares non-optional `string` against a nullable TEXT column → compile error. -expect 30111:1 +expect 20800 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_schema_from_pk_disagreement.das b/tests/dasSQLITE/failed_schema_from_pk_disagreement.das index 03dcb027c6..c4a6ad2449 100644 --- a/tests/dasSQLITE/failed_schema_from_pk_disagreement.das +++ b/tests/dasSQLITE/failed_schema_from_pk_disagreement.das @@ -1,7 +1,7 @@ options gen2 // User attaches @sql_primary_key to a column the schema does NOT report as PK. -expect 30111:1 +expect 20800 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_schema_from_table_not_in_file.das b/tests/dasSQLITE/failed_schema_from_table_not_in_file.das index c93365650e..7073730d50 100644 --- a/tests/dasSQLITE/failed_schema_from_table_not_in_file.das +++ b/tests/dasSQLITE/failed_schema_from_table_not_in_file.das @@ -1,7 +1,7 @@ options gen2 // `name=` references a table that doesn't exist in the .db. -expect 30111:1 +expect 20800 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_schema_from_type_mismatch.das b/tests/dasSQLITE/failed_schema_from_type_mismatch.das index c9b907231a..852627df4a 100644 --- a/tests/dasSQLITE/failed_schema_from_type_mismatch.das +++ b/tests/dasSQLITE/failed_schema_from_type_mismatch.das @@ -3,7 +3,7 @@ options gen2 // Hand-declared field's type doesn't match the schema column's affinity. // This fires as a `concept_assert` failure inside the generated `_sql_table_name` // function — same compile-time chain, different error site. -expect 40103:1 +expect 31400 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_column.das b/tests/dasSQLITE/failed_sql_column.das index c20d5bb0f9..d4d0f0956f 100644 --- a/tests/dasSQLITE/failed_sql_column.das +++ b/tests/dasSQLITE/failed_sql_column.das @@ -10,7 +10,7 @@ options gen2 // daslang name of a sibling field. // // All five fail with 30111 ("macro [sql_table] failed to apply"). -expect 30111:5 +expect 20800:5 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_fts5.das b/tests/dasSQLITE/failed_sql_fts5.das index f0a9f351b0..1c271fc323 100644 --- a/tests/dasSQLITE/failed_sql_fts5.das +++ b/tests/dasSQLITE/failed_sql_fts5.das @@ -5,7 +5,7 @@ options gen2 // 1. @sql_column on @sql_fts_rank — rank is hardcoded to FTS5's hidden id. // // All fail with 30111 ("macro [sql_fts5] failed to apply"). -expect 30111:1 +expect 20800 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_function_annotation.das b/tests/dasSQLITE/failed_sql_function_annotation.das index 3b7f52f479..d65465986e 100644 --- a/tests/dasSQLITE/failed_sql_function_annotation.das +++ b/tests/dasSQLITE/failed_sql_function_annotation.das @@ -10,7 +10,7 @@ options gen2 // 7. name= with non-string value (silently coerced default would mask the typo) // 8. deterministic= with non-bool value // 9. directonly= with non-bool value -expect 30111:9 +expect 20800:9 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_function_in_view.das b/tests/dasSQLITE/failed_sql_function_in_view.das index 6d5ded5e52..3fd9d7ca62 100644 --- a/tests/dasSQLITE/failed_sql_function_in_view.das +++ b/tests/dasSQLITE/failed_sql_function_in_view.das @@ -12,7 +12,7 @@ options gen2 // doesn't cascade into the other and inflate the count. // 30305: free `_` reference in the un-replaced AST after the `_create_view` call_macro // returns null on the directonly check. The 40104 messages above are the actionable ones. -expect 40104:4, 30305:1 +expect 30838, 50503:2 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_index.das b/tests/dasSQLITE/failed_sql_index.das index 5e231dc042..3234e36323 100644 --- a/tests/dasSQLITE/failed_sql_index.das +++ b/tests/dasSQLITE/failed_sql_index.das @@ -2,7 +2,7 @@ options gen2 // [sql_index] validation rules introduced in chunk 7. Each struct triggers // exactly one error; macro [sql_index] failures emit error 30111. -expect 30111:4 +expect 20800:4 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_index_on_legacy.das b/tests/dasSQLITE/failed_sql_index_on_legacy.das index 527fcf288c..44efc99574 100644 --- a/tests/dasSQLITE/failed_sql_index_on_legacy.das +++ b/tests/dasSQLITE/failed_sql_index_on_legacy.das @@ -3,7 +3,7 @@ options gen2 // `[sql_index]` on a `legacy=true` struct is rejected: legacy structs are read-only // and don't define schema, so the index would have no CREATE TABLE to attach to and // would collide with the current struct's index of the same name on rebuild. -expect 30111:1 +expect 20800 require sqlite/sqlite_migrate diff --git a/tests/dasSQLITE/failed_sql_json_blob_kind_collision.das b/tests/dasSQLITE/failed_sql_json_blob_kind_collision.das index 38160b001d..cedd22094f 100644 --- a/tests/dasSQLITE/failed_sql_json_blob_kind_collision.das +++ b/tests/dasSQLITE/failed_sql_json_blob_kind_collision.das @@ -7,7 +7,7 @@ options gen2 // Without this rejection a single payload type would silently route // through whichever adapter was emitted first — a BLOB column reading // from `sql_bind(T) : string` or vice versa. -expect 30111:3 +expect 20800:3 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_macro.das b/tests/dasSQLITE/failed_sql_macro.das index 9a23b4ce17..a53c6ed3d3 100644 --- a/tests/dasSQLITE/failed_sql_macro.das +++ b/tests/dasSQLITE/failed_sql_macro.das @@ -6,7 +6,7 @@ options gen2 // some malformed chains additionally cascade real type errors before the // analyzer ever runs — e.g. `_select(_.Name) |> _select(_.Price)` is a // genuine type bug (string has no `Price` field). Those cascades are expected. -expect 40104:20, 30304:1, 30503:2 +expect 30341, 30928:2, 50503:20 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_migration_dup_version.das b/tests/dasSQLITE/failed_sql_migration_dup_version.das index d1d9a2d708..4721873441 100644 --- a/tests/dasSQLITE/failed_sql_migration_dup_version.das +++ b/tests/dasSQLITE/failed_sql_migration_dup_version.das @@ -2,7 +2,7 @@ options gen2 // Two migrations with version=2 in the same module — must fail at compile time // with the [sql_migration] dup-version error (error 30111). -expect 30111:1 +expect 20800 require sqlite/sqlite_migrate diff --git a/tests/dasSQLITE/failed_sql_pragma_vacuum.das b/tests/dasSQLITE/failed_sql_pragma_vacuum.das index 2aab935055..20f4d0f7c6 100644 --- a/tests/dasSQLITE/failed_sql_pragma_vacuum.das +++ b/tests/dasSQLITE/failed_sql_pragma_vacuum.das @@ -2,7 +2,7 @@ options gen2 // _sql_pragma / _sql_vacuum_into argument-shape errors. Each line triggers // exactly one macro_error (40104). -expect 40104:5 +expect 50503:5 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_table_schema.das b/tests/dasSQLITE/failed_sql_table_schema.das index ea57a4b208..f6dba45009 100644 --- a/tests/dasSQLITE/failed_sql_table_schema.das +++ b/tests/dasSQLITE/failed_sql_table_schema.das @@ -5,7 +5,7 @@ options gen2 // failure produces error 30111 = "macro [sql_table] failed to apply to the // structure". Validation is fail-fast (first error aborts that struct's // apply()) so each struct contributes exactly one error. -expect 30111:12 +expect 20800:12 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_update_delete.das b/tests/dasSQLITE/failed_sql_update_delete.das index 1264be6efc..6729e93e28 100644 --- a/tests/dasSQLITE/failed_sql_update_delete.das +++ b/tests/dasSQLITE/failed_sql_update_delete.das @@ -2,7 +2,7 @@ options gen2 // Each `_sql_update` / `_sql_delete` call below is intentionally malformed. // 40104 = macro_error (from the analyzer). -expect 40104:7 +expect 50503:7 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_upsert.das b/tests/dasSQLITE/failed_sql_upsert.das index b16797a91c..45aa00323b 100644 --- a/tests/dasSQLITE/failed_sql_upsert.das +++ b/tests/dasSQLITE/failed_sql_upsert.das @@ -2,7 +2,7 @@ options gen2 // Each `_sql_upsert` call below is intentionally malformed and must emit // a macro_error (40104) from the analyzer. -expect 40104:10 +expect 50503:10 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_view_mutations.das b/tests/dasSQLITE/failed_sql_view_mutations.das index 401c110a57..9eda25bbc3 100644 --- a/tests/dasSQLITE/failed_sql_view_mutations.das +++ b/tests/dasSQLITE/failed_sql_view_mutations.das @@ -4,7 +4,7 @@ options gen2 // (_sql_update / _sql_delete / _sql_upsert and the try / returning // variants) must macro_error at compile time with the "views are // read-only" message — never reach the runtime panic stubs. -expect 40104:8 +expect 50503:8 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_sql_view_schema.das b/tests/dasSQLITE/failed_sql_view_schema.das index 9a4b774251..b960d606c4 100644 --- a/tests/dasSQLITE/failed_sql_view_schema.das +++ b/tests/dasSQLITE/failed_sql_view_schema.das @@ -4,7 +4,7 @@ options gen2 // Each failure produces error 30111 = "macro [sql_view] failed to apply to // the structure". Validation is fail-fast (first error aborts that struct's // apply()) so each struct contributes exactly one error. -expect 30111:9 +expect 20800:9 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_struct_convert_new_field_no_default.das b/tests/dasSQLITE/failed_struct_convert_new_field_no_default.das index 6d155eba76..033453e42b 100644 --- a/tests/dasSQLITE/failed_struct_convert_new_field_no_default.das +++ b/tests/dasSQLITE/failed_struct_convert_new_field_no_default.das @@ -2,7 +2,7 @@ options gen2 // `[struct_convert]` rejects new T fields that are not Option and have no default initializer // when the user provides no override — there's no auto-derivation rule that can populate them. -expect 30111:1 +expect 20800 require sqlite/sqlite_migrate diff --git a/tests/dasSQLITE/failed_unbindable_bind.das b/tests/dasSQLITE/failed_unbindable_bind.das index 48f96b5b34..7daab7611a 100644 --- a/tests/dasSQLITE/failed_unbindable_bind.das +++ b/tests/dasSQLITE/failed_unbindable_bind.das @@ -4,7 +4,7 @@ options gen2 // generic at sqlite_boost.das fires its concept_assert (40103). This is the // happy path for "user forgot to define sql_bind for their type" and // confirms the analyzer no longer rejects unrecognized AST shapes. -expect 40103:1 +expect 31400 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/dasSQLITE/failed_view_unstringifiable.das b/tests/dasSQLITE/failed_view_unstringifiable.das index ae78f80d64..6e276ab518 100644 --- a/tests/dasSQLITE/failed_view_unstringifiable.das +++ b/tests/dasSQLITE/failed_view_unstringifiable.das @@ -5,7 +5,7 @@ options gen2 // hits the catch-all `to_sql_literal(auto(TT))` at sqlite_linq.das, which // concept_asserts (40103). Confirms the user gets a pointed "define // to_sql_literal for your type" message instead of an opaque overload error. -expect 40103:1 +expect 31400 require daslib/sql require sqlite/sqlite_boost diff --git a/tests/decs/failed_query_eid_ro.das b/tests/decs/failed_query_eid_ro.das index bcb8b433cb..ae880ede90 100644 --- a/tests/decs/failed_query_eid_ro.das +++ b/tests/decs/failed_query_eid_ro.das @@ -1,5 +1,5 @@ options gen2 -expect 30303 +expect 30905 require daslib/decs_boost require dastest/testing_boost public diff --git a/tests/decs/failed_test_arguments.das b/tests/decs/failed_test_arguments.das index 2761a172ec..957d9bd158 100644 --- a/tests/decs/failed_test_arguments.das +++ b/tests/decs/failed_test_arguments.das @@ -1,5 +1,5 @@ options gen2 -expect 40104:4, 30103:2 +expect 30123:2, 50503:4 options persistent_heap = true options gc diff --git a/tests/decs/failed_test_empty_template.das b/tests/decs/failed_test_empty_template.das index 45d0d3a060..f121dbb36c 100644 --- a/tests/decs/failed_test_empty_template.das +++ b/tests/decs/failed_test_empty_template.das @@ -1,5 +1,5 @@ options gen2 -expect 30111 +expect 20800 options persistent_heap = true options gc diff --git a/tests/interfaces/failed_test_missing_inherited.das b/tests/interfaces/failed_test_missing_inherited.das index 99a3bd10dc..1d42ced9a2 100644 --- a/tests/interfaces/failed_test_missing_inherited.das +++ b/tests/interfaces/failed_test_missing_inherited.das @@ -1,6 +1,6 @@ options gen2 // Test: completeness check catches missing inherited abstract methods -expect 30111 +expect 30926 require daslib/interfaces diff --git a/tests/interfaces/failed_test_missing_method.das b/tests/interfaces/failed_test_missing_method.das index 44e9dd72b8..bdac913699 100644 --- a/tests/interfaces/failed_test_missing_method.das +++ b/tests/interfaces/failed_test_missing_method.das @@ -1,6 +1,6 @@ options gen2 // Test: completeness check catches missing abstract methods -expect 30111 +expect 30926 require daslib/interfaces diff --git a/tests/language/cant_access_private_members.das b/tests/language/cant_access_private_members.das index e1904b7c67..93a51277d2 100644 --- a/tests/language/cant_access_private_members.das +++ b/tests/language/cant_access_private_members.das @@ -2,7 +2,7 @@ // verifies the compiler rejects direct access to private fields and methods // from outside the class options gen2 -expect 30503:3, 30301:1 +expect 30805, 30900:3 class A { private name : string diff --git a/tests/language/cant_delete_super_self.das b/tests/language/cant_delete_super_self.das index 443e107164..ecff2619e6 100644 --- a/tests/language/cant_delete_super_self.das +++ b/tests/language/cant_delete_super_self.das @@ -1,6 +1,6 @@ // delete super.self error cases — covers every validation branch. options gen2 -expect 31002:6, 30305:6, 30503:6 +expect 30144:2, 30808:6, 30827, 30838:6, 30920:3 class Base { } diff --git a/tests/language/cant_dereference_mix.das b/tests/language/cant_dereference_mix.das index df351b50bc..1c22c88327 100644 --- a/tests/language/cant_dereference_mix.das +++ b/tests/language/cant_dereference_mix.das @@ -2,7 +2,7 @@ // verifies compiler rejects deref on non-pointers, void pointers, // and ?? with type mismatches options gen2 -expect 30501:5 // cant_dereference +expect 30215, 30921:4 // cant_dereference struct Bar { c : int diff --git a/tests/language/cant_derive_from_sealed_class.das b/tests/language/cant_derive_from_sealed_class.das index 6bc09b2b71..4e9a18eeea 100644 --- a/tests/language/cant_derive_from_sealed_class.das +++ b/tests/language/cant_derive_from_sealed_class.das @@ -1,7 +1,7 @@ // sealed class derivation // verifies compiler rejects inheriting from a class marked 'sealed' options gen2 -expect 30115 +expect 20701 class sealed A { name : string = "foobar" diff --git a/tests/language/cant_get_field.das b/tests/language/cant_get_field.das index 41d854643b..0b80b5c4b2 100644 --- a/tests/language/cant_get_field.das +++ b/tests/language/cant_get_field.das @@ -2,8 +2,7 @@ // verifies compiler rejects field access on arrays, non-struct types, // safe-navigation on non-pointers, and writes through const safe navigation options gen2 -expect 30503:4 // cant_get_field -expect 30504 // cant_write_to_const +expect 30224:2, 30928:2, 30952 // cant_get_field struct L3 { a : int diff --git a/tests/language/cant_have_local_variable.das b/tests/language/cant_have_local_variable.das index 91afdd6c39..4537704c58 100644 --- a/tests/language/cant_have_local_variable.das +++ b/tests/language/cant_have_local_variable.das @@ -2,7 +2,7 @@ // verifies compiler rejects local variables, arrays, and tables of non-local types // uses ast::TypeDecl as a representative non-local handled type options gen2 -expect 30108:4, 30101:2, 31300:3 +expect 30112, 30254, 31016:2, 31020:4, 31030 options force_inscope_pod = false require daslib/ast diff --git a/tests/language/cant_index.das b/tests/language/cant_index.das index e7f740de8c..eaef76778e 100644 --- a/tests/language/cant_index.das +++ b/tests/language/cant_index.das @@ -1,7 +1,7 @@ // invalid index operations // verifies compiler rejects indexing non-array/non-container types options gen2 -expect 30502:2 // cant_index +expect 30931:2 // cant_index def test_index(a : int) { a[1] // not a ref (and not an array) diff --git a/tests/language/cant_override_sealed.das b/tests/language/cant_override_sealed.das index b13a722ed8..6a287c5a48 100644 --- a/tests/language/cant_override_sealed.das +++ b/tests/language/cant_override_sealed.das @@ -1,7 +1,7 @@ // sealed field and method override // verifies compiler rejects overriding fields and methods marked 'sealed' options gen2 -expect 30115:2 +expect 20107:2 class A { sealed name : string = "foobar" diff --git a/tests/language/cant_write_to_constant_value.das b/tests/language/cant_write_to_constant_value.das index 4f4f0260c7..8ce2563515 100644 --- a/tests/language/cant_write_to_constant_value.das +++ b/tests/language/cant_write_to_constant_value.das @@ -2,7 +2,7 @@ // verifies compiler rejects writes through const pointers, // including direct field writes and safe-navigation writes options gen2 -expect 30504:3 +expect 30952:3 struct Foo { i : int diff --git a/tests/language/failed_aka.das b/tests/language/failed_aka.das index 7c7627023e..62f0ce6893 100644 --- a/tests/language/failed_aka.das +++ b/tests/language/failed_aka.das @@ -1,4 +1,4 @@ -expect 20000:1 +expect 30151 options gen2 options persistent_heap = true diff --git a/tests/language/failed_aliasing.das b/tests/language/failed_aliasing.das index 6cb574fe4e..45f1c198c9 100644 --- a/tests/language/failed_aliasing.das +++ b/tests/language/failed_aliasing.das @@ -1,5 +1,4 @@ -expect 40211:23 -expect 40212:3 +expect 30104:18, 30105:5, 30151:3 options gen2 options no_aliasing diff --git a/tests/language/failed_assume_loop.das b/tests/language/failed_assume_loop.das index 761720e057..38f12eeb26 100644 --- a/tests/language/failed_assume_loop.das +++ b/tests/language/failed_assume_loop.das @@ -1,6 +1,6 @@ options gen2 // test for circular assume detection -expect 30127:2, 30305:4 +expect 30838:4, 31101:2 def test_direct_loop { assume x = y + y diff --git a/tests/language/failed_auto_infer.das b/tests/language/failed_auto_infer.das index 4bd6e410b4..788572b9b8 100644 --- a/tests/language/failed_auto_infer.das +++ b/tests/language/failed_auto_infer.das @@ -2,7 +2,7 @@ // verifies compiler rejects invalid auto inferences: missing initializers, // dimension mismatches, pointer-level mismatches, block type mismatches options gen2 -expect 31101, 31102:8, 30304:2, 30105:1, 30102:2, 30106, 30113, 31300 +expect 30123, 30175, 30200:6, 30254, 30312, 30341:2, 30343:2, 30407, 31019 let { a : auto // 31101, can't infer, need initializer diff --git a/tests/language/failed_block.das b/tests/language/failed_block.das index 619ea04ef8..0cf8134fb5 100644 --- a/tests/language/failed_block.das +++ b/tests/language/failed_block.das @@ -1,5 +1,5 @@ options gen2 -expect 30108, 30113 +expect 30198, 30315 require dastest/testing_boost public diff --git a/tests/language/failed_call_depth.das b/tests/language/failed_call_depth.das index a6a0871779..524c6395aa 100644 --- a/tests/language/failed_call_depth.das +++ b/tests/language/failed_call_depth.das @@ -1,14 +1,7 @@ // verifies compiler detects recursive default argument expansion // struct method calls itself in its own default argument options max_call_depth = 5 -expect 41000:1 -expect 30301:50 -expect 30104:1 -expect 30113:1 -expect 31100:1 -expect 30101:1 -expect 30103:1 -expect 0:1 +expect 30161, 30237, 30344, 30503, 30805 struct v { def var0(var0 = 0; r = var0([var0=0])) {} } diff --git a/tests/language/failed_capture_self.das b/tests/language/failed_capture_self.das index 1d184bd160..9d07c34f39 100644 --- a/tests/language/failed_capture_self.das +++ b/tests/language/failed_capture_self.das @@ -1,5 +1,5 @@ options gen2 -expect 30508, 30124 +expect 30912, 30941 class A { private onLog : lambda diff --git a/tests/language/failed_class_method_non_static.das b/tests/language/failed_class_method_non_static.das index 09d3632e88..9d569e2095 100644 --- a/tests/language/failed_class_method_non_static.das +++ b/tests/language/failed_class_method_non_static.das @@ -1,7 +1,7 @@ // [class_method] applied to a non-static class method // verifies the static-only guard in daslib/class_boost.das ClassMethodMacro.apply options gen2 -expect 30111 // invalid_annotation +expect 20800 // invalid_annotation require daslib/class_boost diff --git a/tests/language/failed_comment_eof.das b/tests/language/failed_comment_eof.das index 490cfce59b..ead3c51db8 100644 --- a/tests/language/failed_comment_eof.das +++ b/tests/language/failed_comment_eof.das @@ -1,7 +1,7 @@ // unterminated comment at end of file // the nested comment construct /*//*/ triggers error 10007 options gen2 -expect 10007 +expect 10301 /*//*/ [export] diff --git a/tests/language/failed_condition_must_be_bool.das b/tests/language/failed_condition_must_be_bool.das index 5c15e72d3d..36598d33a6 100644 --- a/tests/language/failed_condition_must_be_bool.das +++ b/tests/language/failed_condition_must_be_bool.das @@ -2,9 +2,7 @@ // verifies compiler rejects non-bool conditions in if/ternary, // type mismatches in ternary branches, and writes to non-references options gen2 -expect 30601:2 // condition_must_be_boolean -expect 30303 // operator_not_found -expect 30506 // cant_write_to_non_reference +expect 30183, 30411, 30915, 31401 // condition_must_be_boolean def test { var a : int diff --git a/tests/language/failed_const_and_block_folding.das b/tests/language/failed_const_and_block_folding.das index 0d96d53c16..cabd470fa2 100644 --- a/tests/language/failed_const_and_block_folding.das +++ b/tests/language/failed_const_and_block_folding.das @@ -2,7 +2,7 @@ // verifies dead code elimination, constant folding, and detection // of top-level expressions with no side effects options gen2 -expect 40209:2 +expect 30151:2 options no_coverage diff --git a/tests/language/failed_const_ref.das b/tests/language/failed_const_ref.das index ed27abc4c2..bffb69dc50 100644 --- a/tests/language/failed_const_ref.das +++ b/tests/language/failed_const_ref.das @@ -5,14 +5,7 @@ options gen2 require _helper_foo -expect 30102 // passThrough -expect 30106 -expect 30303:1 // operator_not_found -expect 30304:2 // function_not_found -expect 30504:5 // cant_write_to_const -expect 30505:2 // cant_move_to_const -expect 30507:3 // cant_copy -expect 30508:1 // cant_move +expect 30341:2, 30343, 30910, 30915:2, 30934, 30941:3, 30950, 30952:5 // passThrough def const_iter(var a : table) { for (k, v in keys(a), values(a)) { diff --git a/tests/language/failed_constants.das b/tests/language/failed_constants.das index def38a04ad..9917d05e5e 100644 --- a/tests/language/failed_constants.das +++ b/tests/language/failed_constants.das @@ -1,5 +1,5 @@ options gen2 -expect 10006:12, 10010:4 +expect 10300:16 [export] def main { diff --git a/tests/language/failed_duplicate_keys.das b/tests/language/failed_duplicate_keys.das index a9e9834078..c94a1e98ae 100644 --- a/tests/language/failed_duplicate_keys.das +++ b/tests/language/failed_duplicate_keys.das @@ -2,7 +2,7 @@ // verifies compiler detects duplicate keys in table literals: // int=>string tables, string=>string tables, int sets, and string sets options gen2 -expect 40300:4 // 40300: duplicate key +expect 30706:4 // 40300: duplicate key [export] def test { diff --git a/tests/language/failed_failed_containers.das b/tests/language/failed_failed_containers.das index 4616c8f60d..967eacd2bb 100644 --- a/tests/language/failed_failed_containers.das +++ b/tests/language/failed_failed_containers.das @@ -1,4 +1,4 @@ -expect 30304:4 +expect 30341:4 options gen2 let FAIL_TO_COMPILE = true diff --git a/tests/language/failed_failed_local_classes.das b/tests/language/failed_failed_local_classes.das index f988c74a03..d4b42b1fc3 100644 --- a/tests/language/failed_failed_local_classes.das +++ b/tests/language/failed_failed_local_classes.das @@ -1,5 +1,5 @@ options gen2 -expect 31300:1 +expect 31030 options no_local_class_members class A { diff --git a/tests/language/failed_function_already_declared.das b/tests/language/failed_function_already_declared.das index f5a85b8337..e176b4fd96 100644 --- a/tests/language/failed_function_already_declared.das +++ b/tests/language/failed_function_already_declared.das @@ -1,7 +1,7 @@ // duplicate function declaration // verifies compiler rejects two functions with identical signatures options gen2 -expect 30201 // function_already_declared +expect 30702 // function_already_declared def test { assert(false) diff --git a/tests/language/failed_function_argument_already_declared.das b/tests/language/failed_function_argument_already_declared.das index 3bfe430efe..bcb6c513d1 100644 --- a/tests/language/failed_function_argument_already_declared.das +++ b/tests/language/failed_function_argument_already_declared.das @@ -1,7 +1,7 @@ // duplicate function argument name // verifies compiler rejects a function with two arguments of the same name options gen2 -expect 30202 // function_argument_already_declared +expect 20506 // function_argument_already_declared def test(a, a : int) { debug(a) diff --git a/tests/language/failed_function_not_found_ambiguous.das b/tests/language/failed_function_not_found_ambiguous.das index 8eaf82e873..da07913899 100644 --- a/tests/language/failed_function_not_found_ambiguous.das +++ b/tests/language/failed_function_not_found_ambiguous.das @@ -3,7 +3,7 @@ // define functions with the same name and signature; // qualified calls (::testFoo, _helper_foo::testFoo) must work options gen2 -expect 30304 // function_not_found +expect 30341 // function_not_found require _helper_foo diff --git a/tests/language/failed_global_init_type_mismatch.das b/tests/language/failed_global_init_type_mismatch.das index c17978187c..e7be81b0f2 100644 --- a/tests/language/failed_global_init_type_mismatch.das +++ b/tests/language/failed_global_init_type_mismatch.das @@ -4,7 +4,7 @@ options gen2 // options log=true, log_infer_passes=false, optimize=true -expect 30113 +expect 30344 struct Foo { i : int = 5 diff --git a/tests/language/failed_global_variable_already_declared.das b/tests/language/failed_global_variable_already_declared.das index f5c27840de..5af18ad98c 100644 --- a/tests/language/failed_global_variable_already_declared.das +++ b/tests/language/failed_global_variable_already_declared.das @@ -1,7 +1,7 @@ // duplicate global variable declaration // verifies compiler rejects declaring the same global variable twice options gen2 -expect 30204 // global_variable_already_declared +expect 20507 // global_variable_already_declared let { a : int diff --git a/tests/language/failed_global_variable_init_loop.das b/tests/language/failed_global_variable_init_loop.das index d35f89cf77..f30e1c792a 100644 --- a/tests/language/failed_global_variable_init_loop.das +++ b/tests/language/failed_global_variable_init_loop.das @@ -1,5 +1,5 @@ options gen2 -expect 30305:5 +expect 30173, 31104:4 // direct loop: a uses b, b uses a var g_a : int = g_b + 1 diff --git a/tests/language/failed_global_variable_order.das b/tests/language/failed_global_variable_order.das index 0e55bf5cbc..692f2530b9 100644 --- a/tests/language/failed_global_variable_order.das +++ b/tests/language/failed_global_variable_order.das @@ -1,5 +1,5 @@ options gen2 -expect 30305:1 +expect 30173 require _glob diff --git a/tests/language/failed_global_variable_order_itself.das b/tests/language/failed_global_variable_order_itself.das index e7112e79ae..1a0ec27f28 100644 --- a/tests/language/failed_global_variable_order_itself.das +++ b/tests/language/failed_global_variable_order_itself.das @@ -1,4 +1,4 @@ options gen2 -expect 30305:1 +expect 30177 var g_a : array <- g_a // 30305: global variable g_a cant't be initialized with itself diff --git a/tests/language/failed_macro_added_function_must_infer.das b/tests/language/failed_macro_added_function_must_infer.das index 89078b5747..778366278d 100644 --- a/tests/language/failed_macro_added_function_must_infer.das +++ b/tests/language/failed_macro_added_function_must_infer.das @@ -8,7 +8,7 @@ // func and emit error 50100 with a hint pointing at the missing // astChanged=true in the macro. options gen2 -expect 50100:2 // call reached side-effect analysis / lint with null func +expect 50613 // call reached side-effect analysis / lint with null func require _helper_macro_uninferred diff --git a/tests/language/failed_mismatching_curly_bracers.das b/tests/language/failed_mismatching_curly_bracers.das index f22b6ff98f..dd298a31d1 100644 --- a/tests/language/failed_mismatching_curly_bracers.das +++ b/tests/language/failed_mismatching_curly_bracers.das @@ -1,7 +1,7 @@ // mismatched curly braces // verifies parser detects extra closing brace options gen2 -expect 20000, 10002 // syntax_error, mismatching_curly_bracers +expect 10200, 30151 // syntax_error, mismatching_curly_bracers def test() { if (true) { diff --git a/tests/language/failed_mismatching_parentheses.das b/tests/language/failed_mismatching_parentheses.das index 03e7e54cad..77bacb5976 100644 --- a/tests/language/failed_mismatching_parentheses.das +++ b/tests/language/failed_mismatching_parentheses.das @@ -1,7 +1,7 @@ // mismatched parentheses // verifies parser detects extra closing parenthesis options gen2 -expect 20000, 10001 // syntax_error, mismatching_parentheses +expect 10202, 30151 // syntax_error, mismatching_parentheses def main() { if (true)) diff --git a/tests/language/failed_module_vis_fail.das b/tests/language/failed_module_vis_fail.das index d953211672..abae4e1264 100644 --- a/tests/language/failed_module_vis_fail.das +++ b/tests/language/failed_module_vis_fail.das @@ -2,7 +2,7 @@ // verifies that symbols from indirectly required modules are not visible, // and that module-qualified access respects visibility rules options gen2 -expect 30304:4, 30305:2, 30301:2 // , 30308 +expect 30341:4, 30837:2, 30838:2 // , 30308 require _module_b diff --git a/tests/language/failed_named_call.das b/tests/language/failed_named_call.das index 63993dca02..33a5aa9af2 100644 --- a/tests/language/failed_named_call.das +++ b/tests/language/failed_named_call.das @@ -1,5 +1,5 @@ options gen2 -expect 30304:12, 30101:1, 30507:1 +expect 30161, 30341:12, 30915 require dastest/testing_boost public require daslib/contracts diff --git a/tests/language/failed_new_type_infer.das b/tests/language/failed_new_type_infer.das index bff484dbb4..f1781155b4 100644 --- a/tests/language/failed_new_type_infer.das +++ b/tests/language/failed_new_type_infer.das @@ -4,7 +4,7 @@ options gen2 // options log_infer_passes=true -expect 30109, 30301, 30101 +expect 30165, 30214, 30823 struct FooBar { a, b : int diff --git a/tests/language/failed_no_init.das b/tests/language/failed_no_init.das index 2cef6aa95a..c34e18c2ee 100644 --- a/tests/language/failed_no_init.das +++ b/tests/language/failed_no_init.das @@ -1,5 +1,5 @@ options gen2 -expect 40214:3 +expect 30164:2, 30174 options no_init diff --git a/tests/language/failed_not_all_paths_return_a_value.das b/tests/language/failed_not_all_paths_return_a_value.das index c8c0efe732..cb419a21db 100644 --- a/tests/language/failed_not_all_paths_return_a_value.das +++ b/tests/language/failed_not_all_paths_return_a_value.das @@ -2,7 +2,7 @@ // verifies compiler rejects a function that only returns a value // in one branch of an if statement options gen2 -expect 40200 +expect 30310 def test_return_int_vs_void(arg : bool) {// 40200: not all control paths return value if (arg) { diff --git a/tests/language/failed_reserved_names.das b/tests/language/failed_reserved_names.das index 1c3df1c894..af75db375f 100644 --- a/tests/language/failed_reserved_names.das +++ b/tests/language/failed_reserved_names.das @@ -3,7 +3,7 @@ // as enum names, enum values, struct names, struct fields, function names, // function args, local variables, and lambda parameters options gen2 -expect 30116:9 +expect 30106:3, 30146, 30148, 30152, 30163, 30240, 30282 enum do {// 30116: invalid name foo diff --git a/tests/language/failed_run_annotation_side_effects.das b/tests/language/failed_run_annotation_side_effects.das index bf563e0a6c..6172ad3a41 100644 --- a/tests/language/failed_run_annotation_side_effects.das +++ b/tests/language/failed_run_annotation_side_effects.das @@ -1,5 +1,5 @@ options gen2 -expect 40101 +expect 50500 var { g = 5 diff --git a/tests/language/failed_sizeof_reference.das b/tests/language/failed_sizeof_reference.das index f4e02b1dd4..6f324e6112 100644 --- a/tests/language/failed_sizeof_reference.das +++ b/tests/language/failed_sizeof_reference.das @@ -1,7 +1,7 @@ // typeinfo on auto types // verifies compiler rejects typeinfo sizeof and typename on unresolved auto types options gen2 -expect 39902:2 +expect 30265:2 def test { let t = 1 diff --git a/tests/language/failed_static_assert_in_infer.das b/tests/language/failed_static_assert_in_infer.das index 31e308a48e..a4c451c896 100644 --- a/tests/language/failed_static_assert_in_infer.das +++ b/tests/language/failed_static_assert_in_infer.das @@ -2,7 +2,7 @@ options gen2 options no_coverage // options log=true,log_infer_passes=false,log_optimization_passes=true,optimize=true -expect 40100 +expect 31403 def fold(a : array; var from : numt) { for (x in a) { diff --git a/tests/language/failed_structure_already_defined.das b/tests/language/failed_structure_already_defined.das index 702d6f58d4..dcb753ba9e 100644 --- a/tests/language/failed_structure_already_defined.das +++ b/tests/language/failed_structure_already_defined.das @@ -1,7 +1,7 @@ // duplicate struct definition // verifies compiler rejects defining the same struct name twice options gen2 -expect 30206 // structure_already_defined +expect 20512 // structure_already_defined struct Foo { a : int diff --git a/tests/language/failed_structure_field_already_declared.das b/tests/language/failed_structure_field_already_declared.das index 5197925163..e310f5c8f3 100644 --- a/tests/language/failed_structure_field_already_declared.das +++ b/tests/language/failed_structure_field_already_declared.das @@ -1,7 +1,7 @@ // duplicate struct field name // verifies compiler rejects two fields with the same name in a struct options gen2 -expect 30115 // structure_field_already_declared +expect 20503 // structure_field_already_declared struct Foo { a : int diff --git a/tests/language/failed_structure_not_found_ambiguous.das b/tests/language/failed_structure_not_found_ambiguous.das index 25adc17ccf..81d0001732 100644 --- a/tests/language/failed_structure_not_found_ambiguous.das +++ b/tests/language/failed_structure_not_found_ambiguous.das @@ -6,7 +6,7 @@ options gen2 require _helper_foo -expect 30302 // too_many_options +expect 30609 // too_many_options struct TestObjectFoo { a : int diff --git a/tests/language/failed_table_lookup_collision.das b/tests/language/failed_table_lookup_collision.das index 7ae18a2432..0821028d9d 100644 --- a/tests/language/failed_table_lookup_collision.das +++ b/tests/language/failed_table_lookup_collision.das @@ -1,5 +1,5 @@ options gen2 -expect 40216:7 +expect 30250:7 def take_two_ret(var a : int&; var b : int&) : int { return a + b diff --git a/tests/language/failed_type_loop.das b/tests/language/failed_type_loop.das index 27c1c00512..54b284e310 100644 --- a/tests/language/failed_type_loop.das +++ b/tests/language/failed_type_loop.das @@ -4,7 +4,7 @@ options gen2 options max_infer_passes = 5 -expect 41000 +expect 30507 def infinite(a : auto(ptrt)?) { let t : ptrt ?? diff --git a/tests/language/failed_type_not_found.das b/tests/language/failed_type_not_found.das index cdfd89045f..029efb51be 100644 --- a/tests/language/failed_type_not_found.das +++ b/tests/language/failed_type_not_found.das @@ -1,7 +1,7 @@ // unknown type name // verifies compiler rejects using an undefined type name options gen2 -expect 30301 // type_not_found +expect 30820 // type_not_found def test { let a : wtf diff --git a/tests/language/failed_unused_argument.das b/tests/language/failed_unused_argument.das index 80477fa659..a7aa65b2a1 100644 --- a/tests/language/failed_unused_argument.das +++ b/tests/language/failed_unused_argument.das @@ -4,7 +4,7 @@ options gen2 options no_unused_function_arguments = true -expect 40206:2 +expect 30159 [sideeffects] def haha(a, b, c) {// 40206: unused function argument b diff --git a/tests/language/invalid_argument_count_mix.das b/tests/language/invalid_argument_count_mix.das index c01021ecae..5d59c66626 100644 --- a/tests/language/invalid_argument_count_mix.das +++ b/tests/language/invalid_argument_count_mix.das @@ -2,7 +2,7 @@ // verifies compiler rejects calling assert and debug with // too few or too many arguments options gen2 -expect 30107:4 // invalid_argument_count +expect 30116:2, 30141:2 // invalid_argument_count def test { // assert 1 or 2 arguments diff --git a/tests/language/invalid_array_type_mix.das b/tests/language/invalid_array_type_mix.das index 454f32bfe4..b2ddf62f17 100644 --- a/tests/language/invalid_array_type_mix.das +++ b/tests/language/invalid_array_type_mix.das @@ -1,7 +1,7 @@ // invalid array element types // verifies compiler rejects array and array options gen2 -expect 30105:2 // invalid_array_type +expect 30108:2 // invalid_array_type def test { let a : array // can't have array of ref diff --git a/tests/language/invalid_block.das b/tests/language/invalid_block.das index a951982bba..c19388f232 100644 --- a/tests/language/invalid_block.das +++ b/tests/language/invalid_block.das @@ -2,7 +2,7 @@ // verifies block errors: break from captured block, block type mismatches // (void vs int vs float), unexpected/missing return values options gen2 -expect 30801, 30304:4, 32102, 32101, 30102 // invalid_block +expect 30125, 30319, 30341:4, 30343, 31402 // invalid_block def take_any(b : block) { invoke(b) diff --git a/tests/language/invalid_escape_sequence.das b/tests/language/invalid_escape_sequence.das index 6ca5df47a5..d2aa80e318 100644 --- a/tests/language/invalid_escape_sequence.das +++ b/tests/language/invalid_escape_sequence.das @@ -1,7 +1,7 @@ // invalid string escape sequence // verifies compiler rejects unknown escape sequences like \x options gen2 -expect 10008 +expect 20105 [export] def test() { diff --git a/tests/language/invalid_index_type.das b/tests/language/invalid_index_type.das index 8d0991c5aa..04dec0eb11 100644 --- a/tests/language/invalid_index_type.das +++ b/tests/language/invalid_index_type.das @@ -2,7 +2,7 @@ // verifies compiler rejects non-integer indices for fixed arrays, // dynamic arrays, and constant table indexing options gen2 -expect 30110:3, 30106 // invalid_index_type +expect 30184:2, 30251, 30934 // invalid_index_type def test { let a : int[10] diff --git a/tests/language/invalid_infer_return_type.das b/tests/language/invalid_infer_return_type.das index 2c86046960..8929c2988a 100644 --- a/tests/language/invalid_infer_return_type.das +++ b/tests/language/invalid_infer_return_type.das @@ -2,7 +2,7 @@ // verifies compiler rejects mismatched return types in branches, // missing return values, and unexpected return values options gen2 -expect 30102, 32101, 32102 +expect 30319, 30343, 31402 def test_mix(arg : bool) { if (arg) { diff --git a/tests/language/invalid_return_type_mix.das b/tests/language/invalid_return_type_mix.das index fe0bca83ed..c0a08b17a6 100644 --- a/tests/language/invalid_return_type_mix.das +++ b/tests/language/invalid_return_type_mix.das @@ -2,7 +2,7 @@ // verifies compiler rejects returning a block from a function // (blocks are not valid return types) options gen2 -expect 30102, 30102 +expect 30167, 30221 struct Foo { a : int diff --git a/tests/language/invalid_structure_field_type_ref.das b/tests/language/invalid_structure_field_type_ref.das index c7656d2c69..3f8157a4ef 100644 --- a/tests/language/invalid_structure_field_type_ref.das +++ b/tests/language/invalid_structure_field_type_ref.das @@ -1,7 +1,7 @@ // ref type in struct field // verifies compiler rejects reference types as struct fields options gen2 -expect 30104 // invalid_structure_field_type +expect 30237 // invalid_structure_field_type struct Foo { a : int& diff --git a/tests/language/invalid_structure_field_type_void.das b/tests/language/invalid_structure_field_type_void.das index 1344e2e8ef..5220ae8b40 100644 --- a/tests/language/invalid_structure_field_type_void.das +++ b/tests/language/invalid_structure_field_type_void.das @@ -1,7 +1,7 @@ // void type in struct field // verifies compiler rejects void as a struct field type options gen2 -expect 30104 // invalid_structure_field_type +expect 30237 // invalid_structure_field_type struct Foo { a : void diff --git a/tests/language/invalid_table_type_mix.das b/tests/language/invalid_table_type_mix.das index 1c329551c5..52e4eafc4e 100644 --- a/tests/language/invalid_table_type_mix.das +++ b/tests/language/invalid_table_type_mix.das @@ -2,7 +2,7 @@ // verifies compiler rejects ref keys, non-hashable keys (array), // and void local variables options gen2 -expect 30106:2, 30108 // invalid_table_type +expect 30202, 30248, 30254 // invalid_table_type def test { let a : table // can't have table key ref diff --git a/tests/language/invalid_type_ref_in_table_value.das b/tests/language/invalid_type_ref_in_table_value.das index 4af6e9b399..9f721c8de1 100644 --- a/tests/language/invalid_type_ref_in_table_value.das +++ b/tests/language/invalid_type_ref_in_table_value.das @@ -1,7 +1,7 @@ // ref type as table value // verifies compiler rejects reference types in table values options gen2 -expect 30106 // invalid_table_type +expect 30248 // invalid_table_type def test { let a : table// can't have table value ref diff --git a/tests/language/invalid_types.das b/tests/language/invalid_types.das index f4128346bc..e80eb8804e 100644 --- a/tests/language/invalid_types.das +++ b/tests/language/invalid_types.das @@ -1,5 +1,5 @@ options gen2 -expect 30101:2, 30108:4, 30109:2 +expect 30500:3, 30508, 30510, 30512:2, 30513 require dastest/testing_boost public require daslib/lpipe diff --git a/tests/linq/failed_test_linq_join.das b/tests/linq/failed_test_linq_join.das index 64cca22c4f..5c209b9bad 100644 --- a/tests/linq/failed_test_linq_join.das +++ b/tests/linq/failed_test_linq_join.das @@ -5,7 +5,7 @@ // Each rejected shape produces one macro_failed (40104) diagnostic. // See modules/dasSQLITE/API_REWORK.md "### 23-joins" for the spec. options gen2 -expect 40104:5 +expect 50503:5 require daslib/linq require daslib/linq_boost diff --git a/tests/strings/failed_temporary_strings.das b/tests/strings/failed_temporary_strings.das index 43b4caec7f..600dc79c1d 100644 --- a/tests/strings/failed_temporary_strings.das +++ b/tests/strings/failed_temporary_strings.das @@ -1,5 +1,5 @@ options gen2 -expect 40102:3 +expect 50501:3 require dastest/testing_boost require daslib/temp_strings diff --git a/tests/unsafe/failed_unsafe_reference.das b/tests/unsafe/failed_unsafe_reference.das index d1eea6cc38..d52622efca 100644 --- a/tests/unsafe/failed_unsafe_reference.das +++ b/tests/unsafe/failed_unsafe_reference.das @@ -1,5 +1,5 @@ options gen2 -expect 31300 +expect 31019 options persistent_heap = true options gc diff --git a/tests/verify/failed_test_verify_completion.das b/tests/verify/failed_test_verify_completion.das index 738837763e..75862fbeca 100644 --- a/tests/verify/failed_test_verify_completion.das +++ b/tests/verify/failed_test_verify_completion.das @@ -1,5 +1,5 @@ options gen2 -expect 40104:8 +expect 50503:8 // Verify that [verify_completion] rejects unbounded loops and recursive calls. diff --git a/utils/lint/tests/lint006_division_by_zero.das b/utils/lint/tests/lint006_division_by_zero.das index 1aa31ff36b..21fafb4b8f 100644 --- a/utils/lint/tests/lint006_division_by_zero.das +++ b/utils/lint/tests/lint006_division_by_zero.das @@ -11,7 +11,7 @@ options gen2 // Good pattern: // let y = x / divisor -expect 40104:10 +expect 50503:10 require daslib/lint diff --git a/utils/lint/tests/lint007_same_operands.das b/utils/lint/tests/lint007_same_operands.das index 6ee92ca9c6..c70eb1b648 100644 --- a/utils/lint/tests/lint007_same_operands.das +++ b/utils/lint/tests/lint007_same_operands.das @@ -22,7 +22,7 @@ options gen2 // fire. LINT007 catches cases where operands are runtime values (function // parameters, field reads, etc.). The fixture uses parameters on purpose. -expect 40104:17 +expect 50503:17 require daslib/lint diff --git a/utils/lint/tests/lint008_ternary_same_branches.das b/utils/lint/tests/lint008_ternary_same_branches.das index ec4c303368..8ea096aef3 100644 --- a/utils/lint/tests/lint008_ternary_same_branches.das +++ b/utils/lint/tests/lint008_ternary_same_branches.das @@ -11,7 +11,7 @@ options gen2 // Good pattern: // return cond ? then_value : else_value -expect 40104:3 +expect 50503:3 require daslib/lint diff --git a/utils/lint/tests/lint009_if_same_branches.das b/utils/lint/tests/lint009_if_same_branches.das index 7c7afb2f39..92ce766bbb 100644 --- a/utils/lint/tests/lint009_if_same_branches.das +++ b/utils/lint/tests/lint009_if_same_branches.das @@ -21,7 +21,7 @@ options gen2 // x = 2 // } -expect 40104:3 +expect 50503:3 require daslib/lint diff --git a/utils/lint/tests/perf006_push_without_reserve.das b/utils/lint/tests/perf006_push_without_reserve.das index 4f35ec81ca..57d3435321 100644 --- a/utils/lint/tests/perf006_push_without_reserve.das +++ b/utils/lint/tests/perf006_push_without_reserve.das @@ -19,7 +19,7 @@ options gen2 // result |> push(i) // no reallocs // } -expect 40217:9 +expect 31208:9 require daslib/perf_lint diff --git a/utils/lint/tests/perf007_string_das_string.das b/utils/lint/tests/perf007_string_das_string.das index ebbf4717ad..856e6345d4 100644 --- a/utils/lint/tests/perf007_string_das_string.das +++ b/utils/lint/tests/perf007_string_das_string.das @@ -14,7 +14,7 @@ options gen2 // if (name == "foo") { ... } // if (a == b) { ... } -expect 40217:3 +expect 31208:3 require daslib/perf_lint require daslib/ast_boost diff --git a/utils/lint/tests/perf009_redundant_move_return.das b/utils/lint/tests/perf009_redundant_move_return.das index a59dd7f3d0..ac6c7c8472 100644 --- a/utils/lint/tests/perf009_redundant_move_return.das +++ b/utils/lint/tests/perf009_redundant_move_return.das @@ -13,7 +13,7 @@ options gen2 // Good pattern: // return <- make_thing() -expect 40217:3 +expect 31208:3 require daslib/perf_lint diff --git a/utils/lint/tests/perf010_get_ptr_null.das b/utils/lint/tests/perf010_get_ptr_null.das index fcccc1bc86..6d98e5ff87 100644 --- a/utils/lint/tests/perf010_get_ptr_null.das +++ b/utils/lint/tests/perf010_get_ptr_null.das @@ -9,7 +9,7 @@ options gen2 // Good pattern: // if (ptr == null) { ... } -expect 40217:1 +expect 31208:1 require daslib/perf_lint require daslib/ast_boost diff --git a/utils/lint/tests/perf011_get_ptr_field.das b/utils/lint/tests/perf011_get_ptr_field.das index ac3fc970ec..862150df22 100644 --- a/utils/lint/tests/perf011_get_ptr_field.das +++ b/utils/lint/tests/perf011_get_ptr_field.das @@ -9,7 +9,7 @@ options gen2 // Good pattern: // let name = prog.flags -expect 40217:1 +expect 31208:1 require daslib/perf_lint require daslib/ast_boost