I thought this was illegal. Yet with Julia 1.5.3 including the file M.jl runs:
# M.jl
# This works
function main()
include("A.jl")
end;
main()
# When the contents of the file A.jl is pasted directly into the function, there is an error.
#function main()
# module App
# function main()
# println("in App")
# end; main()
# end
#end;
#main()
and
# A.jl
module App
function main()
println("in App")
end; main()
end