Skip to content

Conversation

makslevental
Copy link
Contributor

@makslevental makslevental commented Sep 25, 2025

is causes the asserts to fail when the return hint is interpreted as
OpResult | OpResultList | test.SameVariadicResultSizeOpVFV

@llvmbot
Copy link
Member

llvmbot commented Sep 25, 2025

@llvm/pr-subscribers-mlir

Author: Maksim Levental (makslevental)

Changes

is causes the asserts to fail when the return hint is interpreted as
OpResult | OpResultList | test.SameVariadicResultSizeOpVFV


Full diff: https://github.com/llvm/llvm-project/pull/160718.diff

1 Files Affected:

  • (modified) mlir/test/python/dialects/python_test.py (+3-3)
diff --git a/mlir/test/python/dialects/python_test.py b/mlir/test/python/dialects/python_test.py
index 761d22357f8f8..1194e32c960c8 100644
--- a/mlir/test/python/dialects/python_test.py
+++ b/mlir/test/python/dialects/python_test.py
@@ -904,7 +904,7 @@ def types(lst):
 
             assert (
                 typing.get_type_hints(test.same_variadic_result_vfv)["return"]
-                is Union[OpResult, OpResultList, test.SameVariadicResultSizeOpVFV]
+                == Union[OpResult, OpResultList, test.SameVariadicResultSizeOpVFV]
             )
             assert (
                 type(test.same_variadic_result_vfv([i[0], i[1]], i[2], [i[3], i[4]]))
@@ -992,7 +992,7 @@ def types(lst):
 
             assert (
                 typing.get_type_hints(test.results_variadic)["return"]
-                is Union[OpResult, OpResultList, test.ResultsVariadicOp]
+                == Union[OpResult, OpResultList, test.ResultsVariadicOp]
             )
             assert type(test.results_variadic([i[0]])) is OpResult
             op_res_variadic = test.ResultsVariadicOp([i[0]])
@@ -1003,7 +1003,7 @@ def types(lst):
             assert type(op_res_variadic.res) is OpResultList
 
 
-# CHECK-LABEL: TEST: testVariadicAndNormalRegion
+# CHECK-LABEL: TEST: testVariadicAndNormalRegionOp
 @run
 def testVariadicAndNormalRegionOp():
     with Context() as ctx, Location.unknown(ctx):

Copy link
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good : ) Just out of curiosity, what mechanism causes Union to be automatically converted into |?

@makslevental
Copy link
Contributor Author

Looks good : ) Just out of curiosity, what mechanism causes Union to be automatically converted into |?

Haven't the faintest clue - never seen that prior to the report from @tbaederr

@makslevental makslevental merged commit d995c41 into main Sep 25, 2025
13 checks passed
@makslevental makslevental deleted the users/makslevental/fix-python-test branch September 25, 2025 15:26
@tbaederr
Copy link
Contributor

Nice, thanks.

mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
…#160718)

`is` causes the asserts to fail when the return hint is interpreted as 
`OpResult | OpResultList | test.SameVariadicResultSizeOpVFV`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants