Repository navigation
Conversation
2.0 / 0 is Infinity under IEEE 754, not NaN (only 0.0 / 0.0 is NaN). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unsuffixed int literals were an EXACT match for every integer type they fit into, so e.g. 2.0 / 0 matched nine operator overloads equally. Now only int (or long, if the value doesn't fit) is EXACT; other types are INFERRED, mirroring the float/double handling from 148a61e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kindlich
force-pushed
the
fix/mod-type-inference-1-2-expectations
branch
from
October 18, 2026 11:46
c641dcd to
ca73b27
Compare
kindlich
marked this pull request as ready for review
October 18, 2026 11:54
kindlich
added this pull request to stack #192
October 18, 2026 11:54
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.
Summary
mod_type_inference_1and_2expectedNaNfor2.0 / 0, but IEEE 754 givesInfinity(only0.0 / 0.0isNaN).2.0 / 0failed with "Ambiguous call", because an unsuffixed int literal was anEXACTmatch for every integer type it fits into, so ninedouble /overloads tied. Now only the literal's natural type (int, orlongif it doesn't fit) isEXACT; other types areINFERRED. This mirrors the float/double handling from 148a61e.gradlewmarked executable.Testing
./gradlew test: bothmod_type_inferencetests pass. The remaining failures areRawTypeInHeaderTest.testRawTypeErrors1/2, which already failed before this change and are unrelated (raw generic type in a Java global's parameter).🤖 Generated with Claude Code