In reply to bhupesh.paliwal:
Yes, you have misunderstood. Different tools have different defaults for handle compilations scopes. Any tools that compiles the code you wrote as a single compilation unit will not produce an error and has nothing to do with packages. Try experimenting with the code I gave you.