Skip to content

A concrete class that leaves an abstract CLR base member unimplemented is SPY0908 CS0534 — the checker never refuses it #2143

Description

@antonsynd

Found during the #2138 fix (plan-0ca7b7 verification, 2026-09-27). Same result at BASE acd1d40, b59615b and after the #2138 fix.

import system.collections.generic as scg

class Rev(scg.Comparer[int]):
    @override
    def compare(self, x: int) -> int:   # arity mismatch: not an override of Compare(int, int)
        return x

def main():
    print(Rev().compare(1))

This is SPY0908 CS0534 ("'Rev' does not implement inherited abstract member 'Comparer.Compare(int, int)'"). An abstract Sharpy base gets a semantic refusal for an unimplemented abstract member. A CLR base should get the same, naming the member in python spelling (compare(x: int, y: int) -> int), and the @override arity mismatch should report once. Class contract (#2138 ruling): the override and abstractness rules read a CLR base's members the same way they read a Sharpy base's. The base-member lookup is now FindClrOverrideTarget. Meta-class: SPY0908 as a net.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    class-trackerThe one issue per class: carries the contract and the cell tablelane:iceInternal compiler error: SPY0908/SPY0909, a CSxxxx leak, a crashreach:programAn ordinary program a Python programmer would write hits it

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions