| 4235 | } |
| 4236 | |
| 4237 | void findMatchingOptions ( const TypeDeclPtr & type, vector<MatchingOptionError> & matching ) { |
| 4238 | if ( type->baseType == Type::option ) { |
| 4239 | // lets see if one of the argTypes is the same as the other |
| 4240 | for ( size_t ai=0, as=type->argTypes.size(); ai<as; ++ai ) { |
| 4241 | auto & argT = type->argTypes[ai]; |
| 4242 | for ( size_t bi=ai+1; bi<as; ++bi ) { |
| 4243 | auto & argB = type->argTypes[bi]; |
| 4244 | if ( argT->isSameType(*argB, RefMatters::yes, ConstMatters::yes, TemporaryMatters::yes, AllowSubstitute::no, true, false) ) { |
| 4245 | matching.push_back({type,argT,argB}); |
| 4246 | goto found; |
| 4247 | } |
| 4248 | } |
| 4249 | } |
| 4250 | found:; |
| 4251 | } else { |
| 4252 | if ( type->firstType ) { |
| 4253 | findMatchingOptions(type->firstType, matching); |
| 4254 | } |
| 4255 | if ( type->secondType ) { |
| 4256 | findMatchingOptions(type->secondType, matching); |
| 4257 | } |
| 4258 | for ( auto & argT : type->argTypes ) { |
| 4259 | findMatchingOptions(argT, matching); |
| 4260 | } |
| 4261 | } |
| 4262 | } |
| 4263 | } |
no test coverage detected