MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / isAuto

Method isAuto

src/ast/ast_typedecl.cpp:2219–2259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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....?

Callers 15

yyparseFunction · 0.80
type_to_stringFunction · 0.80
ast_structureDeclarationFunction · 0.80
preVisitAliasMethod · 0.80
preVisitMethod · 0.80
visitStructureFieldMethod · 0.80
preVisitGlobalLetMethod · 0.80
visitGlobalLetInitMethod · 0.80
visitArgumentInitMethod · 0.80
visitArgumentMethod · 0.80
visitMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected