Fix compile on UE 5.8: FJsonObject keys are now FSharedString - #48
Open
javidmedina wants to merge 1 commit into
Open
Fix compile on UE 5.8: FJsonObject keys are now FSharedString#48javidmedina wants to merge 1 commit into
javidmedina wants to merge 1 commit into
Conversation
In UE 5.8, FJsonObject::Values is keyed by UE::FSharedString rather than FString (Dom/JsonObject.h), so iterating Values and passing Pair.Key where an FString is expected no longer compiles. Ten call sites fail with C2664/C2665/C2039. Wrap each with FString(*Pair.Key). TSharedString::operator* returns const TCHAR*, and FString::operator* does too, so this also compiles unchanged on 5.7 and earlier. Verified by building the plugin against UE 5.8 (Win64, Development Editor): the module compiles, loads, and the MCP server starts and serves all 28 tools.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
FJsonObject::Valuesis keyed byUE::FSharedStringin UE 5.8 rather thanFString(seeRuntime/Json/Public/Dom/JsonObject.h). Any loop overValuesthat passesPair.Keywhere anFStringis expected stops compiling. Ten call sites fail:How
Each site is wrapped as
FString(*Pair.Key).This is deliberately version-agnostic rather than
#if ENGINE_MINOR_VERSION-gated:TSharedString::operator*returnsconst TCHAR*, and so doesFString::operator*, so the same expression compiles against both the 5.8 shared-string storage and the olderFStringstorage. No preprocessor branching, no behaviour change.Not included
I left
EngineVersioninUnrealClaude.upluginat5.7.0so this stays a pure compile fix and doesn't change what the launcher reports for existing users. Anyone building for 5.8 will want to bump that locally.Testing
Built against UE 5.8, Win64, Development Editor. Results:
PostEngineInitRegistered 28 MCP tools,MCP Server started on http://localhost:3000GET /mcp/statusreturns{"status":"running","port":3000,"toolCount":28,...}Not regression-tested against 5.7 — I don't have a 5.7 install — but the change is a no-op there by construction.