LLVM Type Error on Inheritance #290

Closed
opened 2022-05-30 04:06:38 +08:00 by ychenfo · 0 comments
Collaborator

Code to reproduce the error:

@extern
def print_int32(x: int32):
    ...

@nac3
class A:
    a: Kernel[int32]
    def __init__(self, a):
        self.a = a
    
    @kernel
    def f1(self):
        self.f2()
    
    @kernel
    def f2(self):
        print_int32(self.a)

@nac3
class B(A):
    b: Kernel[int32]
    def __init__(self, b):
        self.a = b + 1
        self.b = b

bbb = B(2)

@nac3
class Demo:
    core: KernelInvariant[Core]
    def __init__(self):
        self.core = Core()

    @kernel
    def run(self):
        bbb.f1()

if __name__ == "__main__":
    Demo().run()

output:

Call parameter type does not match function signature!
%__main__.B* @"139864582798688"
 %__main__.A*  call void @__main__.A.f2.0(%__main__.B* @"139864582798688"), !dbg !9
Code to reproduce the error: ```python @extern def print_int32(x: int32): ... @nac3 class A: a: Kernel[int32] def __init__(self, a): self.a = a @kernel def f1(self): self.f2() @kernel def f2(self): print_int32(self.a) @nac3 class B(A): b: Kernel[int32] def __init__(self, b): self.a = b + 1 self.b = b bbb = B(2) @nac3 class Demo: core: KernelInvariant[Core] def __init__(self): self.core = Core() @kernel def run(self): bbb.f1() if __name__ == "__main__": Demo().run() ``` output: ``` Call parameter type does not match function signature! %__main__.B* @"139864582798688" %__main__.A* call void @__main__.A.f2.0(%__main__.B* @"139864582798688"), !dbg !9 ```
sb10q closed this issue 2022-06-01 20:09:56 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#290
There is no content yet.