Skip to content

Fix "Subtyping test returned a reasoning with an invalid path" for mismatches with negations of unions and intersections#2543

Open
PhoenixWhitefire wants to merge 4 commits into
luau-lang:masterfrom
PhoenixWhitefire:negation-subtype-path
Open

Fix "Subtyping test returned a reasoning with an invalid path" for mismatches with negations of unions and intersections#2543
PhoenixWhitefire wants to merge 4 commits into
luau-lang:masterfrom
PhoenixWhitefire:negation-subtype-path

Conversation

@PhoenixWhitefire

@PhoenixWhitefire PhoenixWhitefire commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Fixes the error "Subtyping test returned a reasoning with an invalid path" for the following code:

type function negate(ty)
    return types.negationof(ty)
end

type T = negate<false?>
local x: T = false -- Here

Instead, the full error is now:

Expected this to be '~(false?)', but got 'false'; 
the negation `~(false?)`, and `false` is not a subtype of `~(false?)

, instead of just the first line and the aforementioned subtype reasoning error. This was also fixed for intersections.

Adds flag LuauNegationsFixSubtypePath, and 2 tests.

PhoenixWhitefire added a commit to PhoenixWhitefire/luau that referenced this pull request Jul 12, 2026
@PhoenixWhitefire PhoenixWhitefire changed the title Fix "Subtyping test returned a reasoning with an invalid path" for mismatches with negations of unions Fix "Subtyping test returned a reasoning with an invalid path" for mismatches with negations of unions and intersections Jul 12, 2026
PhoenixWhitefire added a commit to PhoenixWhitefire/luau that referenced this pull request Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant