Methods imported from submodules are overwritten, not extended

You either have to

      import .SubModule2: test_func2

      test_func2(a::Astruct) = println("method A")

or explicitly specify that you’re overriding SubModule’s function:

       using .SubModule

       SubModule.test_func(a::Astruct) = println("method A")
1 Like