Imagine I have three files.
file1.jl
module myFirstModule
struct MyStruct
attribute :: String
end
end
file2.jl
module mySecondModule
include("file1.jl")
include("file3.jl")
myThirdModule.hello(myFirstModule.MyStruct("a"))
end
file3.jl
module myThirdModule
include("file1.jl")
function hello(arg)
println("argument : ", arg)
println("isa test : ", isa(arg, myFirstModule.MyStruct))
end
end
Well, there, the second module creates an instance of myStruct, and calls the “hello” function from the third module with that instance as an argument.
That is the console output :
argument : Main.mySecondModule.myFirstModule.MyStruct("a")
isa test : false
As you can see, the result of the isa test is false .
This acutally means that arg 's type isn’t myFirstModule.MyStruct , but when I print arg , as you can see I’m getting this : Main.mySecondModule.myFirstModule.MyStruct("a")
Does it mean that myFirstModule.MyStruct != Main.mySecondModule.myFirstModule.MyStruct ?