You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the code snippet below, I get the following compiler error:
/source/prog.mojo:14:37: error: invalid initialization: argument #1 cannot be converted from 'fn(num: Int) -> String' to 'fn(Int) -> String'
var a = FuncyStruct[Int, String](convert)
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/source/prog.mojo:2:8: note: function declared here
struct FuncyStruct[I: AnyType, O: AnyType]:
^
mojo: error: failed to parse the provided Mojo source module
I was expecting the code to work fine and print 16. The compiler seems to consider the argument name as part of the type of the function. That's just an implementation detail and shouldn't be important to it.
Bug description
When running the code snippet below, I get the following compiler error:
I was expecting the code to work fine and print
16
. The compiler seems to consider the argument name as part of the type of the function. That's just an implementation detail and shouldn't be important to it.Steps to reproduce
Run the following code to reproduce the error:
System information
The text was updated successfully, but these errors were encountered: