Thanks to visit codestin.com
Credit goes to github.com

Skip to content

import as does not work #2153

Closed
Closed
@Smit-create

Description

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

def f(x: i32) -> i32:
    return 2 *x
% cat b.py
from lpython import f64
from a import f as fa

def main0():
    print(fa(3))

main0()

Error:

% lpython b.py -I .
semantic error: Function 'fa' is not declared and not intrinsic
 --> b.py:5:11
  |
5 |     print(fa(3))
  |           ^^^^^ 

CPython:

% PYTHONPATH=$PWD/src/runtime/lpython python b.py 
6

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions