@@ -506,3 +506,42 @@ reveal_type(_TYPE) # N: Revealed type is "def (x: Any) -> builtins.type"
506506_TYPE('bar')
507507
508508[builtins fixtures/callable.pyi]
509+
510+ [case testErrorMessageAboutSelf]
511+ # https://github.com/python/mypy/issues/11309
512+ class Some:
513+ def method(self, a) -> None: pass
514+ @classmethod
515+ def cls_method(cls, a) -> None: pass
516+ @staticmethod
517+ def st_method(a) -> None: pass
518+
519+ def bad_method(a) -> None: pass
520+ @classmethod
521+ def bad_cls_method(a) -> None: pass
522+ @staticmethod
523+ def bad_st_method() -> None: pass
524+
525+ s: Some
526+
527+ s.method(1)
528+ s.cls_method(1)
529+ Some.cls_method(1)
530+ s.st_method(1)
531+ Some.st_method(1)
532+
533+ s.method(1, 2) # E: Too many arguments for "method" of "Some"
534+ s.cls_method(1, 2) # E: Too many arguments for "cls_method" of "Some"
535+ Some.cls_method(1, 2) # E: Too many arguments for "cls_method" of "Some"
536+ s.st_method(1, 2) # E: Too many arguments for "st_method" of "Some"
537+ Some.st_method(1, 2) # E: Too many arguments for "st_method" of "Some"
538+
539+ s.bad_method(1) # E: Too many arguments for "bad_method" of "Some" \
540+ # N: Looks like the first special argument in a method is not named "self", "cls", or "mcs", maybe it is missing?
541+ s.bad_cls_method(1) # E: Too many arguments for "bad_cls_method" of "Some" \
542+ # N: Looks like the first special argument in a method is not named "self", "cls", or "mcs", maybe it is missing?
543+ Some.bad_cls_method(1) # E: Too many arguments for "bad_cls_method" of "Some" \
544+ # N: Looks like the first special argument in a method is not named "self", "cls", or "mcs", maybe it is missing?
545+ s.bad_st_method(1) # E: Too many arguments for "bad_st_method" of "Some"
546+ Some.bad_st_method(1) # E: Too many arguments for "bad_st_method" of "Some"
547+ [builtins fixtures/callable.pyi]
0 commit comments