| 688 | } |
| 689 | |
| 690 | void implAddGenericFunction ( yyscan_t scanner, Function * func ) { |
| 691 | for ( auto & arg : func->arguments ) { |
| 692 | vector<MatchingOptionError> optionErrors; |
| 693 | findMatchingOptions(arg->type, optionErrors); |
| 694 | if ( !optionErrors.empty() ) { |
| 695 | for ( auto & opt : optionErrors ) { |
| 696 | // opt.type has matching options opt.option1 and opt.option2 |
| 697 | das_yyerror(scanner,"generic function argument " + arg->name + " of type " + opt.optionType->describe() |
| 698 | + " has matching options " + opt.option1->describe() + " and " + opt.option2->describe(), |
| 699 | opt.optionType->at, CompilationError::ambiguous_function_argument_type); |
| 700 | } |
| 701 | } |
| 702 | } |
| 703 | if ( !yyextra->g_Program->addGeneric(func) ) { |
| 704 | das_yyerror(scanner,"generic function is already defined " + func->getMangledName(), |
| 705 | func->at, CompilationError::already_declared_function); |
| 706 | } |
| 707 | } |
| 708 | |
| 709 | vector<VariableDeclaration*> * ast_structVarDef ( yyscan_t scanner, vector<VariableDeclaration*> * list, |
| 710 | AnnotationList * annL, bool isStatic, bool isPrivate, int ovr, bool cnst, Function * func, Expression * block, |
no test coverage detected