Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: get_binding_type should resolve the already-defined variable type #595

Closed
Drvi opened this issue Jan 24, 2024 · 1 comment

Comments

@Drvi
Copy link

Drvi commented Jan 24, 2024

Here is an innocent-looking code that triggers an assertion error:

julia> JET.report_text("""
       n=50
       rng = MersenneTwister(1)
       keys = rand(rng,n)
       """)
ERROR: AssertionError: `get_binding_type` should resolve the already-defined variable type

This is JET 0.8.21 with Julia 1.9.2. Here are some debug logs:

[toplevel-debug] virtualized the context of Main (took 0.007 sec)
[toplevel-debug] entered into top-level
[toplevel-debug] concretization plan at top-level:1:
1 f 1 ─ %1 = Core.get_binding_type(Main.var"##JETVirtualModule#292", :n)
2 f │   %2 = Base.convert(%1, 50)
3 f │   %3 = Core.typeassert(%2, %1)
4 f │        n = %3
5 f └──      return 50
[toplevel-debug] concretization plan at top-level:2:
1 f 1 ─ %1 = MersenneTwister(1)
2 f │   %2 = Core.get_binding_type(Main.var"##JETVirtualModule#292", :rng)
3 f │   %3 = Base.convert(%2, %1)
4 f │   %4 = Core.typeassert(%3, %2)
5 f │        rng = %4
6 f └──      return %1
[toplevel-debug] concretization plan at top-level:3:
1 f 1 ─ %1 = rand(rng, n)
2 f │   %2 = Core.get_binding_type(Main.var"##JETVirtualModule#292", :keys)
3 f │   %3 = Base.convert(%2, %1)
4 f │   %4 = Core.typeassert(%3, %2)
5 f │        keys = %4
6 f └──      return %1
@aviatesk
Copy link
Owner

aviatesk commented Feb 1, 2024

Thank you for reporting this. Regrettably, this issue appears to not reproduce in versions 1.10 and later. Additionally, the newest version of JET has dropped support for v1.9, so it's unlikely that this issue will be addressed. I suggest upgrading to Julia version 1.10.

@aviatesk aviatesk closed this as completed Feb 1, 2024
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

No branches or pull requests

2 participants