amarna
amarna copied to clipboard
Warn when an import shadows a locally defined function
We would flag the following foo import
# library.cairo
func foo() -> ():
end
and
# main.cairo
from library import foo as bar
func bar() -> ():
end
func main() -> ():
bar()
end
This should also work for unaliased import.
We should also check the compiler behavior so we could provide further details when this is found.
The compiler seem to cover this case, both for aliased/unaliased imports.
$ cairo-compile main.cairo
main.cairo:3:6: Redefinition of '__main__.bar'.
func bar() -> ():
^*^