Generalize type inference and add target-derived bounds - #1
Draft
MadsTorgersen wants to merge 2 commits into
Draft
Generalize type inference and add target-derived bounds#1MadsTorgersen wants to merge 2 commits into
MadsTorgersen wants to merge 2 commits into
Conversation
MadsTorgersen
force-pushed
the
madstorgersen-generalized-type-inference
branch
2 times, most recently
from
August 13, 2026 22:51
d16e303 to
8e061f0
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
MadsTorgersen
force-pushed
the
madstorgersen-generalized-type-inference
branch
3 times, most recently
from
August 13, 2026 23:55
c42ec95 to
69f95a2
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
MadsTorgersen
force-pushed
the
madstorgersen-generalized-type-inference
branch
from
August 13, 2026 23:56
69f95a2 to
998811f
Compare
This was referenced Aug 17, 2026
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
This is the bottom layer of the confirmed type-inference stack. It intentionally excludes constructor inference, type-group lookup, and higher-layer changes.
Commit structure
Generalize the type inference algorithmpreserves existing behavior while remodeling the specification.Infer generic types from target typescontains the intentional semantic changes and provisional method-invocation hook.Breaking changes
Target-derived inference can make previously failing candidates succeed, change inferred type arguments for candidates that already succeeded, introduce or remove ambiguities, change overload selection, or cause inference to fail where it previously succeeded. By-ref result and target types now contribute exact bounds; compatibility of their ref kinds remains the responsibility of the consuming target context.
Method-group conversions now use the delegate return type for inference. This makes previously failing conversions such as assigning
G<T>()to a return-compatible delegate succeed, and can likewise change candidate sets, ambiguity, or selection.These effects must be investigated and documented in the corresponding csharplang proposals.
Validation
StandardAnchorTags --dryruna827d023182ffe63a393b57f740fae3e1ad5a206