True if this class has a non-generated finalizer method. Class finalizers keep the plain name "finalize" (parser: ast_structVarDef), so the registry lookup is by that name with the classParent identity check filtering out other classes' finalizers and free-function struct finalizers.
| 347 | // by that name with the classParent identity check filtering out other classes' |
| 348 | // finalizers and free-function struct finalizers. |
| 349 | bool Structure::hasUserFinalizer() const { |
| 350 | if ( !module ) return false; |
| 351 | uint64_t hName = hash64z("finalize"); |
| 352 | if ( auto kv = module->functionsByName.find(hName) ) { |
| 353 | for ( auto * fn : kv->second ) { |
| 354 | if ( !fn->generated && fn->classParent == this ) return true; |
| 355 | } |
| 356 | } |
| 357 | if ( auto kv = module->genericsByName.find(hName) ) { |
| 358 | for ( auto * fn : kv->second ) { |
| 359 | if ( !fn->generated && fn->classParent == this ) return true; |
| 360 | } |
| 361 | } |
| 362 | return false; |
| 363 | } |
| 364 | |
| 365 | bool Structure::canCopy(bool tempMatters) const { |
| 366 | if ( circularGuard ) return true; |
no test coverage detected