| 12596 | } |
| 12597 | |
| 12598 | static bool AreCompatibleFnPtrs(PFunctionPointer * to, PFunctionPointer * from) |
| 12599 | { |
| 12600 | if(to->PointedType == TypeVoid) return true; |
| 12601 | else if(from->PointedType == TypeVoid) return false; |
| 12602 | |
| 12603 | PPrototype * toProto = (PPrototype *)to->PointedType; |
| 12604 | PPrototype * fromProto = (PPrototype *)from->PointedType; |
| 12605 | return |
| 12606 | ( FScopeBarrier::CheckSidesForFunctionPointer(from->Scope, to->Scope) |
| 12607 | /* |
| 12608 | && toProto->ArgumentTypes == fromProto->ArgumentTypes |
| 12609 | && toProto->ReturnTypes == fromProto->ReturnTypes |
| 12610 | */ |
| 12611 | && AreCompatibleFnPtrTypes(toProto, fromProto) |
| 12612 | && to->ArgFlags == from->ArgFlags |
| 12613 | ); |
| 12614 | } |
| 12615 | |
| 12616 | FxExpression *FxFunctionPtrCast::Resolve(FCompileContext &ctx) |
| 12617 | { |
no test coverage detected