In reply to Naven8:
No, you are not right.
If you compile this code as verilog, all tools(I only tried VCS and iRUN, but I think other tools will report same result)will report error. If you compile this code as systemverilog(vcs -sverilog, irun -sv), both tools will pass and not report error.
You can try it.