| 2217 | } |
| 2218 | |
| 2219 | bool TypeDecl::isAuto() const { |
| 2220 | // auto is auto.... or auto....?5 |
| 2221 | // also dim[] is aito |
| 2222 | for (auto di : dim) { |
| 2223 | if (di == TypeDecl::dimAuto) { |
| 2224 | return true; |
| 2225 | } |
| 2226 | } |
| 2227 | switch ( baseType ) { |
| 2228 | case Type::typeMacro: |
| 2229 | case Type::typeDecl: |
| 2230 | case Type::autoinfer: |
| 2231 | case Type::option: |
| 2232 | return true; |
| 2233 | case Type::tPointer: |
| 2234 | case Type::tIterator: |
| 2235 | case Type::tArray: |
| 2236 | return firstType ? firstType->isAuto() : false; |
| 2237 | case Type::tTable: |
| 2238 | if ( firstType && firstType->isAuto() ) { |
| 2239 | return true; |
| 2240 | } |
| 2241 | return secondType ? secondType->isAuto() : false; |
| 2242 | case Type::tBlock: |
| 2243 | case Type::tFunction: |
| 2244 | case Type::tLambda: |
| 2245 | case Type::tTuple: |
| 2246 | case Type::tVariant: |
| 2247 | if (firstType && firstType->isAuto() ) { |
| 2248 | return true; |
| 2249 | } |
| 2250 | for (auto& arg : argTypes) { |
| 2251 | if ( arg->isAuto() ) { |
| 2252 | return true; |
| 2253 | } |
| 2254 | } |
| 2255 | return false; |
| 2256 | default: |
| 2257 | return false; |
| 2258 | } |
| 2259 | } |
| 2260 | |
| 2261 | bool TypeDecl::isAutoWithoutOptions(bool & hasOptions) const { |
| 2262 | // auto is auto.... or auto....? |
no outgoing calls
no test coverage detected