Status
Core diagnostic shipped on version-0.9.7 (commit 65dae3d). This issue now tracks the two remaining refinements (items 2 & 3 below).
Model correction (2026-06-07). Earlier versions of this issue — and the original #165 implementation — assumed an implementing CLASS,IMPLEMENTS(Interface) re-declares the interface's methods in its own body. That is wrong. Verified against the Clarion docs (INTERFACE (class behavior definition), Implementing INTERFACEs in Derived Classes) and the shipping LibSrc (C:\Clarion\Clarion11.1\LibSrc\win):
- The interface's method prototypes live in the
INTERFACE structure.
- The implementing class body holds only its own methods/data — never the interface methods. E.g.
CSocketConnection CLASS,...,IMPLEMENTS(IConnection) in abapi.inc lists Construct/Destruct/Init/Kill/..., none of IConnection's methods.
- The interface methods are implemented as three-part
Class.Interface.Method PROCEDURE definitions in the class's MODULE('x.clw') — e.g. CSocketConnection.IConnection.CloseSocket PROCEDURE in abapi.clw.
The old class-body check would have false-positived on every interface implementation in the shipping library. The diagnostic was rebuilt around the correct model.
What shipped (v1, 65dae3d)
Warns when a non-derived CLASS,IMPLEMENTS(Interface) does not provide an implementation for one of the interface's methods.
- Required methods: resolved from the
INTERFACE via the class file's INCLUDE chain (MemberLocatorService.enumerateInterfaceMembers).
- Provided implementations: three-part
Class.Interface.Method MethodImplementation tokens collected from:
- the class's
MODULE('x.clw') (collectImplementedInterfaceMethods), or
- the current document when the class is declared + implemented inline in a
PROGRAM/MEMBER source with no MODULE attribute (collectImplementedInterfaceMethodsFromTokens, gated on getDocumentKind()).
- Conservative — no false positives: skips derived classes, declaration-only
.inc files with no MODULE, and any case where the interface or implementation source can't be resolved.
- Tests: disk fixture mirroring the LibSrc layout + same-file fixtures, incl. a false-positive guard (fully-implemented class ⇒ no warning).
Remaining scope (this issue)
2. Inherited-implementation resolution for derived classes
v1 skips CLASS(Parent),IMPLEMENTS(...). Per Implementing INTERFACEs in Derived Classes, a derived class may implement only some interface methods — the compiler stubs the rest to jump to the nearest ancestor implementation. To validate derived classes without false positives, walk the parent-class chain (each ancestor's MODULE .clw) and treat an interface method as satisfied if implemented on the class or any ancestor. Many real LibSrc implementers are derived (GridClass CLASS(BrowseClass), SMTPTransport CLASS(TELNETTransport), the FileManager-derived encoders), so this materially widens coverage.
3. Parameter / overload discrimination
v1 matches by method name only. A refinement could compare the three-part implementation's parameter signature against the interface prototype (interface declares Foo(STRING), class implements only Foo(LONG) ⇒ warn), reusing the overload substrate from #125/#127/#128. Higher false-positive risk (signature normalisation), so lower priority.
Cross-references
Priority
Normal — v1 covers the common non-derived case correctly; items 2 & 3 extend coverage and carry more false-positive risk, so they're deliberately deferred.
Status
Core diagnostic shipped on
version-0.9.7(commit65dae3d). This issue now tracks the two remaining refinements (items 2 & 3 below).What shipped (v1,
65dae3d)Warns when a non-derived
CLASS,IMPLEMENTS(Interface)does not provide an implementation for one of the interface's methods.INTERFACEvia the class file'sINCLUDEchain (MemberLocatorService.enumerateInterfaceMembers).Class.Interface.MethodMethodImplementationtokens collected from:MODULE('x.clw')(collectImplementedInterfaceMethods), orPROGRAM/MEMBERsource with noMODULEattribute (collectImplementedInterfaceMethodsFromTokens, gated ongetDocumentKind())..incfiles with noMODULE, and any case where the interface or implementation source can't be resolved.Remaining scope (this issue)
2. Inherited-implementation resolution for derived classes
v1 skips
CLASS(Parent),IMPLEMENTS(...). PerImplementing INTERFACEs in Derived Classes, a derived class may implement only some interface methods — the compiler stubs the rest to jump to the nearest ancestor implementation. To validate derived classes without false positives, walk the parent-class chain (each ancestor'sMODULE.clw) and treat an interface method as satisfied if implemented on the class or any ancestor. Many real LibSrc implementers are derived (GridClass CLASS(BrowseClass),SMTPTransport CLASS(TELNETTransport), theFileManager-derived encoders), so this materially widens coverage.3. Parameter / overload discrimination
v1 matches by method name only. A refinement could compare the three-part implementation's parameter signature against the interface prototype (interface declares
Foo(STRING), class implements onlyFoo(LONG)⇒ warn), reusing the overload substrate from #125/#127/#128. Higher false-positive risk (signature normalisation), so lower priority.Cross-references
MemberLocatorService.enumerateInterfaceMembers/collectImplementedInterfaceMethods[FromTokens];DocumentStructure.getDocumentKindINTERFACE(parent), e.g.FormVCRWindowComponent INTERFACE(WindowComponent)) — relevant to item 2's required-method set.Priority
Normal — v1 covers the common non-derived case correctly; items 2 & 3 extend coverage and carry more false-positive risk, so they're deliberately deferred.