Repository navigation
Type number-or-string DAP ids as Int64 - #142
Merged
Merged
Conversation
`DAModule.id` and `StackFrame.moduleId` were `Union{Int,String}`. The
dict constructor passes such a union field through unconverted, and JSON
numbers parse as `Int64`, which does not convert to `Union{Int32,String}`
on 32-bit Julia. Neither type is ever read from a client message, so this
was latent, but it is the same shape as JSONRPC.jl#127.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
This PR was opened by Claude (Claude Code) on David's behalf.
What
DAModule.idandStackFrame.moduleIdareUnion{Int,String}/Union{Missing,Int,String}. On 32-bit Julia that isInt32, but JSON numbers always parse asInt64. For a union that isn't justMissingplus one type,@dict_readable'sfield_typegivesAny, so the value is passed through unconverted. The default constructor'sconvert(Union{Int32,String}, ::Int64)then throws aMethodError. This is the same shape as JSONRPC.jl#127 (julia-vscode#4260).This PR changes both fields to
Int64.Impact
Latent: nothing that happens today can trigger it. Neither type can be reached from any registered request or event's parameter type. The adapter only ever sends
StackFrame, always withmoduleId = missing, and nothing usesDAModule. That is consistent with this never showing up in crash telemetry.I also checked the plain-
Intfields that are read from client messages:threadId,frameId,variablesReference,sourceReference,targetId, line/column, and pagingstart/count.InexactErrorat 2^31 and above on 32-bit.Tests
Two new test items in
test/test_json_serialization.jl:_parse_jsonoutput with numeric and string ids. It also checks the declared field types, so it means something on 64-bit legs as well.Outboundtype and requires each integer-bearing field to accept anInt64. It catches futureUnion{Int,String}-style fields, but only bites on the~x86legs.Local runs:
MethodError)Checklist
🤖 Generated with Claude Code