You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When declaring a variable by property destructuring, type inference incorrectly infers that the new variable has the same type as the right hand side, instead of the corresponding field of the right hand side. This results in false positive warnings about the usage of the variable, for example julia-vscode #2639. For example, in the following tests the first test fails, while the second test passes:
@testset"type-inference in property destructuring"begin
cst =parse_and_pass(""" struct S a end struct T s::S end function f1(t::T) (; s) = t a = s.a end function f2(t::T) s = t.s x = s.a end""")
S = cst.meta.scope.names["S"]
@test cst.meta.scope.names["f1"].val.meta.scope.names["s"].type == S # fails, left-hand side is type T instead of S@test cst.meta.scope.names["f2"].val.meta.scope.names["s"].type == S # passesend
The text was updated successfully, but these errors were encountered:
When declaring a variable by property destructuring, type inference incorrectly infers that the new variable has the same type as the right hand side, instead of the corresponding field of the right hand side. This results in false positive warnings about the usage of the variable, for example julia-vscode #2639. For example, in the following tests the first test fails, while the second test passes:
The text was updated successfully, but these errors were encountered: