Compiler allows class method to be declared after const
## Summary <!-- Summarize the bug encountered concisely --> Compiler allows class method to be declared after const. Normal procedure cannot be declared after const. Delphi doesn't allow either of them. ## System Information <!-- The more information are provided the easier it is to replicate the bug --> - **Operating system:** Windows - **Processor architecture:** x86 - **Compiler version:** trunk - **Device:** Computer ## Example Project <!-- If possible, please create an example project that exhibits the problematic behavior, and link to it here in the bug report. --> ```pascal program project1; {$mode objfpc} type TMyClass = class(TObject) const procedure A; virtual; abstract; // should not be allowed end; begin end. ``` Normal procedure is not allowed ```pascal unit Unit1; {$mode objfpc} interface const procedure A; // FPC error: Unit1.pas(5,3) Fatal: Syntax error, "identifier" expected but "PROCEDURE" found implementation procedure A; begin end; end. ``` ## What is the current bug behavior? <!-- What actually happens --> It compiles. ## What is the expected (correct) behavior? <!-- What you should see instead --> It should not compile.
issue