Bug report: Input does nt support the __call__mothod
Describe the bug When I run some sample code (see below) It fails. It is the sample code provided with the init types
How to reproduce:
- make a .mojo or .🔥 file
- copy the 'types' folder (the one inside the main git directory) in the same working dir as it
- put the sample code in the new file
- Attempt to run it (debugger or not) in vscode or the terminal, all fail
What should happen instead (expected behavior): It should do the same thing that the docs for the input class said - get your input
Minimum reproducible example:
from types import input
fn main():
let user_input: String = input("Enter something: ")
print("You entered: " + user_input)
let user_input2: String = input()
print("You entered: " + user_input2)
if user_input == user_input2:
print("They're the same!")
else:
print("They're different!")
Terminal output: Please give your terminal output here:
mojo test.🔥
/home/tsunami/mojo/test.🔥:4:35: error: '!lit.metatype<_"$types"::_"$input">' does not implement the '__call__' method
let user_input: String = input("Enter something: ")
^
/home/tsunami/mojo/test.🔥:6:36: error: '!lit.metatype<_"$types"::_"$input">' does not implement the '__call__' method
let user_input2: String = input()
^
mojo: error: failed to parse the provided Mojo
System (please fill in the following information):
- OS: Windows Subsystem for Linux
- Mojo Version: mojo 0.3.0 (f64f9601)
Additional context It fails even if I just extract the repo and replace the contents of the test.mojo with the code too!
Fixed with a change of import statement:
from types.input.input import input
Though it's weird why it didn't do that in the first place
Interesting, thank you for bringing this to my attention! I'll take a look into the issue.
Did a lot of work with coercing Docker to play nice and can reproduce the bug.
Maybe using a star import will fix this.