Skip to content

ASR: [BUG] Tuple/List Compare #1245

Closed
@Smit-create

Description

@Smit-create
% cat a.py
from ltypes import i32

def f():
    a: tuple[i32, i32]
    b: tuple[i32, i32]
    a = (1, 2)
    b = (1, 2)
    assert a == b
f()

LPython generates the ASR but looks incorrect:

(Assert 
                        (Var 2 b) 
                        ()
                    )

And, therefore it fails in the backend:

code generation error: asr_to_llvm: module failed verification. Error: 
Branch condition is not 'i1' type!
  br %tuple %16, label %then, label %else
  %16 = load %tuple, %tuple* %b, align 4

The same code works in CPython.

Metadata

Metadata

Assignees

No one assigned

    Labels

    asrASR related changesbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions