End names are a feature introduced with SystemVerilog. In Verilog files (files that have a .v suffix or that are explicitly configured to be treated as Verilog), using end names is not allowed.
In a Verilog file:
VERILOG
module main;
endmodule : mainA Quick Fix is offered for this error which can remove the illegal end name.