| 261 | //========================================================================== |
| 262 | |
| 263 | FxExpression* CheckForMemberDefault(FxStructMember *func, FCompileContext &ctx) |
| 264 | { |
| 265 | auto& membervar = func->membervar; |
| 266 | auto& classx = func->classx; |
| 267 | auto& ScriptPosition = func->ScriptPosition; |
| 268 | |
| 269 | if (membervar->SymbolName == NAME_Default) |
| 270 | { |
| 271 | if (!classx->ValueType->isObjectPointer() |
| 272 | || !static_cast<PObjectPointer *>(classx->ValueType)->PointedClass()->IsDescendantOf(RUNTIME_CLASS(AActor))) |
| 273 | { |
| 274 | ScriptPosition.Message(MSG_ERROR, "'Default' requires an actor type"); |
| 275 | delete func; |
| 276 | return nullptr; |
| 277 | } |
| 278 | FxExpression * x = new FxClassDefaults(classx, ScriptPosition); |
| 279 | classx = nullptr; |
| 280 | delete func; |
| 281 | return x->Resolve(ctx); |
| 282 | } |
| 283 | return func; |
| 284 | } |
| 285 | |
| 286 | //========================================================================== |
| 287 | // |
nothing calls this directly
no test coverage detected