fix Preliminary support for class decorators #2752
Summary
Fixes #2752
applying class decorators to the runtime class-value bindingm while preserving the original class object when a decorator still returns a usable type form.
Test Plan
add test
Diff from mypy_primer, showing the effect of this PR on open source code:
spack (https://github.com/spack/spack)
- ERROR lib/spack/spack/audit.py:1138:52-91: Argument `Unknown | None` is not assignable to parameter `other` with type `ArchSpec` in function `spack.spec.ArchSpec.satisfies` [bad-argument-type]
+ ERROR lib/spack/spack/audit.py:1128:29-61: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:45:12-44: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:56:34-66: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/core.py:153:33-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:176:66-90: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:196:28-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/builder.py:222:16-55: Returned type `bool | str | tuple[bool | str, ...]` is not assignable to declared return type `str` [bad-return]
- ERROR lib/spack/spack/cmd/__init__.py:517:34-44: Argument `tuple[Literal[''], None]` is not assignable to parameter `object` with type `tuple[str, Spec]` in function `list.append` [bad-argument-type]
- ERROR lib/spack/spack/cmd/arch.py:111:23-41: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/cmd/arch.py:113:23-42: Object of class `NoneType` has no attribute `generic` [missing-attribute]
+ ERROR lib/spack/spack/compilers/config.py:224:16-35: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/concretize.py:275:68-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1002:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1047:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1860:30-55: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:448:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:462:32-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:545:21-53: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/graph.py:546:21-28: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/graph.py:547:21-29: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/main.py:827:35-67: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:34:20-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:56:37-45: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/platforms/_platform.py:42:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:54:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:57:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:44-69: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:75:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:78:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:25:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/test.py:26:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/solver/asp.py:1641:39-43: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/solver/asp.py:3502:39-41: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/solver/asp.py:3522:35-67: Object of class `FunctionType` has no attribute `from_concretizer` [missing-attribute]
+ ERROR lib/spack/spack/solver/requirements.py:310:35-60: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:269:47-55: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:271:30-44: Object of class `tuple` has no attribute `platform` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:46-54: Object of class `tuple` has no attribute `os` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:56-68: Object of class `tuple` has no attribute `target` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:293:32-34: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:305:34-42: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:344:21-58: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:382:26-67: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:398:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:420:34-42: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:441:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:455:28-47: Object of class `FunctionType` has no attribute `ANY_TARGET` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:460:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:564:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:1009:9-18: Class member `FlagMap._cmp_iter` overrides parent class `HashableMap` in an inconsistent manner [bad-override]
+ ERROR lib/spack/spack/spec.py:641:32-53: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:784:81-95: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:790:13-22: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:791:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:792:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:793:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:794:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:795:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:798:34-48: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:868:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:870:30-872:10: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:871:13-19: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:31-35: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:49-56: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:71-79: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:930:15-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:930:15-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:1488:26-47: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1674:31-81: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:1674:32-38: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1674:47-51: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1674:58-65: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1674:69-77: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1779:35-70: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1935:13-28: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:1936:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1937:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1938:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1939:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1940:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2588:37-54: Object of class `FunctionType` has no attribute `override` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3663:31-87: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3718:9-33: Object of class `FlagMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3732:17-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3734:9-27: Object of class `VariantMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5181:9-20: Class member `VariantMap.__setitem__` overrides parent class `HashableMap` in an inconsistent manner [bad-param-name-override]
+ ERROR lib/spack/spack/spec.py:5177:18-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:5177:18-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:5183:34-49: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:5429:33-51: Object of class `FunctionType` has no attribute `from_dict` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5468:17-53: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5440:39-69: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5860:18-33: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/test/architecture.py:78:70-75: Expected 1 positional argument, got 2 [bad-argument-count]
- ERROR lib/spack/spack/test/concretization/core.py:1264:24-56: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1582:43-75: No matching overload found for function `set.__init__` called with arguments: (bool | str | tuple[bool | str, ...]) [no-matching-overload]
- ERROR lib/spack/spack/test/concretization/core.py:1595:19-53: No matching overload found for function `set.__init__` called with arguments: (bool | str | tuple[bool | str, ...]) [no-matching-overload]
- ERROR lib/spack/spack/test/config.py:409:30-48: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:842:25-40: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:842:42-60: Object of class `NoneType` has no attribute `version` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:173:9-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:209:19-74: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['d30392e66c636a063769cbb1db08cd3455a424650d4494db6379d73ea799582b']` and `bool` [not-iterable]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:53-61: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:67-71: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/variant.py:345:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:348:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:351:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
- ERROR lib/spack/spack/traverse.py:236:49-53: Argument `None` is not assignable to parameter `parent` with type `Spec` in function `spack.spec.DependencySpec.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/traverse.py:37:12-37: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:236:41-86: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/traverse.py:236:42-48: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:55-59: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:63-70: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:74-82: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:460:16-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:475:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:665:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/util/path.py:76:34-52: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/variant.py:511:55-62: Argument `tuple[None]` is not assignable to parameter `value` with type `tuple[bool | str, ...]` in function `VariantValue.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/variant.py:159:41-53: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:216:32-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:218:19-51: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/variant.py:222:58-70: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:224:48-57: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:312:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:316:36-40: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:316:56-65: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:316:77-85: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:322:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:322:74-83: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:325:49-53: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:325:65-74: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:330:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:332:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:332:67-76: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:336:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:336:69-78: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:340:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:340:62-71: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:344:13-17: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:346:13-22: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:347:13-21: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:351:64-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:354:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:68-76: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:358:53-57: Expected 1 positional argument, got 3 [bad-argument-count]
... (truncated 15 lines) ...
pandera (https://github.com/pandera-dev/pandera)
- WARN pandera/api/dataframe/model.py:246:20-72: Redundant cast: `DataFrameBase[Self@DataFrameModel]` is the same type as `DataFrameBase[Self@DataFrameModel]` [redundant-cast]
+ ERROR pandera/api/dataframe/model.py:246:16-72: Returned type `DataFrameBase[Self]` is not assignable to declared return type `DataFrameBase[Self@DataFrameModel]` [bad-return]
+ ERROR pandera/api/dataframe/model.py:290:20-78: Returned type `type[Self]` is not assignable to declared return type `type[Self@DataFrameModel]` [bad-return]
+ ERROR pandera/api/dataframe/model.py:339:16-344:10: Returned type `DataFrameBase[Self]` is not assignable to declared return type `DataFrameBase[Self@DataFrameModel]` [bad-return]
+ ERROR pandera/api/dataframe/model.py:370:16-76: Returned type `DataFrameBase[Self]` is not assignable to declared return type `DataFrameBase[Self@DataFrameModel]` [bad-return]
+ ERROR pandera/api/pandas/model.py:189:16-194:10: Returned type `DataFrame[Self]` is not assignable to declared return type `DataFrame[Self@DataFrameModel]` [bad-return]
+ ERROR pandera/api/pandas/model.py:253:16-41: Returned type `DataFrame[Self]` is not assignable to declared return type `DataFrame[Self@DataFrameModel]` [bad-return]
- WARN pandera/api/pyspark/model.py:151:20-72: Redundant cast: `DataFrameBase[Self@DataFrameModel]` is the same type as `DataFrameBase[Self@DataFrameModel]` [redundant-cast]
+ ERROR pandera/api/pyspark/model.py:135:16-146:10: Returned type `DataFrameBase[Self]` is not assignable to declared return type `DataFrameBase[Self@DataFrameModel]` [bad-return]
+ ERROR pandera/api/pyspark/model.py:151:16-72: Returned type `DataFrameBase[Self]` is not assignable to declared return type `DataFrameBase[Self@DataFrameModel]` [bad-return]
+ ERROR pandera/api/pyspark/model.py:193:20-80: Returned type `type[Self]` is not assignable to declared return type `type[Self@DataFrameModel]` [bad-return]
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:69:36-60: Argument `type[Timedelta64]` is not assignable to parameter `element` with type `type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]` in function `set.add` [bad-argument-type]
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:73:9-57: Argument `set[type[Complex256] | type[Float128]]` is not assignable to parameter `*s` with type `Iterable[type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]]` in function `set.update` [bad-argument-type]
ibis (https://github.com/ibis-project/ibis)
+ ERROR ibis/backends/postgres/__init__.py:730:19-27: TODO: Expr::attr_infer_for_type attribute base undefined for type: Self (trying to access con) [internal-error]
+ ERROR ibis/backends/postgres/__init__.py:749:17-21: Argument `Self@Backend` is not assignable to parameter `self` with type `Self` in function `_batches` [bad-argument-type]
django-stubs (https://github.com/typeddjango/django-stubs)
- ERROR django-stubs/db/models/base.pyi:57:33-46: `[email protected]` is not assignable to upper bound `django.db.models.base.Model` of type variable `_M` [bad-specialization]
+ ERROR django-stubs/db/models/base.pyi:57:33-46: `Self` is not assignable to upper bound `Model` of type variable `_M` [bad-specialization]
- ERROR django-stubs/db/models/base.pyi:63:24-38: `[email protected]` is not assignable to upper bound `django.db.models.base.Model` of type variable `_Model` [bad-specialization]
+ ERROR django-stubs/db/models/base.pyi:63:24-38: `Self` is not assignable to upper bound `Model` of type variable `_Model` [bad-specialization]
- ERROR django-stubs/db/models/base.pyi:69:24-38: `[email protected]` is not assignable to upper bound `django.db.models.base.Model` of type variable `_Model` [bad-specialization]
+ ERROR django-stubs/db/models/base.pyi:69:24-38: `Self` is not assignable to upper bound `Model` of type variable `_Model` [bad-specialization]
- ERROR django-stubs/db/models/base.pyi:98:18-32: `[email protected]` is not assignable to upper bound `django.db.models.base.Model` of type variable `_Model` [bad-specialization]
+ ERROR django-stubs/db/models/base.pyi:98:18-32: `Self` is not assignable to upper bound `Model` of type variable `_Model` [bad-specialization]
+ ERROR django-stubs/db/models/fields/__init__.pyi:183:54-76: `Self` is not assignable to upper bound `Field[Unknown, Unknown]` of type variable `_F` [bad-specialization]
+ ERROR django-stubs/db/models/fields/related.pyi:135:54-86: `Self` is not assignable to upper bound `Field[Unknown, Unknown]` of type variable `_F` [bad-specialization]
+ ERROR django-stubs/db/models/fields/related.pyi:262:54-85: `Self` is not assignable to upper bound `Field[Unknown, Unknown]` of type variable `_F` [bad-specialization]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ ERROR pandas-stubs/core/frame.pyi:2035:10-39: `Self` is not assignable to upper bound `NDFrame` of type variable `NDFrameT` [bad-specialization]
+ ERROR pandas-stubs/core/frame.pyi:2042:10-25: `Self` is not assignable to upper bound `NDFrame` of type variable `NDFrameT` [bad-specialization]
+ ERROR pandas-stubs/core/frame.pyi:2356:10-22: `Self` is not assignable to upper bound `NDFrame` of type variable `NDFrameT` [bad-specialization]
+ ERROR pandas-stubs/core/frame.pyi:2370:10-23: `Self` is not assignable to upper bound `NDFrame` of type variable `NDFrameT` [bad-specialization]
+ ERROR pandas-stubs/core/groupby/generic.pyi:174:23-40: `Self` is not assignable to upper bound `GroupBy` of type variable `_GroupByT` [bad-specialization]
+ ERROR pandas-stubs/core/groupby/generic.pyi:434:23-40: `Self` is not assignable to upper bound `GroupBy` of type variable `_GroupByT` [bad-specialization]
hydpy (https://github.com/hydpy-dev/hydpy)
+ ERROR hydpy/core/devicetools.py:1880:27-40: `Self` is not assignable to upper bound `Device` of type variable `TypeDevice` [bad-specialization]
+ ERROR hydpy/core/devicetools.py:1888:29-42: `Self` is not assignable to upper bound `Device` of type variable `TypeDevice` [bad-specialization]
prefect (https://github.com/PrefectHQ/prefect)
+ ERROR src/prefect/input/run_input.py:393:10-31: `Self` is not assignable to upper bound `RunInput` of type variable `R` [bad-specialization]
+ ERROR src/prefect/server/services/base.py:79:39-42: Argument `type[Self@Service]` is not assignable to parameter `object` with type `type[Self]` in function `list.append` [bad-argument-type]
+ ERROR src/prefect/server/services/base.py:80:16-26: Returned type `list[type[Self]]` is not assignable to declared return type `Sequence[type[Self@Service]]` [bad-return]
pandas (https://github.com/pandas-dev/pandas)
+ ERROR pandas/core/arrays/datetimelike.py:397:20-26: Returned type `NaTType | Period | Timedelta | Timestamp | Self` is not assignable to declared return type `NaTType | Period | Timedelta | Timestamp | Self@DatetimeLikeArrayMixin` [bad-return]
- ERROR pandas/core/frame.py:636:56-60: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_1d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/core/frame.py:642:21-25: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_2d_arraylike_from_scalar` [bad-argument-type]
- WARN pandas/core/indexes/multi.py:3711:17-31: Fixpoint iteration did not converge. Inferred type `tuple[int | integer, None] | tuple[int | integer | ndarray[tuple[int]] | ndarray[tuple[Any, ...], dtype[numpy.bool]] | ndarray[tuple[Any, ...], dtype[signedinteger]] | ndarray | slice[ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], Any] | slice[int, int, Any] | slice[Any, Any, Any] | Unknown | None, MultiIndex | tuple[float, ...] | Unknown] | tuple[int | integer | ndarray[tuple[int]] | ndarray[tuple[Any, ...], dtype[numpy.bool]] | ndarray[tuple[Any, ...], dtype[signedinteger]] | ndarray | Unknown | None, MultiIndex | tuple[float, ...] | Unknown] | tuple[int | ndarray | slice[Any, Any, Any], None] | tuple[ndarray[tuple[int]] | ndarray[tuple[Any, ...], dtype[numpy.bool]] | ndarray | slice[Any, Any, Any] | Unknown, MultiIndex | tuple[float, ...] | Unknown] | tuple[ndarray[tuple[Any, ...], dtype[numpy.bool]] | ndarray | slice[ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], Any] | slice[Any, Any, Any] | Unknown, MultiIndex | tuple[float, ...]] | tuple[ndarray[tuple[Any, ...], dtype[numpy.bool]] | ndarray | slice[ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], Any] | slice[Any, Any, Any] | Unknown, MultiIndex | tuple[float, ...] | Unknown]`. Adding annotations may help. [non-convergent-recursion]
- ERROR pandas/tests/frame/test_constructors.py:3165:35-45: Argument `set[str]` is not assignable to parameter `index` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3167:37-52: Argument `set[str]` is not assignable to parameter `columns` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
scipy-stubs (https://github.com/scipy/scipy-stubs)
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:258:30-53: `Self` is not assignable to upper bound `rv_generic` of type variable `_RVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:260:71-94: `Self` is not assignable to upper bound `rv_generic` of type variable `_RVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:262:73-88: `Self` is not assignable to upper bound `rv_generic` of type variable `_RVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:266:28-51: `Self` is not assignable to upper bound `rv_generic` of type variable `_RVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:268:69-92: `Self` is not assignable to upper bound `rv_generic` of type variable `_RVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:270:71-86: `Self` is not assignable to upper bound `rv_generic` of type variable `_RVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:461:30-64: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:465:10-44: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:469:10-36: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:473:28-62: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:477:10-44: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:481:10-36: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:884:30-62: `Self` is not assignable to upper bound `rv_discrete` of type variable `_DRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:886:93-125: `Self` is not assignable to upper bound `rv_discrete` of type variable `_DRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:888:96-120: `Self` is not assignable to upper bound `rv_discrete` of type variable `_DRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:892:28-60: `Self` is not assignable to upper bound `rv_discrete` of type variable `_DRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:894:91-123: `Self` is not assignable to upper bound `rv_discrete` of type variable `_DRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:896:94-118: `Self` is not assignable to upper bound `rv_discrete` of type variable `_DRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:1154:30-64: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:1156:76-110: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:1158:78-104: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:1163:28-62: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:1165:74-108: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distn_infrastructure.pyi:1167:76-102: `Self` is not assignable to upper bound `rv_continuous` of type variable `_CRVT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1235:29-67: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1236:29-68: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1240:57-108: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1242:41-89: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1244:45-79: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1254:47-61: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1259:62-113: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1261:46-94: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1263:50-84: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1275:52-66: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1280:61-112: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1282:45-93: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1284:49-83: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1296:51-65: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1300:45-95: `Self` is not assignable to upper bound `UnivariateDistribution` of type variable `_DistT_co` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1305:66-117: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1307:50-98: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1309:54-88: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
+ ERROR scipy-stubs/stats/_distribution_infrastructure.pyi:1321:56-70: `Self` is not assignable to upper bound `UnivariateDistribution[Any, tuple[int, ...]]` of type variable `_DistT` [bad-specialization]
aiohttp (https://github.com/aio-libs/aiohttp)
+ ERROR aiohttp/web_request.py:125:20-40: `Self` is not assignable to upper bound `BaseRequest` of type variable `_Request` [bad-specialization]
+ ERROR aiohttp/web_request.py:240:28-48: `Self` is not assignable to upper bound `BaseRequest` of type variable `_Request` [bad-specialization]
core (https://github.com/home-assistant/core)
+ ERROR homeassistant/components/bluetooth/passive_update_processor.py:502:28-65: `Self` is not assignable to upper bound `PassiveBluetoothDataProcessor[Any, Any]` of type variable `_PassiveBluetoothDataProcessorT` [bad-specialization]
+ ERROR homeassistant/components/bluetooth/passive_update_processor.py:515:28-65: `Self` is not assignable to upper bound `PassiveBluetoothDataProcessor[Any, Any]` of type variable `_PassiveBluetoothDataProcessorT` [bad-specialization]
+ ERROR homeassistant/components/bluetooth/passive_update_processor.py:518:37-80: Argument `PassiveBluetoothProcessorEntity[Self@PassiveBluetoothDataProcessor]` is not assignable to parameter `object` with type `PassiveBluetoothProcessorEntity[Self]` in function `list.append` [bad-argument-type]
+ ERROR homeassistant/components/input_text/__init__.py:208:28-39: `Self@InputText` is not assignable to `Self` [bad-assignment]
+ ERROR homeassistant/components/input_text/__init__.py:209:9-28: TODO: attr::check_assign_to_attribute_and_infer_narrow attribute base undefined for type: Self (trying to access editable) [internal-error]
+ ERROR homeassistant/components/input_text/__init__.py:210:16-26: Returned type `Self` is not assignable to declared return type `Self@InputText` [bad-return]
+ ERROR homeassistant/components/input_text/__init__.py:215:28-39: `Self@InputText` is not assignable to `Self` [bad-assignment]
+ ERROR homeassistant/components/input_text/__init__.py:216:9-29: TODO: attr::check_assign_to_attribute_and_infer_narrow attribute base undefined for type: Self (trying to access entity_id) [internal-error]
+ ERROR homeassistant/components/input_text/__init__.py:217:9-28: TODO: attr::check_assign_to_attribute_and_infer_narrow attribute base undefined for type: Self (trying to access editable) [internal-error]
+ ERROR homeassistant/components/input_text/__init__.py:218:16-26: Returned type `Self` is not assignable to declared return type `Self@InputText` [bad-return]
+ ERROR homeassistant/helpers/service.py:464:12-60: Returned type `homeassistant.helpers.target.SelectedEntities` is not assignable to declared return type `homeassistant.helpers.service.SelectedEntities` [bad-return]
trio (https://github.com/python-trio/trio)
+ ERROR src/trio/_core/_ki.py:93:22-60: `Self@_IdRef` is not assignable to `Self` [bad-assignment]
+ ERROR src/trio/_core/_ki.py:94:9-19: TODO: attr::check_assign_to_attribute_and_infer_narrow attribute base undefined for type: Self (trying to access _hash) [internal-error]
+ ERROR src/trio/_core/_ki.py:95:16-20: Returned type `Self` is not assignable to declared return type `Self@_IdRef` [bad-return]
artigraph (https://github.com/artigraph/artigraph)
- ERROR src/arti/storage/__init__.py:89:9-28: Cannot set field `_abstract_` [read-only]
- ERROR src/arti/storage/__init__.py:90:9-40: Generic attribute `storage_partition_type` of class `Storage` is not visible on the class [no-access]
+ ERROR src/arti/storage/__init__.py:89:9-28: TODO: attr::check_assign_to_attribute_and_infer_narrow attribute base undefined for type: type[Self] (trying to access _abstract_) [internal-error]
+ ERROR src/arti/storage/__init__.py:90:9-40: TODO: attr::check_assign_to_attribute_and_infer_narrow attribute base undefined for type: type[Self] (trying to access storage_partition_type) [internal-error]
+ ERROR src/arti/storage/__init__.py:91:16-24: Returned type `type[Self]` is not assignable to declared return type `type[Self@Storage]` [bad-return]
colour (https://github.com/colour-science/colour)
+ ERROR colour/utilities/network.py:171:44-58: Argument `list[Self]` is not assignable to parameter `default` with type `list[Self@TreeNode]` in function `colour.utilities.common.optional` [bad-argument-type]
+ ERROR colour/utilities/network.py:267:16-30: Returned type `list[Self]` is not assignable to declared return type `list[Self@TreeNode]` [bad-return]
+ ERROR colour/utilities/network.py:290:26-31: `list[Self@TreeNode]` is not assignable to attribute `_children` with type `list[Self]` [bad-assignment]
+ ERROR colour/utilities/network.py:541:23-35: TODO: Expr::attr_infer_for_type attribute base undefined for type: Self (trying to access render) [internal-error]
- ERROR colour/utilities/network.py:1718:31-35: Argument `PortNode` is not assignable to parameter `object` with type `Self@PortGraph` in function `list.append` [bad-argument-type]
+ ERROR colour/utilities/network.py:1718:31-35: Argument `PortNode` is not assignable to parameter `object` with type `Self` in function `list.append` [bad-argument-type]
- ERROR colour/utilities/network.py:1772:31-35: Argument `PortNode` is not assignable to parameter `value` with type `Self@PortGraph` in function `list.remove` [bad-argument-type]
+ ERROR colour/utilities/network.py:1772:31-35: Argument `PortNode` is not assignable to parameter `value` with type `Self` in function `list.remove` [bad-argument-type]
+ ERROR colour/utilities/network.py:1814:41-51: TODO: Expr::attr_infer_for_type attribute base undefined for type: Self (trying to access edges) [internal-error]
+ ERROR colour/utilities/network.py:1816:28-37: TODO: Expr::attr_infer_for_type attribute base undefined for type: Self (trying to access name) [internal-error]
+ ERROR colour/utilities/network.py:1818:20-33: TODO: Expr::attr_infer_for_type attribute base undefined for type: Self (trying to access children) [internal-error]
- ERROR colour/utilities/network.py:1832:21-38: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR colour/utilities/network.py:1841:21-38: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR colour/utilities/network.py:1852:21-38: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR colour/utilities/network.py:1861:21-38: Object of class `NoneType` has no attribute `name` [missing-attribute]
hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
+ ERROR src/hydra_zen/wrapper/_implementations.py:1639:20-50: Returned type `F | Self` is not assignable to declared return type `F | Self@ZenStore` [bad-return]
archinstall (https://github.com/archlinux/archinstall)
+ ERROR archinstall/lib/models/packages.py:169:26-45: No matching overload found for function `typing.MutableMapping.setdefault` called with arguments: (str, Self@PackageGroup) [no-matching-overload]
+ ERROR archinstall/lib/models/packages.py:170:5-31: TODO: Expr::attr_infer_for_type attribute base undefined for type: Self (trying to access packages) [internal-error]
+ ERROR archinstall/lib/models/packages.py:172:10-20: Returned type `dict[str, Self]` is not assignable to declared return type `dict[str, Self@PackageGroup]` [bad-return]
+ ERROR archinstall/tui/types.py:57:20-25: Argument `Self@MenuKeys` is not assignable to parameter `object` with type `Self` in function `list.append` [bad-argument-type]
+ ERROR archinstall/tui/types.py:59:10-17: Returned type `list[Self]` is not assignable to declared return type `list[Self@MenuKeys]` [bad-return]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- ERROR sklearn/linear_model/tests/test_passive_aggressive.py:298:9-22: Object of class `PassiveAggressiveRegressor` has no attribute `transform` [missing-attribute]
+ ERROR sklearn/utils/tests/test_deprecation.py:40:18-28: Invalid base class: `((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
strawberry (https://github.com/strawberry-graphql/strawberry)
+ ERROR strawberry/relay/types.py:617:16-58: Returned type `Self` is not assignable to declared return type `Awaitable[Self@Node | None] | Self@Node | None` [bad-return]
+ ERROR strawberry/relay/types.py:872:24-880:18: Returned type `Self@ListConnection` is not assignable to declared return type `Self` [bad-return]
+ ERROR strawberry/relay/types.py:882:20-30: Returned type `Coroutine[Unknown, Unknown, Self]` is not assignable to declared return type `Awaitable[Self@ListConnection] | Self@ListConnection` [bad-return]
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/testing/tests/test_skip_class.py:20:1-15: Argument `type[SkipClassTests]` is not assignable to parameter `reason` with type `str` in function `unittest.case.skip` [bad-argument-type]
bidict (https://github.com/jab/bidict)
+ ERROR bidict/_base.py:151:16-43: Returned type `type[Self]` is not assignable to declared return type `type[Self@BidictBase]` [bad-return]
steam.py (https://github.com/Gobot1234/steam.py)
+ ERROR steam/_gc/client.py:32:10-37: `Self` is not assignable to upper bound `PartialUser` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/_gc/client.py:32:20-30: `Self` is not assignable to upper bound `PartialUser` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/abc.py:115:50-63: `Self` is not assignable to upper bound `Commentable` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/abc.py:136:76-101: `Self` is not assignable to upper bound `Commentable` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/abc.py:159:25-38: `Self` is not assignable to upper bound `Commentable` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/abc.py:199:52-65: `Self` is not assignable to upper bound `Commentable` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/abc.py:208:28-41: `Self` is not assignable to upper bound `Commentable` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/abc.py:223:37-44: Argument `Comment[Self@Commentable, PartialUser]` is not assignable to parameter `object` with type `Comment[Self]` in function `list.append` [bad-argument-type]
+ ERROR steam/abc.py:236:19-26: Yielded type `Comment[Self]` is not assignable to declared yield type `Comment[Self@Commentable]` [invalid-yield]
+ ERROR steam/abc.py:245:23-30: Yielded type `Comment[Self]` is not assignable to declared yield type `Comment[Self@Commentable]` [invalid-yield]
+ ERROR steam/abc.py:382:44-67: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/abc.py:414:10-37: `Self` is not assignable to upper bound `PartialUser` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/abc.py:414:20-30: `Self` is not assignable to upper bound `PartialUser` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/abc.py:439:51-78: `Self` is not assignable to upper bound `PartialUser` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/abc.py:439:61-71: `Self` is not assignable to upper bound `PartialUser` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/abc.py:541:31-47: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/abc.py:563:84-110: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/abc.py:582:51-77: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/abc.py:587:69-82: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/abc.py:719:10-29: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/abc.py:744:25-44: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/abc.py:804:47-57: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
- WARN steam/abc.py:1013:27-35: Fixpoint iteration did not converge. Inferred type `MessageT`. Adding annotations may help. [non-convergent-recursion]
- WARN steam/abc.py:1013:46-54: Fixpoint iteration did not converge. Inferred type `MessageT`. Adding annotations may help. [non-convergent-recursion]
+ ERROR steam/app.py:723:79-101: `Self` is not assignable to upper bound `App` of type variable `AppT` [bad-specialization]
+ ERROR steam/app.py:748:53-76: `Self` is not assignable to upper bound `App` of type variable `AppT` [bad-specialization]
+ ERROR steam/app.py:774:54-77: `Self` is not assignable to upper bound `App` of type variable `AppT` [bad-specialization]
+ ERROR steam/app.py:1168:15-34: `Self` is not assignable to upper bound `PartialApp` of type variable `AppT` [bad-specialization]
+ ERROR steam/app.py:1229:79-95: `Self` is not assignable to upper bound `PartialApp` of type variable `AppT` [bad-specialization]
+ ERROR steam/app.py:1298:32-1300:18: `tuple[RewardItem[Self], ...]` is not assignable to attribute `bundles` with type `Sequence[RewardItem[Self@PartialApp]]` [bad-assignment]
+ ERROR steam/app.py:1299:28-44: `Self` is not assignable to upper bound `PartialApp` of type variable `AppT` [bad-specialization]
+ ERROR steam/app.py:1304:77-91: `Self` is not assignable to upper bound `PartialApp` of type variable `AppT` [bad-specialization]
+ ERROR steam/chat.py:332:51-71: `Self` is not assignable to upper bound `Chat` of type variable `ChatT` [bad-specialization]
+ ERROR steam/clan.py:167:45-67: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:181:52-70: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:203:10-46: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:213:10-35: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:225:10-39: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:276:24-66: Returned type `Event[Unknown, Self]` is not assignable to declared return type `Event[Unknown, Self@PartialClan]` [bad-return]
+ ERROR steam/clan.py:276:29-58: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:285:10-28: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:304:38-56: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:309:24-36: Returned type `Announcement[Self]` is not assignable to declared return type `Announcement[Self@PartialClan]` [bad-return]
+ ERROR steam/clan.py:582:25-47: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:645:26-48: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:650:31-36: Argument `Event[EventType, Self@Clan]` is not assignable to parameter `object` with type `Event[EventType, Self]` in function `list.append` [bad-argument-type]
+ ERROR steam/clan.py:668:23-28: Yielded type `Event[EventType, Self]` is not assignable to declared yield type `Event[EventType, Self@Clan]` [invalid-yield]
+ ERROR steam/clan.py:678:25-43: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:717:29-47: `Self` is not assignable to upper bound `PartialClan` of type variable `ClanT` [bad-specialization]
+ ERROR steam/clan.py:722:34-46: Argument `Announcement[Self@Clan]` is not assignable to parameter `object` with type `Announcement[Self]` in function `list.append` [bad-argument-type]
+ ERROR steam/clan.py:745:19-31: Yielded type `Announcement[Self]` is not assignable to declared yield type `Announcement[Self@Clan]` [invalid-yield]
+ ERROR steam/enums.py:251:17-39: TODO: Expr::binop_infer attribute base undefined for type: Self (trying to access __ior__) [internal-error]
+ ERROR steam/enums.py:252:16-39: TODO: Expr::binop_infer attribute base undefined for type: Self (trying to access __eq__) [internal-error]
+ ERROR steam/enums.py:253:24-38: Returned type `Self | Unknown` is not assignable to declared return type `Self@Flags` [bad-return]
+ ERROR steam/ext/commands/bot.py:172:45-54: `Self` is not assignable to upper bound `Bot` of type variable `BotT` [bad-specialization]
+ ERROR steam/ext/commands/bot.py:336:34-43: `Self` is not assignable to upper bound `Bot` of type variable `BotT` [bad-specialization]
+ ERROR steam/ext/commands/bot.py:347:37-46: `Self` is not assignable to upper bound `Bot` of type variable `BotT` [bad-specialization]
+ ERROR steam/ext/commands/bot.py:571:37-46: `Self` is not assignable to upper bound `Bot` of type variable `BotT` [bad-specialization]
+ ERROR steam/ext/commands/commands.py:284:29-36: Argument `Command | Group` is not assignable to parameter `object` with type `Self` in function `list.append` [bad-argument-type]
+ ERROR steam/ext/commands/commands.py:287:16-24: Returned type `list[Self]` is not assignable to declared return type `list[Self@Command]` [bad-return]
+ ERROR steam/ext/csgo/models.py:138:37-54: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/ext/csgo/models.py:187:37-54: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/friend.py:78:25-35: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/friend.py:98:23-47: Yielded type `Post[Self]` is not assignable to declared yield type `Post[Self@Friend]` [invalid-yield]
+ ERROR steam/friend.py:98:29-39: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
+ ERROR steam/protobufs/msg.py:125:21-112: Default `((self: Self@NotProtobufWrapped, /) -> bytes) | ((self: StructMessage) -> bytes)` is not assignable to parameter `bytes_method` with type `(Self) -> bytes` [bad-function-definition]
+ ERROR steam/protobufs/msg.py:129:48-59: TODO: Expr::attr_infer_for_type attribute base undefined for type: Self (trying to access header) [internal-error]
+ ERROR steam/protobufs/msg.py:131:29-38: `(self: Self, starting_header: bytes = ..., bytes_method: (Self) -> bytes = ..., /) -> bytes` is not assignable to attribute `__bytes__` with type `(self: Self@NotProtobufWrapped, /) -> bytes` [bad-assignment]
+ ERROR steam/protobufs/msg.py:161:26-35: Argument `type[Self]` is not assignable to parameter `type` with type `type[Self@Message]` in function `object.__class__` [bad-argument-type]
+ ERROR steam/protobufs/msg.py:212:30-39: Argument `type[UnifiedMessage | Self]` is not assignable to parameter `type` with type `type[Self@ProtobufMessage]` in function `object.__class__` [bad-argument-type]
+ ERROR steam/protobufs/msg.py:297:26-35: Argument `type[Self]` is not assignable to parameter `type` with type `type[Self@GCMessage]` in function `object.__class__` [bad-argument-type]
+ ERROR steam/protobufs/msg.py:322:26-35: Argument `type[Self]` is not assignable to parameter `type` with type `type[Self@GCProtobufMessage]` in function `object.__class__` [bad-argument-type]
+ ERROR steam/user.py:358:10-37: `Self` is not assignable to upper bound `PartialUser` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/user.py:358:20-30: `Self` is not assignable to upper bound `PartialUser` of type variable `OwnerT` [bad-specialization]
+ ERROR steam/user.py:382:75-98: `Self` is not assignable to upper bound `PartialUser` of type variable `UserT` [bad-specialization]
jax (https://github.com/google/jax)
+ ERROR jax/experimental/array_serialization/serialization_test.py:960:5-35: `UserPytreeAPITest.test_custom_node_registration.P` is not assignable to upper bound `Hashable` of type variable `H` [bad-specialization]
sphinx (https://github.com/sphinx-doc/sphinx)
- WARN sphinx/builders/linkcheck.py:756:29-42: Identity comparison between an instance of `dict[Pattern[str], Pattern[str]]` and class `_SENTINEL_LAR` is always False [unnecessary-comparison]
xarray (https://github.com/pydata/xarray)
+ ERROR xarray/core/dataset.py:1317:22-39: `Self` is not assignable to upper bound `Dataset` of type variable `T_Dataset` [bad-specialization]
discord.py (https://github.com/Rapptz/discord.py)
+ ERROR discord/client.py:368:45-66: `Self` is not assignable to upper bound `Client` of type variable `ClientT` [bad-specialization]
+ ERROR discord/client.py:1253:35-52: `Self` is not assignable to upper bound `Client` of type variable `ClientT` [bad-specialization]
+ ERROR discord/client.py:1255:16-33: `Self` is not assignable to upper bound `Client` of type variable `ClientT` [bad-specialization]
+ ERROR discord/client.py:1526:35-52: `Self` is not assignable to upper bound `Client` of type variable `ClientT` [bad-specialization]
+ ERROR discord/client.py:1528:10-27: `Self` is not assignable to upper bound `Client` of type variable `ClientT` [bad-specialization]
+ ERROR discord/ext/commands/cog.py:311:50-86: `Self` is not assignable to upper bound `Cog | Group` of type variable `GroupT` [bad-specialization]
+ ERROR discord/ext/commands/cog.py:312:63-99: `Self` is not assignable to upper bound `Cog | Group` of type variable `GroupT` [bad-specialization]
+ ERROR discord/ext/commands/cog.py:344:65-101: `Self` is not assignable to upper bound `Cog | Group` of type variable `GroupT` [bad-specialization]
+ ERROR discord/ext/commands/cog.py:356:65-101: `Self` is not assignable to upper bound `Cog | Group` of type variable `GroupT` [bad-specialization]
+ ERROR discord/ext/commands/cog.py:361:87-91: Argument `Self@Cog` is not assignable to parameter `binding` with type `Self` in function `discord.app_commands.commands.Command._copy_with` [bad-argument-type]
+ ERROR discord/ext/commands/cog.py:397:37-45: `list[Command[Self, Ellipsis, Any] | Group]` is not assignable to attribute `__cog_app_commands__` with type `list[Command[Self@Cog, Ellipsis, Any] | Group]` [bad-assignment]
+ ERROR discord/ext/commands/cog.py:408:36-59: `Self` is not assignable to upper bound `Cog | None` of type variable `CogT` [bad-specialization]
+ ERROR discord/ext/commands/cog.py:422:46-82: `Self` is not assignable to upper bound `Cog | Group` of type variable `GroupT` [bad-specialization]
+ ERROR discord/ext/commands/cog.py:447:42-65: `Self` is not assignable to upper bound `Cog | None` of type variable `CogT` [bad-specialization]
+ ERROR discord/ext/commands/cog.py:463:52-88: `Self` is not assignable to upper bound `Cog | Group` of type variable `GroupT` [bad-specialization]
+ ERROR discord/ext/commands/hybrid.py:350:9-21: TODO: attr::check_assign_to_attribute_and_infer_narrow attribute base undefined for type: Self (trying to access wrapped) [internal-error]
+ ERROR discord/ext/commands/hybrid.py:351:9-28: TODO: attr::check_assign_to_attribute_and_infer_narrow attribute base undefined for type: Self (trying to access flag_converter) [internal-error]
+ ERROR discord/ext/commands/hybrid.py:352:16-20: Returned type `Self` is not assignable to declared return type `Self@HybridAppCommand` [bad-return]
+ ERROR discord/ui/view.py:258:38-48: `Self` is not assignable to upper bound `BaseView` of type variable `V` [bad-specialization]
+ ERROR discord/ui/view.py:374:32-42: `Self` is not assignable to upper bound `BaseView` of type variable `V` [bad-specialization]
+ ERROR discord/ui/view.py:511:49-59: `Self` is not assignable to upper bound `BaseView` of type variable `V` [bad-specialization]
Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ ERROR tanjun/abc.py:302:26-49: `Self` is not assignable to upper bound `Context` of type variable `_ContextT_co` [bad-specialization]
Primer Diff Classification
❌ 23 regression(s) | ✅ 3 improvement(s) | 26 project(s) total
23 regression(s) across spack, pandera, ibis, django-stubs, pandas-stubs, hydpy, prefect, pandas, scipy-stubs, aiohttp, core, trio, colour, hydra-zen, archinstall, scikit-learn, spark, bidict, steam.py, jax, xarray, discord.py, Tanjun. error kinds: bad-specialization, bad-argument-type, bad-return. caused by call_infer(), default_arch(). 3 improvement(s) across artigraph, strawberry, sphinx.
| Project | Verdict | Changes | Error Kinds | Root Cause |
|---|---|---|---|---|
| spack | ❌ Regression | +179, -26 | bad-argument-count, bad-argument-type |
default_arch() |
| pandera | ❌ Regression | +9, -4 | bad-argument-type, bad-return |
pyrefly/lib/alt/solve.rs |
| ibis | ❌ Regression | +2 | bad-argument-type, internal-error |
pyrefly/lib/alt/solve.rs |
| django-stubs | ❌ Regression | +7, -4 | bad-specialization |
pyrefly/lib/alt/solve.rs |
| pandas-stubs | ❌ Regression | +6 | bad-specialization |
pyrefly/lib/alt/solve.rs |
| hydpy | ❌ Regression | +2 | bad-specialization |
call_infer() |
| prefect | ❌ Regression | +3 | bad-argument-type, bad-return |
pyrefly/lib/alt/solve.rs |
| pandas | ❌ Regression | +1, -5 | bad-argument-type, bad-return |
pyrefly/lib/alt/solve.rs |
| scipy-stubs | ❌ Regression | +43 | bad-specialization |
pyrefly/lib/alt/solve.rs |
| aiohttp | ❌ Regression | +2 | bad-specialization |
The change to class decorator handling in solve.rs appe... |
| core | ❌ Regression | +11 | bad-specialization |
pyrefly/lib/alt/solve.rs |
| trio | ❌ Regression | +3 | bad-assignment, bad-return |
pyrefly/lib/alt/solve.rs |
| artigraph | ✅ Improvement | +3, -2 | bad-return, internal-error |
pyrefly/lib/alt/solve.rs |
| colour | ❌ Regression | +9, -6 | bad-argument-type, bad-assignment |
pyrefly/lib/alt/solve.rs |
| hydra-zen | ❌ Regression | +1 | bad-return |
pyrefly/lib/alt/solve.rs |
| archinstall | ❌ Regression | +5 | bad-argument-type, bad-return |
pyrefly/lib/alt/solve.rs |
| scikit-learn | ❌ Regression | +1, -1 | invalid-inheritance, missing-attribute |
pyrefly/lib/alt/solve.rs |
| strawberry | ✅ Improvement | +3 | bad-return |
pyrefly/lib/alt/solve.rs |
| spark | ❌ Regression | +1 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| bidict | ❌ Regression | +1 | bad-return |
pyrefly/lib/alt/solve.rs |
| steam.py | ❌ Regression | +73, -2 | bad-argument-type, bad-assignment |
pyrefly/lib/alt/solve.rs |
| jax | ❌ Regression | +1 | bad-specialization |
pyrefly/lib/alt/solve.rs |
| sphinx | ✅ Improvement | -1 | unnecessary-comparison |
untype_opt() |
| xarray | ❌ Regression | +1 | bad-specialization |
pyrefly/lib/alt/solve.rs |
| discord.py | ❌ Regression | +21 | bad-argument-type, bad-assignment |
The change to solve.rs in the Binding::ClassDef case ... |
| Tanjun | ❌ Regression | +1 | bad-specialization |
pyrefly/lib/alt/solve.rs |
Detailed analysis
❌ Regression (23)
spack (+179, -26)
This is a regression. The PR introduced preliminary support for class decorators, but the implementation has a bug in type inference. The new errors show pyrefly incorrectly inferring
FunctionTypeinstead of class types after decorator application, leading to false positivemissing-attributeerrors when accessing class methods likedefault_arch(). For example,spack.spec.ArchSpec.default_arch()is a legitimate class method call, but pyrefly now thinksArchSpecis aFunctionTypedue to decorator inference failure. The removed errors were mostly false positives from poor inference (e.g.,Unknowntypes,NoneTypeattribute access), so their removal is positive, but the new decorator-related inference failures are worse. Mypy/pyright handle class decorators correctly and wouldn't produce these errors. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase (lines 4787-4818) is causing these errors. The new decorator application logic is incorrectly inferring decorator return types, leading toFunctionTypebeing inferred instead of the actual class type. This causes downstreammissing-attributeerrors when code tries to access class methods likedefault_arch()on what pyrefly now thinks is aFunctionType.
pandera (+9, -4)
This is a regression. The new
bad-returnerrors are false positives caused by overly strictSelftype parameter inference. In the panderaDataFrameModelclass, methods like__new__,__class_getitem__, andvalidateare correctly typed to returnDataFrameBase[Self]. The actual return values (fromcls.validate(), cache lookups, and schema validation) are compatible with this type. The errors claim type mismatches betweenDataFrameBase[Self]andDataFrameBase[Self@DataFrameModel], but these represent the same type with different internal representations of theSelfparameter. The removedredundant-castandbad-argument-typeerrors were also false positives - the casts were necessary for type safety and the test arguments were valid. Pyrefly's new class decorator handling appears to be interfering withSelftype resolution, creating noise without catching real bugs. Attribution: The changes to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase (lines 4787-4818) and the newuntype_opthandling forType::KwCall(line 5178) affected howSelftype parameters are resolved in decorated classes. The new logic applies decorators to class types and may be causing stricter type parameter inference, leading to thebad-returnerrors whereSelfresolves differently than expected.
ibis (+2)
These are regressions caused by the new class decorator implementation. The Backend class has a
conattribute (set in do_connect) and the _batches function correctly takesself: Selfas its first parameter. The errors indicate pyrefly's Self type resolution has been broken by the decorator changes - it can no longer resolveself.conor properly matchSelf@BackendwithSelf. This is a type inference failure, not a real bug in the code. Attribution: The changes to class decorator handling in theBinding::ClassDefcase inpyrefly/lib/alt/solve.rsappear to be interfering with Self type resolution. The new decorator processing logic may be affecting how Self types are resolved even for classes without decorators, causing pyrefly to lose track of the Backend class's attribute definitions and Self type consistency.
django-stubs (+7, -4)
This is a regression. The django-stubs project is extensively tested against mypy/pyright, and Self usage within the Model class for Options[Self] and QuerySet[Self] is standard Django typing patterns. The new errors incorrectly claim Self doesn't satisfy the Model bound, when Self within Model should naturally be compatible with bound=Model. The class decorator changes appear to have broken Self type resolution, causing pyrefly to see the raw Self type instead of the properly resolved Model-bound type. While the old errors were also incorrect (claiming the resolved type was incompatible), the new errors represent a step backward in type resolution capability. Attribution: The change to class decorator handling in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefcase is affecting how Self types are resolved within class contexts, causing pyrefly to lose the specific type information it previously had.
pandas-stubs (+6)
This is a regression. The new class decorator support in pyrefly is incorrectly affecting
Selftype resolution in generic contexts. The pandas stubs are correct -DataFrameinherits fromNDFrame, soSelf(which resolves toDataFrame) should be assignable to theNDFrameTupper bound ofNDFrame. The errors claim type specialization failures where none should exist. This represents a type inference failure in pyrefly's new decorator processing logic, not genuine type errors in the well-tested pandas stubs. Attribution: The change to class decorator processing inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase is causing this issue. The new decorator processing logic appears to be interfering with properSelftype resolution, causing pyrefly to lose track thatSelf(DataFrame) is assignable to theNDFrameTupper bound (NDFrame).
hydpy (+2)
These are new
bad-specializationerrors where pyrefly now reports thatSelfis not assignable to the upper boundDeviceof type variableTypeDevice. Looking at the code, lines 1880 and 1888 are in class methodsquery_all()andextract_new()that returnDevices[Self]. The issue appears to be that pyrefly's new class decorator handling is now more strictly checking type variable bounds. However, this is likely too strict -Selfin this context should be compatible with theDevicebound since these are methods on theDeviceclass itself. TheSelftype represents the actual class being called (Node or Element), which are both subclasses ofDevice, so they should satisfy the bound. This appears to be a case where pyrefly is being overly strict about type variable bounds in the context ofSelftypes and class decorators, creating false positives. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase. The new code applies decorators to the class type by callingcall_infer()on each decorator with the class as an argument, then checks if the result can be 'untyped'. This stricter decorator analysis is now enforcing type variable bounds that weren't checked before.
prefect (+3)
These are type inference failures where pyrefly is not correctly handling Self types after the class decorator changes. The errors show pyrefly distinguishing between
SelfandSelf@Servicein ways that create false incompatibilities. The code is correct - RunInput subclasses do satisfy the bound constraint, and Service subclasses found via inspection are valid Service types. The PR's class decorator handling appears to have introduced regressions in Self type resolution. Attribution: The changes to class decorator handling inpyrefly/lib/alt/solve.rsappear to have affected Self type inference. The new code path for handling class decorators (lines 4790-4817) and the additional untyping logic (lines 5580-5600) may be interfering with how Self types are resolved and bound checking is performed.
pandas (+1, -5)
This is a regression. The new class decorator handling is breaking Self type binding - changing from correctly bound
Self@DatetimeLikeArrayMixinto incorrectly unboundSelf. Per PEP 673, Self types must maintain proper scoping to their containing class. However, the removed errors appear to be improvements as they were type inference failures (Unknown types, convergence issues) that have been resolved. The net effect is mixed - a regression in Self type handling but improvements in type inference stability. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase is applying decorators to class values, but this is affecting how Self types are resolved and bound to their containing classes.
scipy-stubs (+43)
This is a REGRESSION. The errors show
Selfis not assignable to upper boundrv_genericin the scipy-stubs project. This is a well-tested type stubs project where these patterns work correctly with mypy/pyright. The issue is that pyrefly's new class decorator handling is incorrectly transforming the class type in a way that breaks theSelftype resolution. In therv_genericclass,Selfshould refer to the concrete subclass (likerv_continuous), but pyrefly is now treating it as incompatible with therv_genericbound. This creates false positive errors in established, correct type stub patterns. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rs(specifically the new logic in theBinding::ClassDefcase around lines 4787-4818) is causing pyrefly to apply decorator type transformations to class objects. This is changing howSelfis resolved in the context of generic class hierarchies.
aiohttp (+2)
This appears to be a regression. The error claims that
Self(which should representBaseRequestwhen used within theBaseRequestclass) is not assignable to the upper boundBaseRequestof some type variable_Request. This is incorrect -SelfwithinBaseRequestshould be equivalent toBaseRequestand thus should satisfy any constraint requiringBaseRequest. The typing spec definesSelfas representing the enclosing class type. The PR's changes to class decorator handling appear to have broken Self type resolution, causing pyrefly to lose track of what Self represents in this context. Mypy and pyright would not flag this pattern as they correctly understand that Self within BaseRequest represents BaseRequest itself. Attribution: The change to class decorator handling insolve.rsappears to have affected how Self is resolved within decorated classes. The new decorator application logic in theBinding::ClassDefcase may be interfering with Self type resolution, causing pyrefly to incorrectly infer that Self doesn't satisfy the BaseRequest upper bound.
core (+11)
❌ bad-specialization: The new class decorator analysis is causing Self types to be incorrectly resolved, leading to type variable bound violations where Self doesn't satisfy the expected bounds. ❌ bad-return/bad-assignment: Self type inference is becoming inconsistent due to decorator analysis, creating mismatches between different representations of Self types (e.g.,
SelfvsSelf@InputText). ❌ bad-argument-type: Generic type parameter resolution is being disrupted by the decorator analysis, causing argument type mismatches in generic contexts. ❌ internal-error: The decorator analysis is triggering internal errors in attribute access, suggesting the new feature has implementation bugs.Overall: These errors appear to be regressions caused by the new class decorator analysis feature. The PR adds preliminary support for class decorators by analyzing decorator applications on classes, but this new analysis is creating type inference problems with Self types and generic parameters. The errors show patterns like
Selfnot being assignable toSelf@InputTextand type variable bound violations involvingSelf. These suggest the decorator analysis is interfering with proper Self type resolution and creating inconsistent type representations. Since this is a new feature that's causing type inference failures rather than catching real bugs, and established type checkers wouldn't flag these patterns, these are regressions.Attribution: The change to class decorator handling in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefcase (lines 4787-4818) introduced preliminary support for analyzing class decorators. This new decorator analysis is causing type inference issues with Self types and generic type parameters.
trio (+3)
These errors show type inference failures caused by the new class decorator logic. The
@_suffix inSelf@_IdRefindicates pyrefly is incorrectly applying decorator transformations to theSelftype within the class definition itself. In the_IdRef.__new__method,Selfshould refer to_IdRefor its subclasses, but pyrefly is inferring a decorated versionSelf@_IdRef. The internal error on line 94 confirms this is a type system bug - pyrefly cannot resolve attribute access on the malformedSelftype. The code is correct:weakref.ref.__new__(cls, ob, callback)returns an instance ofcls, which should be assignable toSelf. This is a regression where the decorator handling logic is incorrectly affecting type inference within class bodies. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase is applying decorators to transform the class type. This creates a type mismatch where pyrefly infersSelf@_IdRef(the decorated result) instead of plainSelffor the__new__method's context.
colour (+9, -6)
This is a regression. The PR introduced preliminary class decorator support, but the implementation has a bug in how it handles
Selftypes. When a class decorator is applied, pyrefly is creating a new type context but not properly preserving theSelftype relationships within the class hierarchy. The errors showlist[Self]not being assignable tolist[Self@TreeNode]- these should be the same type since both refer to the same class'sSelftype. Theinternal-errorabout 'attribute base undefined for type: Self' also indicates the type checker is losing track ofSelftype resolution. The removed errors were false positives that the new code accidentally fixed, but the new errors represent a more serious regression inSelftype handling. Attribution: The changes to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase are causing these issues. The new decorator application logic (lines 4790-4818) is creating type confusion whereSelftypes from the original class definition are not being properly unified withSelftypes after decorator application
hydra-zen (+1)
This is a REGRESSION. The error represents pyrefly being overly strict about Self type bindings in decorator contexts. The code is correct - ZenStore.call legitimately returns either the decorated object (F) or a new store instance (Self). The distinction between
SelfandSelf@ZenStorethat pyrefly is now making is too granular and creates false positive noise. Mypy and pyright would not flag this pattern, as they handle Self types more pragmatically in decorator scenarios. The new class decorator analysis is creating unnecessarily specific type bindings that don't provide practical value. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsaround lines 4784-4820 introduced more precise type inference for decorated classes. The new code calls decorators and infers their return types, which creates more specific Self bindings likeSelf@ZenStoreinstead of genericSelftypes.
archinstall (+5)
These are regressions caused by the new class decorator processing logic. The type checker is now creating different internal representations of Self types (
Self@PackageGroupvsSelf,Self@MenuKeysvsSelf) and incorrectly treating them as incompatible. Within a class context, all Self references should resolve to the same type. The @dataclass decorator processing is interfering with proper Self type unification. Additionally, there's an internal error indicating the type inference system is failing to properly handle Self types after decorator processing. These are false positives - the code is correct and would work fine at runtime. Attribution: The changes to class decorator processing inpyrefly/lib/alt/solve.rs, specifically the new logic in theBinding::ClassDefcase that applies decorators and transforms the class type, are causing Self type inference to create incompatible type representations (Self@PackageGroupvsSelf).
scikit-learn (+1, -1)
This is a regression. The new error incorrectly flags valid inheritance from a decorated class due to poor type inference of the decorator's return type. The removed error was a false positive that got fixed. While removing false positives is good, introducing new false positives for basic inheritance patterns makes this a net regression. The type checker should preserve class types when decorator return types cannot be properly inferred, rather than treating them as unknown callables. Attribution: The changes to class decorator handling in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefcase caused both issues. The new logic applies decorators to class bindings and infers their return types, but fails to properly handle the@deprecateddecorator case, leading to the invalid inheritance error. The same changes likely improved attribute resolution for the PassiveAggressiveRegressor case, removing the false positive.
spark (+1)
This is a regression. The new class decorator analysis incorrectly treats
@unittest.skipas requiring a string argument when applied to classes. In reality,unittest.skipis designed to work on both methods (where it needs a reason string) and classes (where it skips all test methods). This is a well-established unittest pattern that mypy/pyright don't flag. Pyrefly is being overly strict about decorator signatures without understanding the runtime flexibility of decorators likeunittest.skip. Attribution: The change to class decorator processing in theBinding::ClassDefcase inpyrefly/lib/alt/solve.rsnow calls decorators with the class type as an argument, but this doesn't account for decorators likeunittest.skipthat have flexible signatures for class vs method application.
bidict (+1)
This is a regression. Pyrefly is being overly strict about Self type binding in a way that contradicts established type checker behavior. The method signature
-> type[Self]is correct - when called on a subclass, it should returntype[SubclassType], nottype[BidictBase]. The new class decorator handling is incorrectly constraining Self to be bound specifically to BidictBase rather than allowing it to be bound to the calling class. This creates a false positive where the code is actually type-safe but pyrefly rejects it due to overly strict Self binding rules. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase is causing pyrefly to be more strict about Self type binding. The new decorator analysis is affecting how Self types are resolved in class contexts.
steam.py (+73, -2)
The new class decorator support has introduced regressions in Self type resolution. While it fixed some recursive type resolution issues (removing the convergent-recursion false positives), it broke the proper specialization of Self types in inheritance hierarchies. The type checker is now failing to recognize that Self (representing concrete subclasses like ClientUser) satisfies type variable bounds like PartialUser, even though the inheritance relationships are correct. This creates false positive errors where the code is actually type-safe. Attribution: The changes to class decorator handling in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefcase appear to have altered how Self types are resolved in class hierarchies. The new decorator application logic may be interfering with proper Self type specialization, causing the type checker to lose track of inheritance relationships between subclasses and their type variable bounds.
jax (+1)
This is a regression. The new class decorator analysis in pyrefly is incorrectly determining that a dataclass with hashable fields (int) doesn't satisfy the Hashable upper bound constraint. Dataclasses are hashable by default when all fields are hashable, and
intis hashable. JAX'sregister_staticworks fine with such dataclasses in practice. The error represents a type inference failure in pyrefly's new decorator processing logic, not a real type violation in the user code. Attribution: The change to class decorator processing inBinding::ClassDefcase inpyrefly/lib/alt/solve.rsnow calls decorators and infers their return types, but the type inference is incorrectly concluding that dataclass P is not Hashable when it should be
xarray (+1)
This appears to be a regression where pyrefly's new class decorator support is being overly strict about Self type compatibility. The error suggests that Self is not being recognized as satisfying the upper bound constraint of T_Dataset (which is likely bound to Dataset). This is a type-level issue that wouldn't affect runtime behavior, and other type checkers would likely not flag this valid usage of Self in a method return type. The new decorator processing logic may be interfering with proper Self type resolution. Attribution: The change to class decorator handling in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefcase is causing this. The new logic processes decorators and may be affecting how Self is resolved in relation to type variable bounds, making the type checker more strict about Self compatibility with T_Dataset's upper bound.
discord.py (+21)
This is a regression. The new class decorator support in pyrefly is creating false positive errors by being overly strict about Self type consistency with decorated classes. While there may be theoretical type issues, mypy/pyright don't flag these patterns, and the code works correctly at runtime. The errors represent pyrefly being stricter than the established ecosystem standard for class decorator handling. Attribution: The change to
solve.rsin theBinding::ClassDefcase now applies class decorators to transform the class type (lines 4790-4818), which creates inconsistencies with Self types that still refer to the original class definition.
Tanjun (+1)
This is a regression. The error claims that
Selfis not assignable to the upper boundContextof type variable_ContextT_co, but this is incorrect. Looking at the code, theContextclass (line 265) is the base class, and thecommandproperty (line 302) returnsExecutableCommand[Self] | None. Since any class implementing this interface would inherit fromContext,Selfshould always be assignable toContext. The type variable_ContextT_cois defined as covariant and bound toContext(line 115), soSelf(which represents the current class inheriting fromContext) should satisfy this bound. This appears to be a false positive where pyrefly's new class decorator analysis is incorrectly applying stricter bounds checking that doesn't account for the inheritance relationship properly. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsat lines 4787-4818 introduced stricter type checking for class decorators. The new code applies decorators to the class type and validates the result, which appears to have triggered stricter bounds checking that now flags theSelftype as not assignable to theContextbound.
✅ Improvement (3)
artigraph (+3, -2)
The new internal-error messages indicate pyrefly is having trouble with attribute resolution during class decorator processing, while the bad-return error shows a type mismatch in Self type handling. However, the removed errors were clearly false positives - the code is setting attributes on a dynamically created class object (subclass) in
__class_getitem__, which is perfectly valid. The_abstract_field is not actually read-only in this context, andstorage_partition_typeis a legitimate ClassVar that should be accessible. The new errors appear to be temporary issues with the class decorator implementation that need to be resolved, but removing the false positives is an improvement. Attribution: The changes to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase (lines 4787-4818) modified how pyrefly processes class objects and their attributes. The new decorator application logic appears to have improved type inference for class objects, allowing pyrefly to better understand that dynamically created classes can have their attributes modified.
strawberry (+3)
These are genuine type-level violations where the actual return types don't match the declared annotations. In the first error at line 617, the method declares it returns
Awaitable[Self@Node | None] | Self@Node | Nonebut actually returns justSelf. In the second error at lines 872-880, the async function declares it returnsSelfbut returnsSelf@ListConnection. In the third error at line 882, the method declares it returnsAwaitable[Self@ListConnection] | Self@ListConnectionbut returnsCoroutine[Unknown, Unknown, Self]. These are real type inconsistencies that pyrefly is correctly identifying - the return type annotations don't match what the code actually returns. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase now applies decorators to class types, which affects howSelfis resolved in decorated classes. The new decorator application logic changes the type context forSelfresolution in methods of decorated classes.
sphinx (-1)
This was an improvement. The error was a false positive caused by an overly restrictive type annotation. The function parameter is annotated as dict[Pattern[str], Pattern[str]] but the actual runtime usage passes _SENTINEL_LAR (a singleton class instance) to this function. The comparison
allowed_redirects is _SENTINEL_LARis not 'always False' - it's True when the sentinel value is passed. Pyrefly's improved type inference now better understands this mismatch between annotation and usage, removing the incorrect warning. Attribution: The changes tountype_opt()and related type inference logic inpyrefly/lib/alt/solve.rslikely improved pyrefly's ability to recognize that the type annotation doesn't match the actual runtime usage, making it less likely to flag this as an 'always False' comparison.
Suggested Fix
Summary: The PR introduced preliminary class decorator support but broke Self type resolution, causing 23 regressions across projects where Self types are incorrectly inferred or bound.
1. In the Binding::ClassDef case in solve.rs, preserve the original Self type context when applying decorators. After calling call_infer() for each decorator, check if the result is a class type and if so, ensure Self types within the class maintain their original binding to the class definition rather than the decorated result.
Files:
pyrefly/lib/alt/solve.rsConfidence: high Affected projects: spack, pandera, ibis, django-stubs, pandas-stubs, hydpy, prefect, pandas, scipy-stubs, aiohttp, core, trio, colour, hydra-zen, archinstall, bidict, steam.py, xarray, discord.py, Tanjun Fixes:bad-specialization,bad-return/bad-assignment,bad-argument-typeThe core issue is that decorator application creates new type contexts (like Self@ClassName) that are incompatible with the original Self types in method signatures. By preserving Self type consistency during decorator processing, this eliminates the majority of bad-specialization and bad-return errors where Self types become incompatible with themselves. Expected outcome: eliminates ~150+ Self-related errors across 20+ projects including spack, pandera, ibis, django-stubs, pandas-stubs, hydpy, prefect, pandas, scipy-stubs, aiohttp, core, trio, colour, hydra-zen, archinstall, bidict, steam.py, xarray, discord.py, and Tanjun.
2. In the Binding::ClassDef case in solve.rs, add a guard condition before applying decorator analysis: skip decorator type inference for decorators that don't affect the class type (like @unittest.skip, @deprecated). When untype_opt() succeeds on the decorator result, fall back to the original class type to avoid losing class identity.
Files:
pyrefly/lib/alt/solve.rsConfidence: medium Affected projects: spark, scikit-learn, spack Fixes:bad-argument-type,missing-attributeMany decorators like @unittest.skip and @deprecated don't change the class type but the current implementation tries to infer their return types anyway, leading to type inference failures. By detecting when decorators don't meaningfully transform the class type and preserving the original type in those cases, this fixes inheritance and attribute access errors. Expected outcome: eliminates decorator-related bad-argument-type errors in spark, scikit-learn, and spack projects.
3. In the untype_opt() function in solve.rs, add special handling for Self types in decorated class contexts. When encountering Self types that reference decorated classes, ensure they maintain compatibility with their original class bounds rather than creating new incompatible type representations.
Files:
pyrefly/lib/alt/solve.rsConfidence: medium Affected projects: trio, colour, core Fixes:internal-errorThe new Type::KwCall case in untype_opt() (line 5178) is part of the decorator processing but may be creating inconsistent Self type representations. By ensuring Self types maintain their semantic meaning across decorator transformations, this addresses the internal errors and attribute resolution failures. Expected outcome: eliminates internal-error cases in trio, colour, and core projects.
Was this helpful? React with 👍 or 👎
Classification by primer-classifier (26 LLM)
Diff from mypy_primer, showing the effect of this PR on open source code:
spack (https://github.com/spack/spack)
- ERROR lib/spack/spack/audit.py:1138:52-91: Argument `Unknown | None` is not assignable to parameter `other` with type `ArchSpec` in function `spack.spec.ArchSpec.satisfies` [bad-argument-type]
+ ERROR lib/spack/spack/audit.py:1128:29-61: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:45:12-44: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:56:34-66: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/core.py:153:33-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:176:66-90: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:196:28-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/builder.py:222:16-55: Returned type `bool | str | tuple[bool | str, ...]` is not assignable to declared return type `str` [bad-return]
- ERROR lib/spack/spack/cmd/__init__.py:517:34-44: Argument `tuple[Literal[''], None]` is not assignable to parameter `object` with type `tuple[str, Spec]` in function `list.append` [bad-argument-type]
- ERROR lib/spack/spack/cmd/arch.py:111:23-41: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/cmd/arch.py:113:23-42: Object of class `NoneType` has no attribute `generic` [missing-attribute]
+ ERROR lib/spack/spack/compilers/config.py:224:16-35: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/concretize.py:275:68-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1002:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1047:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1860:30-55: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:448:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:462:32-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:545:21-53: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/graph.py:546:21-28: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/graph.py:547:21-29: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/main.py:827:35-67: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:34:20-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:56:37-45: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/platforms/_platform.py:42:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:54:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:57:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:44-69: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:75:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:78:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:25:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/test.py:26:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/solver/asp.py:1641:39-43: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/solver/asp.py:3502:39-41: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/solver/asp.py:3522:35-67: Object of class `FunctionType` has no attribute `from_concretizer` [missing-attribute]
+ ERROR lib/spack/spack/solver/requirements.py:310:35-60: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:269:47-55: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:271:30-44: Object of class `tuple` has no attribute `platform` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:46-54: Object of class `tuple` has no attribute `os` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:56-68: Object of class `tuple` has no attribute `target` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:293:32-34: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:305:34-42: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:344:21-58: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:382:26-67: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:398:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:420:34-42: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:441:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:455:28-47: Object of class `FunctionType` has no attribute `ANY_TARGET` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:460:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:564:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:1009:9-18: Class member `FlagMap._cmp_iter` overrides parent class `HashableMap` in an inconsistent manner [bad-override]
+ ERROR lib/spack/spack/spec.py:641:32-53: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:784:81-95: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:790:13-22: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:791:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:792:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:793:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:794:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:795:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:798:34-48: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:868:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:870:30-872:10: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:871:13-19: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:31-35: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:49-56: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:71-79: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:930:15-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:930:15-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:1488:26-47: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1674:31-81: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:1674:32-38: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1674:47-51: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1674:58-65: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1674:69-77: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1779:35-70: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1935:13-28: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:1936:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1937:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1938:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1939:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1940:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2588:37-54: Object of class `FunctionType` has no attribute `override` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3663:31-87: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3718:9-33: Object of class `FlagMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3732:17-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3734:9-27: Object of class `VariantMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5181:9-20: Class member `VariantMap.__setitem__` overrides parent class `HashableMap` in an inconsistent manner [bad-param-name-override]
+ ERROR lib/spack/spack/spec.py:5177:18-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:5177:18-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:5183:34-49: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:5429:33-51: Object of class `FunctionType` has no attribute `from_dict` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5468:17-53: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5440:39-69: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5860:18-33: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/test/architecture.py:78:70-75: Expected 1 positional argument, got 2 [bad-argument-count]
- ERROR lib/spack/spack/test/concretization/core.py:1264:24-56: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1582:43-75: No matching overload found for function `set.__init__` called with arguments: (bool | str | tuple[bool | str, ...]) [no-matching-overload]
- ERROR lib/spack/spack/test/concretization/core.py:1595:19-53: No matching overload found for function `set.__init__` called with arguments: (bool | str | tuple[bool | str, ...]) [no-matching-overload]
- ERROR lib/spack/spack/test/config.py:409:30-48: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:842:25-40: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:842:42-60: Object of class `NoneType` has no attribute `version` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:173:9-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:209:19-74: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['d30392e66c636a063769cbb1db08cd3455a424650d4494db6379d73ea799582b']` and `bool` [not-iterable]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:53-61: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:67-71: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/variant.py:345:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:348:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:351:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
- ERROR lib/spack/spack/traverse.py:236:49-53: Argument `None` is not assignable to parameter `parent` with type `Spec` in function `spack.spec.DependencySpec.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/traverse.py:37:12-37: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:236:41-86: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/traverse.py:236:42-48: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:55-59: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:63-70: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:74-82: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:460:16-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:475:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:665:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/util/path.py:76:34-52: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/variant.py:511:55-62: Argument `tuple[None]` is not assignable to parameter `value` with type `tuple[bool | str, ...]` in function `VariantValue.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/variant.py:159:41-53: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:216:32-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:218:19-51: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/variant.py:222:58-70: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:224:48-57: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:312:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:316:36-40: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:316:56-65: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:316:77-85: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:322:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:322:74-83: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:325:49-53: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:325:65-74: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:330:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:332:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:332:67-76: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:336:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:336:69-78: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:340:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:340:62-71: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:344:13-17: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:346:13-22: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:347:13-21: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:351:64-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:354:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:68-76: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:358:53-57: Expected 1 positional argument, got 3 [bad-argument-count]
... (truncated 15 lines) ...
pandera (https://github.com/pandera-dev/pandera)
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:69:36-60: Argument `type[Timedelta64]` is not assignable to parameter `element` with type `type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]` in function `set.add` [bad-argument-type]
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:73:9-57: Argument `set[type[Complex256] | type[Float128]]` is not assignable to parameter `*s` with type `Iterable[type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]]` in function `set.update` [bad-argument-type]
pandas (https://github.com/pandas-dev/pandas)
- ERROR pandas/core/frame.py:636:56-60: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_1d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/core/frame.py:642:21-25: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_2d_arraylike_from_scalar` [bad-argument-type]
- WARN pandas/core/indexes/multi.py:3711:17-31: Fixpoint iteration did not converge. Inferred type `tuple[int | integer, None] | tuple[int | integer | ndarray[tuple[int]] | ndarray[tuple[Any, ...], dtype[numpy.bool]] | ndarray[tuple[Any, ...], dtype[signedinteger]] | ndarray | slice[ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], Any] | slice[int, int, Any] | slice[Any, Any, Any] | Unknown | None, MultiIndex | tuple[float, ...] | Unknown] | tuple[int | integer | ndarray[tuple[int]] | ndarray[tuple[Any, ...], dtype[numpy.bool]] | ndarray[tuple[Any, ...], dtype[signedinteger]] | ndarray | Unknown | None, MultiIndex | tuple[float, ...] | Unknown] | tuple[int | ndarray | slice[Any, Any, Any], None] | tuple[ndarray[tuple[int]] | ndarray[tuple[Any, ...], dtype[numpy.bool]] | ndarray | slice[Any, Any, Any] | Unknown, MultiIndex | tuple[float, ...] | Unknown] | tuple[ndarray[tuple[Any, ...], dtype[numpy.bool]] | ndarray | slice[ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], Any] | slice[Any, Any, Any] | Unknown, MultiIndex | tuple[float, ...]] | tuple[ndarray[tuple[Any, ...], dtype[numpy.bool]] | ndarray | slice[ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] | signedinteger[_NBitIntP], Any] | slice[Any, Any, Any] | Unknown, MultiIndex | tuple[float, ...] | Unknown]`. Adding annotations may help. [non-convergent-recursion]
- ERROR pandas/tests/frame/test_constructors.py:3165:35-45: Argument `set[str]` is not assignable to parameter `index` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3167:37-52: Argument `set[str]` is not assignable to parameter `columns` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
core (https://github.com/home-assistant/core)
+ ERROR homeassistant/helpers/service.py:464:12-60: Returned type `homeassistant.helpers.target.SelectedEntities` is not assignable to declared return type `homeassistant.helpers.service.SelectedEntities` [bad-return]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- ERROR sklearn/linear_model/tests/test_passive_aggressive.py:298:9-22: Object of class `PassiveAggressiveRegressor` has no attribute `transform` [missing-attribute]
+ ERROR sklearn/utils/tests/test_deprecation.py:40:18-28: Invalid base class: `((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/testing/tests/test_skip_class.py:20:1-15: Argument `type[SkipClassTests]` is not assignable to parameter `reason` with type `str` in function `unittest.case.skip` [bad-argument-type]
jax (https://github.com/google/jax)
+ ERROR jax/experimental/array_serialization/serialization_test.py:960:5-35: `UserPytreeAPITest.test_custom_node_registration.P` is not assignable to upper bound `Hashable` of type variable `H` [bad-specialization]
sphinx (https://github.com/sphinx-doc/sphinx)
- WARN sphinx/builders/linkcheck.py:756:29-42: Identity comparison between an instance of `dict[Pattern[str], Pattern[str]]` and class `_SENTINEL_LAR` is always False [unnecessary-comparison]
Primer Diff Classification
❌ 3 regression(s) | ✅ 5 improvement(s) | 8 project(s) total
3 regression(s) across spack, core, scikit-learn. error kinds: bad-return, invalid-inheritance, missing-attribute. 5 improvement(s) across pandera, pandas, spark, jax, sphinx.
| Project | Verdict | Changes | Error Kinds | Root Cause |
|---|---|---|---|---|
| spack | ❌ Regression | +179, -26 | bad-argument-count, bad-argument-type |
pyrefly/lib/alt/solve.rs |
| pandera | ✅ Improvement | -2 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| pandas | ✅ Improvement | -5 | bad-argument-type, non-convergent-recursion |
pyrefly/lib/alt/solve.rs |
| core | ❌ Regression | +1 | bad-return |
pyrefly/lib/alt/solve.rs |
| scikit-learn | ❌ Regression | +1, -1 | invalid-inheritance, missing-attribute |
pyrefly/lib/alt/solve.rs |
| spark | ✅ Improvement | +1 | bad-argument-type |
call_infer() |
| jax | ✅ Improvement | +1 | bad-specialization |
pyrefly/lib/alt/solve.rs |
| sphinx | ✅ Improvement | -1 | unnecessary-comparison |
untype_opt() |
Detailed analysis
❌ Regression (3)
spack (+179, -26)
This is a REGRESSION. The PR introduced preliminary support for class decorators but has inference failures. The new errors show pyrefly incorrectly inferring
FunctionTypefor what should be class objects (e.g.,spack.spec.ArchSpec), leading to false positivemissing-attributeerrors when accessing class methods likedefault_arch(). The pattern shows 25 errors claimingFunctionTypehas no attributedefault_arch,from_concretizer, etc. - these are fundamental class methods that definitely exist. This indicates the decorator handling logic is incorrectly transforming class types into function types. The removed errors were mostly false positives (e.g., claimingUnknown | Noneis not assignable toArchSpecwhen the code was actually passing validArchSpecobjects), so removing them was good, but the new inference failures are worse. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase caused these errors. The new logic applies decorators to the class type but appears to have inference failures that result inFunctionTypeinstead of the decorated class type.
core (+1)
This is a regression. The code is correct -
SelectedEntitiesin the service module inherits fromtarget_helpers.SelectedEntities, making the return type compatible. The@deprecated_classdecorator creates a proper subclass relationship. The new class decorator processing logic in pyrefly is incorrectly breaking the inheritance chain or type compatibility that should exist between these classes. Mypy/pyright would not flag this pattern as it's a standard deprecation approach in Python. Attribution: The change to class decorator handling inBinding::ClassDefcase inpyrefly/lib/alt/solve.rsis processing the@deprecated_classdecorator and potentially disrupting the type relationship between the deprecated wrapper class and its target class.
scikit-learn (+1, -1)
This is a regression. The new error incorrectly prevents valid inheritance from decorated classes - @deprecated should preserve the class type for inheritance while adding deprecation behavior. The removed error was correctly identifying a missing attribute that the test expects to be absent. The class decorator implementation is too aggressive in transforming class types, breaking both inheritance checking and attribute resolution. Attribution: The change to class decorator handling in
Binding::ClassDefinpyrefly/lib/alt/solve.rsis causing the decorator application logic to transformMockClass1into a callable type instead of preserving it as a class for inheritance purposes. The same change may have affected attribute resolution forPassiveAggressiveRegressor.
✅ Improvement (5)
pandera (-2)
The removed errors were false positives caused by incorrect type inference for decorated classes. The numpy engine classes (Timedelta64, Float128, Complex256) are legitimate class objects that should be compatible with set operations expecting type objects. The PR fixed pyrefly's class decorator handling to correctly infer these as class types rather than whatever incorrect type was being inferred before. This is an improvement in type inference accuracy. Attribution: The change to class decorator handling in
Binding::ClassDefcase inpyrefly/lib/alt/solve.rsfixed the type inference for decorated classes. When decorator application fails to produce a valid type form, pyrefly now correctly falls back to the original class type viaty = self.heap.mk_class_def(cls.dupe()), which resolved the false positive type mismatches.
pandas (-5)
These are improvements. The removed errors were false positives caused by pyrefly's type inference producing
Unknowntypes where concrete types should have been inferred. The errors claimed type incompatibilities likelist[Unknown] | Unknownnot being assignable to specific typed parameters, but this represents a limitation in pyrefly's type inference rather than actual bugs in the pandas code. The PR's class decorator improvements appear to have enhanced type inference capabilities, removing these false positives. Pandas is a well-tested library and these DataFrame construction patterns work correctly at runtime. Attribution: The changes to class decorator handling inpyrefly/lib/alt/solve.rsappear to have improved type inference in some contexts, removing false positive errors where pyrefly previously failed to properly infer types and defaulted toUnknown.
spark (+1)
This is a genuine bug in the source code. The unittest.skip decorator requires a string reason parameter, but the code applies it directly to a class without providing the required argument. The PR improved pyrefly's class decorator analysis to catch this real type error that was previously missed. The correct usage would be @unittest.skip('reason for skipping') or similar unittest skip decorators that don't require arguments. Attribution: The changes to class decorator handling in
Binding::ClassDefcase inpyrefly/lib/alt/solve.rs(lines 4788-4833) now properly type-check class decorators throughcall_infer(), whereas previously they were ignored with a TODO comment.
jax (+1)
This is a genuine type error being correctly caught. The
Pclass is a dataclass withoutfrozen=True, making it non-hashable, but theregister_staticdecorator requires aHashabletype parameter. The new class decorator analysis correctly identifies this violation of the type variable's upper bound constraint per the typing spec. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase now properly analyzes decorator applications, calling each decorator as a function with the class as an argument. This revealed the type mismatch between the non-hashable dataclassPand theHashablebound expected byregister_static.
sphinx (-1)
This is a false positive removal (improvement). The code uses a standard Python sentinel pattern where a special object serves as a default/marker value. The function parameter is annotated as
dict[Pattern[str], Pattern[str]]but at runtime can also receive_SENTINEL_LAR. The identity comparisonis _SENTINEL_LARis the correct way to detect the sentinel. Pyrefly was incorrectly flagging this valid pattern as an impossible comparison, when in fact the sentinel value is intentionally passed to this function in multiple places throughout the codebase. The error was too strict about static type annotations vs. runtime behavior. Attribution: The change tountype_opt()inpyrefly/lib/alt/solve.rsthat added handling forType::KwCall(call)likely improved type inference precision, causing pyrefly to more strictly enforce the annotated parameter type rather than inferring a union type that includes the sentinel.
Suggested Fix
Summary: The PR's class decorator handling incorrectly transforms decorated classes into FunctionType instead of preserving class types, causing widespread inference failures.
1. In the Binding::ClassDef case in pyrefly/lib/alt/solve.rs, add a type validation guard after call_infer(): if the decorator application result is not a valid class-like type (Type::Class, Type::ClassDef, or Type::TypeAlias), fall back to the original class type instead of using untype_opt() which can produce FunctionType
Files:
pyrefly/lib/alt/solve.rsConfidence: high Affected projects: spack, core, scikit-learn Fixes:missing-attribute,bad-assignmentThe current logic uses untype_opt() as a fallback when decorator application fails, but this can incorrectly produce FunctionType for class objects. The fix should validate that the decorator result is still a class-compatible type before accepting it. Expected outcome: eliminates 25+ missing-attribute errors in spack where FunctionType was incorrectly inferred for class objects like ArchSpec, plus inheritance errors in core and scikit-learn
2. In the call_infer() invocation within the decorator loop in Binding::ClassDef case in pyrefly/lib/alt/solve.rs, add a check to preserve class inheritance relationships: when the decorator result loses class-like properties needed for inheritance, retain the original class type while still applying decorator effects
Files:
pyrefly/lib/alt/solve.rsConfidence: medium Affected projects: core, scikit-learn Fixes:bad-assignmentThe decorator application is breaking inheritance chains for @deprecated_class and similar decorators that should preserve the class nature. The fix should ensure decorated classes remain inheritable. Expected outcome: eliminates inheritance errors in core and scikit-learn where decorated classes can no longer be used as base classes
Was this helpful? React with 👍 or 👎
Classification by primer-classifier (8 LLM)
Diff from mypy_primer, showing the effect of this PR on open source code:
spack (https://github.com/spack/spack)
- ERROR lib/spack/spack/audit.py:1138:52-91: Argument `Unknown | None` is not assignable to parameter `other` with type `ArchSpec` in function `spack.spec.ArchSpec.satisfies` [bad-argument-type]
+ ERROR lib/spack/spack/audit.py:1128:29-61: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:45:12-44: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:56:34-66: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/core.py:153:33-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:176:66-90: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:196:28-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/builder.py:222:16-55: Returned type `bool | str | tuple[bool | str, ...]` is not assignable to declared return type `str` [bad-return]
- ERROR lib/spack/spack/cmd/__init__.py:517:34-44: Argument `tuple[Literal[''], None]` is not assignable to parameter `object` with type `tuple[str, Spec]` in function `list.append` [bad-argument-type]
- ERROR lib/spack/spack/cmd/arch.py:111:23-41: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/cmd/arch.py:113:23-42: Object of class `NoneType` has no attribute `generic` [missing-attribute]
+ ERROR lib/spack/spack/compilers/config.py:224:16-35: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/concretize.py:275:68-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1002:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1047:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1860:30-55: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:448:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:462:32-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:545:21-53: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/graph.py:546:21-28: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/graph.py:547:21-29: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/main.py:827:35-67: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:34:20-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:56:37-45: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/platforms/_platform.py:42:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:54:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:57:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:44-69: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:75:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:78:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:25:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/test.py:26:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/solver/asp.py:1641:39-43: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/solver/asp.py:3501:39-41: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/solver/asp.py:3521:35-67: Object of class `FunctionType` has no attribute `from_concretizer` [missing-attribute]
+ ERROR lib/spack/spack/solver/requirements.py:310:35-60: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:269:47-55: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:271:30-44: Object of class `tuple` has no attribute `platform` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:46-54: Object of class `tuple` has no attribute `os` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:56-68: Object of class `tuple` has no attribute `target` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:293:32-34: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:305:34-42: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:344:21-58: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:382:26-67: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:398:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:420:34-42: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:441:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:455:28-47: Object of class `FunctionType` has no attribute `ANY_TARGET` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:460:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:564:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:1009:9-18: Class member `FlagMap._cmp_iter` overrides parent class `HashableMap` in an inconsistent manner [bad-override]
+ ERROR lib/spack/spack/spec.py:641:32-53: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:784:81-95: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:790:13-22: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:791:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:792:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:793:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:794:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:795:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:798:34-48: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:868:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:870:30-872:10: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:871:13-19: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:31-35: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:49-56: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:71-79: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:930:15-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:930:15-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:1488:26-47: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1674:31-81: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:1674:32-38: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1674:47-51: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1674:58-65: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1674:69-77: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1779:35-70: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1935:13-28: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:1936:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1937:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1938:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1939:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1940:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2588:37-54: Object of class `FunctionType` has no attribute `override` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3663:31-87: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3718:9-33: Object of class `FlagMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3732:17-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3734:9-27: Object of class `VariantMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5181:9-20: Class member `VariantMap.__setitem__` overrides parent class `HashableMap` in an inconsistent manner [bad-param-name-override]
+ ERROR lib/spack/spack/spec.py:5177:18-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:5177:18-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:5183:34-49: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:5429:33-51: Object of class `FunctionType` has no attribute `from_dict` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5468:17-53: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5440:39-69: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5860:18-33: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/test/architecture.py:78:70-75: Expected 1 positional argument, got 2 [bad-argument-count]
- ERROR lib/spack/spack/test/concretization/core.py:1287:24-56: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1605:43-75: No matching overload found for function `set.__init__` called with arguments: (bool | str | tuple[bool | str, ...]) [no-matching-overload]
- ERROR lib/spack/spack/test/concretization/core.py:1618:19-53: No matching overload found for function `set.__init__` called with arguments: (bool | str | tuple[bool | str, ...]) [no-matching-overload]
- ERROR lib/spack/spack/test/config.py:409:30-48: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:842:25-40: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:842:42-60: Object of class `NoneType` has no attribute `version` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:173:9-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:209:19-74: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['d30392e66c636a063769cbb1db08cd3455a424650d4494db6379d73ea799582b']` and `bool` [not-iterable]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:53-61: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:67-71: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/variant.py:345:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:348:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:351:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
- ERROR lib/spack/spack/traverse.py:236:49-53: Argument `None` is not assignable to parameter `parent` with type `Spec` in function `spack.spec.DependencySpec.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/traverse.py:37:12-37: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:236:41-86: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/traverse.py:236:42-48: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:55-59: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:63-70: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:74-82: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:460:16-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:475:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:665:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/util/path.py:76:34-52: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/variant.py:511:55-62: Argument `tuple[None]` is not assignable to parameter `value` with type `tuple[bool | str, ...]` in function `VariantValue.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/variant.py:159:41-53: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:216:32-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:218:19-51: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/variant.py:222:58-70: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:224:48-57: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:312:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:316:36-40: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:316:56-65: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:316:77-85: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:322:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:322:74-83: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:325:49-53: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:325:65-74: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:330:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:332:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:332:67-76: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:336:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:336:69-78: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:340:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:340:62-71: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:344:13-17: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:346:13-22: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:347:13-21: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:351:64-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:354:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:68-76: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:358:53-57: Expected 1 positional argument, got 3 [bad-argument-count]
... (truncated 15 lines) ...
pandera (https://github.com/pandera-dev/pandera)
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:69:36-60: Argument `type[Timedelta64]` is not assignable to parameter `element` with type `type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]` in function `set.add` [bad-argument-type]
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:73:9-57: Argument `set[type[Complex256] | type[Float128]]` is not assignable to parameter `*s` with type `Iterable[type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]]` in function `set.update` [bad-argument-type]
pandas (https://github.com/pandas-dev/pandas)
- ERROR pandas/core/frame.py:636:56-60: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_1d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/core/frame.py:642:21-25: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_2d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3165:35-45: Argument `set[str]` is not assignable to parameter `index` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3167:37-52: Argument `set[str]` is not assignable to parameter `columns` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
core (https://github.com/home-assistant/core)
+ ERROR homeassistant/helpers/service.py:464:12-60: Returned type `homeassistant.helpers.target.SelectedEntities` is not assignable to declared return type `homeassistant.helpers.service.SelectedEntities` [bad-return]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- ERROR sklearn/linear_model/tests/test_passive_aggressive.py:298:9-22: Object of class `PassiveAggressiveRegressor` has no attribute `transform` [missing-attribute]
+ ERROR sklearn/utils/tests/test_deprecation.py:40:18-28: Invalid base class: `((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/testing/tests/test_skip_class.py:20:1-15: Argument `type[SkipClassTests]` is not assignable to parameter `reason` with type `str` in function `unittest.case.skip` [bad-argument-type]
steam.py (https://github.com/Gobot1234/steam.py)
+ WARN steam/abc.py:1013:7-14: Fixpoint iteration did not converge. Inferred result `[MessageT: Message = Message, ClanT: Clan | None = Clan | None, GroupT: Group | None = Group | None]`. Adding annotations may help. [non-convergent-recursion]
+ WARN steam/abc.py:1028:7-14: Fixpoint iteration did not converge. Inferred result `[UserT: PartialUser = PartialUser, ChannelT: Channel = Channel]`. Adding annotations may help. [non-convergent-recursion]
jax (https://github.com/google/jax)
+ ERROR jax/experimental/array_serialization/serialization_test.py:961:5-35: `UserPytreeAPITest.test_custom_node_registration.P` is not assignable to upper bound `Hashable` of type variable `H` [bad-specialization]
sphinx (https://github.com/sphinx-doc/sphinx)
- WARN sphinx/builders/linkcheck.py:756:29-42: Identity comparison between an instance of `dict[Pattern[str], Pattern[str]]` and class `_SENTINEL_LAR` is always False [unnecessary-comparison]
Primer Diff Classification
❌ 4 regression(s) | ✅ 5 improvement(s) | 9 project(s) total | +185, -34 errors
4 regression(s) across spack, scikit-learn, steam.py, jax. error kinds: invalid-inheritance, missing-attribute, bad-argument-count. caused by call_infer(). 5 improvement(s) across pandera, pandas, core, spark, sphinx.
| Project | Verdict | Changes | Error Kinds | Root Cause |
|---|---|---|---|---|
| spack | ❌ Regression | +179, -26 | bad-argument-count, bad-argument-type |
call_infer() |
| pandera | ✅ Improvement | -2 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| pandas | ✅ Improvement | -4 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| core | ✅ Improvement | +1 | bad-return |
pyrefly/lib/alt/solve.rs |
| scikit-learn | ❌ Regression | +1, -1 | invalid-inheritance, missing-attribute |
pyrefly/lib/alt/solve.rs |
| spark | ✅ Improvement | +1 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| steam.py | ❌ Regression | +2 | non-convergent-recursion |
pyrefly/lib/alt/solve.rs |
| jax | ❌ Regression | +1 | bad-specialization |
call_infer() |
| sphinx | ✅ Improvement | -1 | unnecessary-comparison |
pyrefly/lib/alt/solve.rs |
Detailed analysis
❌ Regression (4)
spack (+179, -26)
This is a regression. The PR introduced preliminary support for class decorators, but the implementation has significant type inference issues. The new errors show pyrefly incorrectly inferring
FunctionTypewhere class types should be (e.g.,spack.spec.ArchSpecbecomesFunctionTypemissingdefault_arch). This creates cascading errors where method calls fail because the checker thinks it's operating on functions rather than classes. The pattern of 25missing-attributeerrors onFunctionTypeacross core Spack classes strongly indicates a systematic inference failure rather than real bugs. The removed errors were largely false positives involvingUnknowntypes and overly strict checks that other type checkers wouldn't flag. While class decorator support is a valuable feature, this implementation introduces more problems than it solves. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase is causing these issues. The new code applies decorators to class bindings and callsself.[call_infer()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs)on decorators, but appears to be incorrectly inferring function types instead of preserving class types when decorators don't return usable type forms.
scikit-learn (+1, -1)
Mixed outcome: The new error is a regression because pyrefly is being too strict about decorator handling - common decorators like @deprecated should preserve class-ness for inheritance. The removed error is an improvement because it was a false positive on intentional test code. Per the typing spec on inheritance, base classes must be class types, but pyrefly's decorator transformation is overly aggressive compared to ecosystem norms. Attribution: The changes to class decorator processing in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefcase now apply decorators as function calls to transform the class type. This caused@deprecatedto transformMockClass1into a callable type, making it invalid as a base class. The improved type resolution also eliminated the false positive on the sklearn regressor test.
steam.py (+2)
These are
non-convergent-recursionwarnings, not actual type errors. They indicate that pyrefly's internal type inference algorithm failed to reach a stable fixpoint when analyzing the generic classesChannel[MessageT, ClanT, GroupT]andMessage[UserT, ChannelT]. The warnings show the inferred type parameters (e.g.,MessageT: Message = Message) which suggests the inference is getting caught in cycles.
This is a regression because:
- The code is valid - these are well-formed generic classes that should type-check successfully
- The warnings are about pyrefly's internal inference limitations, not actual type issues in the user's code
- mypy/pyright would not produce these warnings for the same code
- The PR changes to class decorator handling appear to have introduced additional complexity that breaks the convergence of type inference for these generic classes
The steam.py library is a mature, well-tested project, and these generic class definitions are standard patterns that should not cause convergence issues in a robust type checker.
Attribution: The changes to class decorator handling in
pyrefly/lib/alt/solve.rs(specifically the new logic in theBinding::ClassDefcase around lines 4785-4833) appear to have introduced additional complexity in type inference that causes fixpoint iteration to fail to converge for generic classes likeChannelandMessage.
jax (+1)
This is a regression. The error claims that class
P(a dataclass witha: int = 2) is not assignable to the upper boundHashableof some type variableH. However, dataclasses with hashable fields are typically hashable, and the@jax.tree_util.register_staticdecorator is a JAX framework decorator that shouldn't imposeHashableconstraints. The PR introduced stricter class decorator type checking that applies decorators as function calls, but this creates false positive noise for framework-specific decorators that don't follow standard callable patterns. Mypy/pyright would not flag this pattern because they don't enforce such strict decorator typing for framework decorators. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase now applies decorators to the class type. The new code callsself.[call_infer()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs)for each decorator, treating the decorator as a callable that takes the class as an argument. This stricter decorator analysis is causing pyrefly to check that the decorated class satisfies type variable bounds of the decorator.
✅ Improvement (5)
pandera (-2)
The removed errors were false positives about set type compatibility. The code is performing standard set operations (
.add()and.update()) with dtype classes from the pandera engine modules. All these classes (numpy_engine.Timedelta64,numpy_engine.Float128,numpy_engine.Complex256, etc.) are part of the same type hierarchy and should be compatible as set elements. The error messages show pyrefly was inferring an overly restrictive union type for the set elements, excluding the types being added. The PR's improvement to class decorator handling likely fixed the type inference for these engine module classes, allowing pyrefly to correctly recognize their compatibility for set operations. This is an improvement because pyrefly is now correctly understanding the type relationships in this well-tested project rather than producing false positive type errors. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsin theBinding::ClassDefcase improved type inference for decorated classes. The new logic applies decorators to the runtime class value while preserving the original class object when the decorator returns a usable type form. This likely improved the type resolution for the engine module classes (numpy_engine.Timedelta64,numpy_engine.Float128, etc.), allowing pyrefly to correctly infer their types as compatible set elements rather than producing overly narrow union types.
pandas (-4)
These are improvements where pyrefly is now correctly identifying genuine type errors. The pandas DataFrame constructor errors show better detection of untyped values being passed to functions expecting specific types, and the test errors correctly identify that sets cannot be used where sequences are required. The class decorator implementation is working as intended - it's preserving type information better and catching real type mismatches that were previously missed. Attribution: The changes to class decorator handling in
pyrefly/lib/alt/solve.rs, specifically the new logic in theBinding::ClassDefcase that applies decorators and the enhanced type inference, are causing pyrefly to better track types through decorator applications and catch previously missed type mismatches
core (+1)
This is a genuine type error. The function
async_extract_referenced_entity_idsdeclares it returnshomeassistant.helpers.service.SelectedEntities(the local deprecated class) but actually returns an instance constructed fromhomeassistant.helpers.target.SelectedEntitiesdata. The localSelectedEntitiesclass (lines 244-253) only overrideslog_missingand may not properly handle the**dataclasses.asdict(selected)construction pattern. The PR's improved class decorator analysis now correctly detects this type mismatch that was previously missed. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsnow properly analyzes the@deprecated_classdecorator, allowing pyrefly to detect that the decorated class has different type characteristics than the base class, revealing this existing type mismatch.
spark (+1)
This is a genuine type error. The unittest.skip decorator expects a string reason parameter, but when used as @unittest.skip (without parentheses) on a class, it receives type[SkipClassTests] instead of str. The PR correctly implemented class decorator type checking per the typing spec, revealing a real bug in the test code. The correct usage would be @unittest.skip('reason') with a string parameter. Attribution: The change to class decorator handling in the
Binding::ClassDefcase inpyrefly/lib/alt/solve.rs(lines 4788-4833) now correctly models decorator application as function calls, which exposes this type error that was previously not detected.
sphinx (-1)
This is an improvement. The removed error was a false positive - pyrefly incorrectly claimed that
allowed_redirects is _SENTINEL_LARwould always be False, but this is a valid singleton pattern where the comparison can be either True or False. The PR's improved class decorator support fixed pyrefly's understanding of the@object.__new__decorator, eliminating this incorrect analysis. Attribution: The change to class decorator handling inBinding::ClassDefcase inpyrefly/lib/alt/solve.rsimproved pyrefly's understanding of the@object.__new__decorator pattern, allowing it to correctly recognize_SENTINEL_LARas a singleton instance rather than incorrectly analyzing the identity comparison.
Suggested fixes
Summary: The PR introduced class decorator support that causes type inference to incorrectly transform decorated classes into function types, breaking inheritance and method access.
1. In the Binding::ClassDef case in solve.rs, add a guard to preserve class types when decorators don't return class-compatible types. After calling self.call_infer() on each decorator, check if the result is still a class type or class-compatible callable. If not, fall back to the original class type instead of using the decorator's return type.
Files:
pyrefly/lib/alt/solve.rsConfidence: high Affected projects: spack, scikit-learn, jax Fixes:missing-attribute,bad-assignmentThe core issue is that decorators like @deprecated, @jax.tree_util.register_static, and others are being treated as type transformers that must return class-compatible types. When they return function types or other incompatible types, pyrefly incorrectly uses those as the class type. Adding a type compatibility check would preserve the original class semantics while still allowing legitimate class transformers to work. Expected outcome: eliminates 25+ missing-attribute errors on FunctionType in spack, 1 bad-assignment error in scikit-learn, and 1 bad-assignment error in jax.
2. In the Binding::ClassDef case in solve.rs, add special handling for common framework decorators that should preserve class identity. Before applying the decorator transformation, check if the decorator is a known framework decorator (like @deprecated, @jax.tree_util.register_static) and skip the type transformation for these cases.
Files:
pyrefly/lib/alt/solve.rsConfidence: medium Affected projects: scikit-learn, jax Fixes:bad-assignmentFramework decorators often don't follow standard callable patterns and shouldn't transform the class type. This would be a more targeted fix that preserves the new decorator functionality while avoiding regressions on common patterns. Expected outcome: eliminates the bad-assignment errors in scikit-learn and jax while preserving legitimate decorator type checking.
3. In the Binding::ClassDef case in solve.rs, modify the decorator application logic to avoid triggering convergence issues in generic class inference. Add a check to skip decorator transformation for generic classes or limit the depth of type inference when processing decorators on parameterized classes.
Files:
pyrefly/lib/alt/solve.rsConfidence: medium Affected projects: steam.py Fixes:non-convergent-recursionThe non-convergent-recursion warnings in steam.py suggest that the new decorator logic is creating inference cycles for generic classes. Adding guards around generic class processing would prevent these convergence failures. Expected outcome: eliminates 2 non-convergent-recursion warnings in steam.py.
Was this helpful? React with 👍 or 👎
Classification by primer-classifier (9 LLM)
Diff from mypy_primer, showing the effect of this PR on open source code:
pandera (https://github.com/pandera-dev/pandera)
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:69:36-60: Argument `type[Timedelta64]` is not assignable to parameter `element` with type `type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]` in function `set.add` [bad-argument-type]
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:73:9-57: Argument `set[type[Complex256] | type[Float128]]` is not assignable to parameter `*s` with type `Iterable[type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]]` in function `set.update` [bad-argument-type]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- ERROR sklearn/linear_model/tests/test_passive_aggressive.py:298:9-22: Object of class `PassiveAggressiveRegressor` has no attribute `transform` [missing-attribute]
+ ERROR sklearn/utils/tests/test_deprecation.py:40:18-28: Invalid base class: `((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
steam.py (https://github.com/Gobot1234/steam.py)
+ WARN steam/abc.py:1013:7-14: Fixpoint iteration did not converge. Inferred result `[MessageT: Message = Message, ClanT: Clan | None = Clan | None, GroupT: Group | None = Group | None]`. Adding annotations may help. [non-convergent-recursion]
+ WARN steam/abc.py:1028:7-14: Fixpoint iteration did not converge. Inferred result `[UserT: PartialUser = PartialUser, ChannelT: Channel = Channel]`. Adding annotations may help. [non-convergent-recursion]
pandas (https://github.com/pandas-dev/pandas)
- ERROR pandas/core/frame.py:636:56-60: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_1d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/core/frame.py:642:21-25: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_2d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3165:35-45: Argument `set[str]` is not assignable to parameter `index` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3167:37-52: Argument `set[str]` is not assignable to parameter `columns` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
core (https://github.com/home-assistant/core)
+ ERROR homeassistant/helpers/service.py:464:12-60: Returned type `homeassistant.helpers.target.SelectedEntities` is not assignable to declared return type `homeassistant.helpers.service.SelectedEntities` [bad-return]
sphinx (https://github.com/sphinx-doc/sphinx)
- WARN sphinx/builders/linkcheck.py:756:29-42: Identity comparison between an instance of `dict[Pattern[str], Pattern[str]]` and class `_SENTINEL_LAR` is always False [unnecessary-comparison]
spack (https://github.com/spack/spack)
- ERROR lib/spack/spack/audit.py:1137:52-91: Argument `Unknown | None` is not assignable to parameter `other` with type `ArchSpec` in function `spack.spec.ArchSpec.satisfies` [bad-argument-type]
+ ERROR lib/spack/spack/audit.py:1127:29-61: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:45:12-44: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:56:34-66: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/core.py:153:33-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:176:66-90: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:196:28-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/builder.py:222:16-55: Returned type `bool | str | tuple[bool | str, ...]` is not assignable to declared return type `str` [bad-return]
- ERROR lib/spack/spack/cmd/__init__.py:518:34-44: Argument `tuple[Literal[''], None]` is not assignable to parameter `object` with type `tuple[str, Spec]` in function `list.append` [bad-argument-type]
- ERROR lib/spack/spack/cmd/arch.py:111:23-41: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/cmd/arch.py:113:23-42: Object of class `NoneType` has no attribute `generic` [missing-attribute]
+ ERROR lib/spack/spack/compilers/config.py:224:16-35: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/concretize.py:275:68-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1002:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1047:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1860:30-55: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:448:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:462:32-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:545:21-53: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/graph.py:546:21-28: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/graph.py:547:21-29: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/main.py:827:35-67: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:34:20-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:56:37-45: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/platforms/_platform.py:42:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:54:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:57:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:44-69: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:75:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:78:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:25:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/test.py:26:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/solver/asp.py:1641:39-43: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/solver/asp.py:3501:39-41: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/solver/asp.py:3521:35-67: Object of class `FunctionType` has no attribute `from_concretizer` [missing-attribute]
+ ERROR lib/spack/spack/solver/requirements.py:318:35-60: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:269:47-55: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:271:30-44: Object of class `tuple` has no attribute `platform` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:46-54: Object of class `tuple` has no attribute `os` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:56-68: Object of class `tuple` has no attribute `target` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:293:32-34: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:305:34-42: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:344:21-58: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:382:26-67: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:398:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:420:34-42: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:441:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:455:28-47: Object of class `FunctionType` has no attribute `ANY_TARGET` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:460:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:564:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:1009:9-18: Class member `FlagMap._cmp_iter` overrides parent class `HashableMap` in an inconsistent manner [bad-override]
+ ERROR lib/spack/spack/spec.py:641:32-53: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:784:81-95: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:790:13-22: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:791:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:792:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:793:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:794:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:795:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:798:34-48: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:868:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:870:30-872:10: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:871:13-19: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:31-35: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:49-56: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:71-79: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:930:15-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:930:15-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:1488:26-47: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1673:31-81: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:1673:32-38: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:47-51: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:58-65: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:69-77: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1778:35-70: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1934:13-28: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:1935:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1936:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1937:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1938:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1939:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2587:37-54: Object of class `FunctionType` has no attribute `override` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3662:31-87: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3717:9-33: Object of class `FlagMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3731:17-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3733:9-27: Object of class `VariantMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5180:9-20: Class member `VariantMap.__setitem__` overrides parent class `HashableMap` in an inconsistent manner [bad-param-name-override]
+ ERROR lib/spack/spack/spec.py:5176:18-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:5176:18-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:5182:34-49: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:5428:33-51: Object of class `FunctionType` has no attribute `from_dict` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5467:17-53: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5439:39-69: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5859:18-33: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/test/architecture.py:78:70-75: Expected 1 positional argument, got 2 [bad-argument-count]
- ERROR lib/spack/spack/test/concretization/core.py:1287:24-56: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1605:43-75: No matching overload found for function `set.__init__` called with arguments: (bool | str | tuple[bool | str, ...]) [no-matching-overload]
- ERROR lib/spack/spack/test/concretization/core.py:1618:19-53: No matching overload found for function `set.__init__` called with arguments: (bool | str | tuple[bool | str, ...]) [no-matching-overload]
- ERROR lib/spack/spack/test/config.py:409:30-48: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:842:25-40: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:842:42-60: Object of class `NoneType` has no attribute `version` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:173:9-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:209:19-74: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['d30392e66c636a063769cbb1db08cd3455a424650d4494db6379d73ea799582b']` and `bool` [not-iterable]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:53-61: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:67-71: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/variant.py:345:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:348:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:351:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
- ERROR lib/spack/spack/traverse.py:236:49-53: Argument `None` is not assignable to parameter `parent` with type `Spec` in function `spack.spec.DependencySpec.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/traverse.py:37:12-37: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:236:41-86: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/traverse.py:236:42-48: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:55-59: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:63-70: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:74-82: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:460:16-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:475:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:665:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/util/path.py:76:34-52: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/variant.py:511:55-62: Argument `tuple[None]` is not assignable to parameter `value` with type `tuple[bool | str, ...]` in function `VariantValue.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/variant.py:159:41-53: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:216:32-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:218:19-51: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/variant.py:222:58-70: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:224:48-57: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:312:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:316:36-40: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:316:56-65: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:316:77-85: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:322:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:322:74-83: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:325:49-53: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:325:65-74: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:330:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:332:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:332:67-76: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:336:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:336:69-78: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:340:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:340:62-71: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:344:13-17: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:346:13-22: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:347:13-21: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:351:64-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:354:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:68-76: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:358:53-57: Expected 1 positional argument, got 3 [bad-argument-count]
... (truncated 15 lines) ...
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/testing/tests/test_skip_class.py:20:1-15: Argument `type[SkipClassTests]` is not assignable to parameter `reason` with type `str` in function `unittest.case.skip` [bad-argument-type]
jax (https://github.com/google/jax)
+ ERROR jax/experimental/array_serialization/serialization_test.py:961:5-35: `UserPytreeAPITest.test_custom_node_registration.P` is not assignable to upper bound `Hashable` of type variable `H` [bad-specialization]
Primer Diff Classification
❌ 5 regression(s) | ✅ 4 improvement(s) | 9 project(s) total | +185, -34 errors
5 regression(s) across scikit-learn, steam.py, core, spack, jax. error kinds: invalid-inheritance, missing-attribute, bad-return. 4 improvement(s) across pandera, pandas, sphinx, spark.
| Project | Verdict | Changes | Error Kinds | Root Cause |
|---|---|---|---|---|
| pandera | ✅ Improvement | -2 | bad-argument-type |
The changes to class name resolution in solve.rs, parti... |
| scikit-learn | ❌ Regression | +1, -1 | invalid-inheritance, missing-attribute |
pyrefly/lib/alt/solve.rs |
| steam.py | ❌ Regression | +2 | non-convergent-recursion |
pyrefly/lib/alt/solve.rs |
| pandas | ✅ Improvement | -4 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| core | ❌ Regression | +1 | bad-return |
pyrefly/lib/alt/solve.rs |
| sphinx | ✅ Improvement | -1 | unnecessary-comparison |
pyrefly/lib/alt/solve.rs |
| spack | ❌ Regression | +179, -26 | bad-argument-count, bad-argument-type |
pyrefly/lib/alt/solve.rs |
| spark | ✅ Improvement | +1 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| jax | ❌ Regression | +1 | bad-specialization |
pyrefly/lib/alt/solve.rs |
Detailed analysis
❌ Regression (5)
scikit-learn (+1, -1)
This is a regression. The new error is a false positive -
@deprecatedreturns a class that can be inherited from, but pyrefly now sees it as a non-class type. The removed error was a true positive -PassiveAggressiveRegressorreally doesn't havetransform(), and pyrefly should catch this. The PR made class decorator handling too aggressive, transforming class types into non-class types even when the decorator preserves the class interface. Attribution: The changes inpyrefly/lib/alt/solve.rsnow apply class decorators to the runtime class-value binding. The logic at lines 4813-4854 transforms the class type through each decorator, potentially changing it from a class type to a callable type if the decorator returns a callable.
steam.py (+2)
These are false positive warnings - pyrefly's type inference is failing to converge on generic classes with circular type parameter dependencies (Channel references Message, Message references Channel). The code is correct and other type checkers handle it fine. This is a regression in pyrefly's inference capabilities introduced by the class decorator changes. Attribution: The changes to
Binding::ClassDefhandling inpyrefly/lib/alt/solve.rsthat now processes decorators appears to have affected type inference for all class definitions, even those without decorators
core (+1)
The new class decorator logic is incorrectly changing the type identity of classes decorated with
@deprecated_class. The decorator likely returns a wrapper or the original class, but pyrefly is now treating it as a different type, breaking the expected inheritance relationship whereSelectedEntities(the local subclass) should be assignable to itself Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rslines 4810-4855, which now applies decorators to determine the runtime type of decorated classes
spack (+179, -26)
This is a regression. The PR introduces new type inference failures when dealing with decorated classes. The errors show pyrefly is now unable to properly track types through decorator applications, resulting in
Unknowntypes and cascading errors. Key evidence: (1) 174/179 errors are pyrefly-only, (2) errors involveUnknowntypes andFunctionTypewhere class types should be, (3) the pattern suggests pyrefly loses track of the decorated class's type when it's imported or accessed through module boundaries. While the PR correctly removes some false positives (26 errors), it introduces 179 new false positives, making it a net regression. Attribution: The changes inpyrefly/lib/alt/solve.rslines 4810-4855 implement class decorator application. The new logic applies decorators to class values, which appears to be causing type inference issues when decorated classes are imported or used in complex ways.
jax (+1)
This is a regression. The PR introduced support for analyzing class decorators, but it's incorrectly flagging a valid JAX pattern. The
@jax.tree_util.register_staticdecorator is a standard way to register static pytree nodes in JAX, and the fact that neither mypy nor pyright flag this indicates pyrefly is applying an overly strict interpretation. The decorator works fine at runtime and is used throughout the JAX ecosystem. Attribution: The change to class decorator handling inpyrefly/lib/alt/solve.rsnow processes decorators and validates their type constraints, whereas previously decorators were ignored for type-level analysis. Specifically, the code starting at line 4813 now iterates through decorators and applies them to the class type.
✅ Improvement (4)
pandera (-2)
These were false positive errors. The code correctly adds numpy/pandas dtype classes to a set of unsupported dtypes. The PR's improvements to class decorator handling and name resolution fixed pyrefly's ability to properly infer the types of these class objects when used as values (not type annotations). Since pyrefly was wrongly flagging correct code and now accepts it, this is an improvement. Attribution: The changes to class name resolution in
solve.rs, particularly the new handling ofExpr::NameforClassDefbindings, fixed the type inference for these class objects when used as values in set operations
pandas (-4)
These removals represent an improvement. The errors were false positives caused by poor type inference (evidenced by
Unknowntypes in the error messages). The PR's implementation of class decorator support appears to have improved type inference, allowing pyrefly to correctly understand that these assignments are valid. The test file errors aboutset[str]were also false positives - pandas legitimately accepts sets as index/columns arguments and converts them internally. Attribution: The changes inpyrefly/lib/alt/solve.rsthat now apply class decorators to runtime class values likely improved type inference, resolving theUnknowntype issues that were causing these false positive errors.
sphinx (-1)
This is an improvement. The removed error was a false positive - pyrefly was incorrectly claiming that an identity comparison between
allowed_redirectsand the sentinel class_SENTINEL_LARwould always be False. This is a standard Python sentinel pattern where a unique object (in this case a class decorated with@object.__new__) is used as a default value and checked withis. The PR's changes to preserve class types through decorators fixed this inference issue, allowing pyrefly to correctly understand that_SENTINEL_LARcan indeed be compared withis. Attribution: The changes to class decorator handling inpyrefly/lib/alt/solve.rs(specifically the new logic inBinding::ClassDefthat preserves the original class type when decorators are applied) fixed the false positive by correctly recognizing that_SENTINEL_LARremains a valid class object despite the@object.__new__decorator.
spark (+1)
This is an improvement. The error correctly identifies a type incompatibility - when @unittest.skip is used without parentheses, it receives the class directly, but the type stub apparently only defines the version that takes a reason string. While this doesn't cause runtime errors (unittest handles both cases), it's a genuine type-level issue that pyrefly is now catching thanks to improved decorator analysis. The fact that pyright also reports this error supports that this is a real type issue, not a pyrefly bug. Attribution: The changes to class decorator handling in
pyrefly/lib/alt/solve.rs, specifically the new code in theBinding::ClassDefcase that now properly applies decorators and checks their types, caused this error to appear. The decorator is now being type-checked when applied to the class.
Suggested fixes
Summary: Class decorator handling in solve.rs is too aggressive, transforming class types into non-class types even when decorators preserve the class interface, causing 183 pyrefly-only false positives across 5 projects.
1. In the Binding::ClassDef case in solve.rs (lines 4810-4855), add a type preservation check: after applying each decorator, if the resulting type is not a class type but the decorator is known to preserve classes (like @deprecated, @deprecated_class, @jax.tree_util.register_static), keep the original class type instead of the transformed type
Files:
pyrefly/lib/alt/solve.rsConfidence: high Affected projects: scikit-learn, steam.py, core, spack, jax Fixes:bad-override,bad-assignment,incompatible-argument,type-mismatchThe current logic blindly applies decorator transformations even when decorators are class-preserving wrappers. By checking if common class-preserving decorators are used and maintaining the class type in those cases, we eliminate the false positives where pyrefly thinks decorated classes are no longer classes. Expected outcome: eliminates 183 errors across scikit-learn, steam.py, core, spack, and jax
2. In the Binding::ClassDef case in solve.rs, add a fallback: if untype_opt returns Some (indicating the decorator returned a non-type), but the decorator is applied to a class in a non-interface module, preserve the original class type binding for type-level usage while keeping the decorator result for runtime usage
Files:
pyrefly/lib/alt/solve.rsConfidence: medium Affected projects: spack Fixes:type-mismatch,incompatible-argumentThe untype_opt check at line 4848 correctly identifies when a decorator returns a non-type, but the fallback of just using the original class type is insufficient. We need to maintain dual bindings - the decorated result for runtime calls and the original class for type-level operations like inheritance. This would fix the spack regression where decorated classes become Unknown when imported
Was this helpful? React with 👍 or 👎
Classification by primer-classifier (9 LLM)
Diff from mypy_primer, showing the effect of this PR on open source code:
pandera (https://github.com/pandera-dev/pandera)
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:69:36-60: Argument `type[Timedelta64]` is not assignable to parameter `element` with type `type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]` in function `set.add` [bad-argument-type]
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:73:9-57: Argument `set[type[Complex256] | type[Float128]]` is not assignable to parameter `*s` with type `Iterable[type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]]` in function `set.update` [bad-argument-type]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- ERROR sklearn/linear_model/tests/test_passive_aggressive.py:298:9-22: Object of class `PassiveAggressiveRegressor` has no attribute `transform` [missing-attribute]
+ ERROR sklearn/utils/tests/test_deprecation.py:40:18-28: Invalid base class: `((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
pandas (https://github.com/pandas-dev/pandas)
- ERROR pandas/core/frame.py:637:56-60: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_1d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/core/frame.py:643:21-25: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_2d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3165:35-45: Argument `set[str]` is not assignable to parameter `index` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3167:37-52: Argument `set[str]` is not assignable to parameter `columns` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
core (https://github.com/home-assistant/core)
+ ERROR homeassistant/helpers/service.py:464:12-60: Returned type `homeassistant.helpers.target.SelectedEntities` is not assignable to declared return type `homeassistant.helpers.service.SelectedEntities` [bad-return]
spack (https://github.com/spack/spack)
- ERROR lib/spack/spack/audit.py:1168:52-91: Argument `Unknown | None` is not assignable to parameter `other` with type `ArchSpec` in function `spack.spec.ArchSpec.satisfies` [bad-argument-type]
+ ERROR lib/spack/spack/audit.py:1158:29-61: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:45:12-44: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:56:34-66: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/core.py:153:33-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:176:66-90: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:196:28-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/builder.py:222:16-55: Returned type `bool | str | tuple[bool | str, ...]` is not assignable to declared return type `str` [bad-return]
- ERROR lib/spack/spack/cmd/__init__.py:518:34-44: Argument `tuple[Literal[''], None]` is not assignable to parameter `object` with type `tuple[str, Spec]` in function `list.append` [bad-argument-type]
- ERROR lib/spack/spack/cmd/arch.py:111:23-41: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/cmd/arch.py:113:23-42: Object of class `NoneType` has no attribute `generic` [missing-attribute]
+ ERROR lib/spack/spack/compilers/config.py:224:16-35: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/concretize.py:275:68-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1002:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1047:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1860:30-55: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:448:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:462:32-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:545:21-53: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/graph.py:546:21-28: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/graph.py:547:21-29: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/main.py:828:35-67: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:34:20-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:56:37-45: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/platforms/_platform.py:42:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:54:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:57:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:44-69: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:75:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:78:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:25:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/test.py:26:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/solver/asp.py:1637:39-43: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/solver/asp.py:3497:39-41: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/solver/asp.py:3517:35-67: Object of class `FunctionType` has no attribute `from_concretizer` [missing-attribute]
+ ERROR lib/spack/spack/solver/requirements.py:318:35-60: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:269:47-55: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:271:30-44: Object of class `tuple` has no attribute `platform` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:46-54: Object of class `tuple` has no attribute `os` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:56-68: Object of class `tuple` has no attribute `target` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:293:32-34: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:305:34-42: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:344:21-58: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:382:26-67: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:398:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:420:34-42: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:441:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:455:28-47: Object of class `FunctionType` has no attribute `ANY_TARGET` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:460:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:564:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:1009:9-18: Class member `FlagMap._cmp_iter` overrides parent class `HashableMap` in an inconsistent manner [bad-override]
+ ERROR lib/spack/spack/spec.py:641:32-53: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:784:81-95: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:790:13-22: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:791:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:792:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:793:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:794:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:795:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:798:34-48: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:868:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:870:30-872:10: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:871:13-19: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:31-35: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:49-56: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:71-79: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:930:15-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:930:15-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:1488:26-47: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1673:31-81: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:1673:32-38: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:47-51: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:58-65: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:69-77: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1778:35-70: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1934:13-28: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:1935:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1936:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1937:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1938:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1939:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2587:37-54: Object of class `FunctionType` has no attribute `override` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3662:31-87: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3717:9-33: Object of class `FlagMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3731:17-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3733:9-27: Object of class `VariantMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5180:9-20: Class member `VariantMap.__setitem__` overrides parent class `HashableMap` in an inconsistent manner [bad-param-name-override]
+ ERROR lib/spack/spack/spec.py:5176:18-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:5176:18-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:5182:34-49: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:5428:33-51: Object of class `FunctionType` has no attribute `from_dict` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5467:17-53: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5439:39-69: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5859:18-33: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/test/architecture.py:78:70-75: Expected 1 positional argument, got 2 [bad-argument-count]
- ERROR lib/spack/spack/test/concretization/core.py:1287:24-56: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1605:44-74: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `set.__init__` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1618:20-52: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `set.__init__` [bad-argument-type]
- ERROR lib/spack/spack/test/config.py:409:30-48: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:839:25-40: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:839:42-60: Object of class `NoneType` has no attribute `version` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:173:9-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:209:19-74: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['d30392e66c636a063769cbb1db08cd3455a424650d4494db6379d73ea799582b']` and `bool` [not-iterable]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:53-61: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:67-71: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/variant.py:345:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:348:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:351:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
- ERROR lib/spack/spack/traverse.py:236:49-53: Argument `None` is not assignable to parameter `parent` with type `Spec` in function `spack.spec.DependencySpec.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/traverse.py:37:12-37: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:236:41-86: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/traverse.py:236:42-48: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:55-59: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:63-70: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:74-82: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:460:16-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:475:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:665:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/util/path.py:76:34-52: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/variant.py:511:55-62: Argument `tuple[None]` is not assignable to parameter `value` with type `tuple[bool | str, ...]` in function `VariantValue.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/variant.py:159:41-53: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:216:32-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:218:19-51: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/variant.py:222:58-70: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:224:48-57: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:312:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:316:36-40: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:316:56-65: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:316:77-85: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:322:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:322:74-83: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:325:49-53: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:325:65-74: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:330:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:332:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:332:67-76: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:336:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:336:69-78: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:340:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:340:62-71: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:344:13-17: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:346:13-22: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:347:13-21: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:351:64-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:354:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:68-76: Unexpected keyword argument `concrete` [unexpected-keyword]
... (truncated 16 lines) ...
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/testing/tests/test_skip_class.py:20:1-15: Argument `type[SkipClassTests]` is not assignable to parameter `reason` with type `str` in function `unittest.case.skip` [bad-argument-type]
django-modern-rest (https://github.com/wemake-services/django-modern-rest)
+ ERROR dmr/sse/builder.py:405:12-25: Returned type `_Wrapped[[HttpRequest, SSEContext[_PathT, _QueryT, _HeadersT, _CookiesT]], Awaitable[SSEResponse[SSE]], [**kwargs: Any], _build_controller.SSEController]` is not assignable to declared return type `type[Controller[_SerializerT]]` [bad-return]
jax (https://github.com/google/jax)
+ ERROR jax/experimental/array_serialization/serialization_test.py:961:5-35: `UserPytreeAPITest.test_custom_node_registration.P` is not assignable to upper bound `Hashable` of type variable `H` [bad-specialization]
Primer Diff Classification
❌ 2 regression(s) | ✅ 6 improvement(s) | 8 project(s) total | +184, -33 errors
2 regression(s) across scikit-learn, jax. error kinds: invalid-inheritance, missing-attribute, bad-specialization. caused by is_some(). 6 improvement(s) across pandera, pandas, core, spack, spark, django-modern-rest.
| Project | Verdict | Changes | Error Kinds | Root Cause |
|---|---|---|---|---|
| pandera | ✅ Improvement | -2 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| scikit-learn | ❌ Regression | +1, -1 | invalid-inheritance, missing-attribute |
is_some() |
| pandas | ✅ Improvement | -4 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| core | ✅ Improvement | +1 | bad-return from decorated class constructor |
pyrefly/lib/alt/solve.rs |
| spack | ✅ Improvement | +179, -26 | not-a-type / invalid-inheritance from function type |
pyrefly/lib/alt/solve.rs |
| spark | ✅ Improvement | +1 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| django-modern-rest | ✅ Improvement | +1 | bad-return |
pyrefly/lib/alt/solve.rs |
| jax | ❌ Regression | +1 | bad-specialization |
pyrefly/lib/alt/solve.rs |
Detailed analysis
❌ Regression (2)
scikit-learn (+1, -1)
The new
invalid-inheritanceerror is a regression (false positive). The@deprecateddecorator from sklearn wraps a class and returns a modified class that is valid as a base class at runtime. The PR's new decorator handling resolvesMockClass1to the type((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknowninstead of preserving it as a class type. This causes pyrefly to incorrectly reject it as a base class. While pyright also flags this, it remains a false positive — sklearn'sdeprecateddecorator returns a class (specifically, it wraps the class's__new__and__init__methods but returns the original class object). The type checker should recognize that the decorated result is still a class.
The removed missing-attribute error is a side effect of the same decorator resolution issue. PassiveAggressiveRegressor is decorated with @deprecated in sklearn. The code at line 298 (reg.transform(X)) is inside a pytest.raises(AttributeError) block, so the missing attribute access is intentional test code. Previously, pyrefly correctly resolved PassiveAggressiveRegressor as a class and flagged the missing transform attribute. Now, with the changed decorator handling, PassiveAggressiveRegressor is likely resolved as a callable/Unknown union type rather than a proper class, so attribute checking no longer works correctly — the error disappears not because the analysis improved, but because the type information degraded.
Overall, the net effect is a regression. The new error is a false positive (valid inheritance from a decorated class is rejected), and the removed error was technically correct but lost due to degraded type resolution of decorated classes.
Attribution: The PR changes in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now process class decorators. Previously, decorators were ignored (TODO: analyze the class decorators). Now, the code iterates through decorators, calls them, and checks the return type. For@deprecated, the decorator returns a callable wrapper, not a class type. WhenMockClass5tries to inherit fromMockClass1(which is now typed as the decorator's return type — a callable), pyrefly flags it asinvalid-inheritance. Theuntype_optcheck at the end of the decorator loop (if self.untype_opt(ty.clone(), range, errors).[is_some()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs)) is supposed to preserve the original class type when the decorator returns a usable type form, but for@deprecatedit apparently resolves to a callable type((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknownwhich doesn't pass theuntype_optcheck, so the runtime binding becomes the callable type. The removal of themissing-attributeerror is likely because the decorator processing changes howPassiveAggressiveRegressor(which is also decorated with@deprecated) is resolved — if it's now typed as a callable rather than a class, attribute checking may work differently.
jax (+1)
This is likely a legitimate type issue (non-frozen dataclass instances aren't Hashable), but it's debatable whether this should be flagged. The error is pyrefly-only and arises from the new class decorator processing. However, since
register_staticpresumably requires hashable types andPgenuinely isn't hashable as a dataclass, this could be seen as pyrefly correctly catching a real issue that other checkers miss. The practical impact is low since the test works at runtime. Given the pyrefly-only status and that this is a side effect of new decorator processing in a test file, this leans toward regression — the error may be technically correct but is practically unhelpful and not flagged by other tools. Attribution: The change inpyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now processes class decorators by calling them as functions on the class type. Previously there was a TODO comment and decorators were skipped. Nowjax.tree_util.register_static(P)is type-checked, and sincePis a non-frozen dataclass (unhashable instances), it triggersbad-specializationagainst theHashableupper bound of the type variable.
✅ Improvement (6)
pandera (-2)
These errors occur because pyrefly infers the type of
PYSPARK_PANDAS_UNSUPPORTEDfrom the set literal on lines 46-64, producing a union of the specific type classes present in that literal. WhenTimedelta64is added via.add()on line 69 andFloat128/Complex256are added via.update()on line 73, pyrefly reports them as incompatible with the inferred set element type because they weren't part of the original literal.
In pandera's numpy_engine, classes like Timedelta64, Float128, and Complex256 are defined with class decorators (e.g., @Engine.register_dtype). The PR's improved class decorator support likely allowed pyrefly to properly resolve the types of these decorated classes, recognizing their actual class identity and inheritance relationships. With proper type resolution, pyrefly can determine that these types share a common base class with the other engine types already in the set, making them compatible with the set's element type. This eliminates the false positive bad-argument-type errors for both the .add() and .update() calls.
Attribution: The changes to
Binding::ClassDefinpyrefly/lib/alt/solve.rsnow properly apply class decorators to class definitions. Since pandera engine types use@Engine.register_dtypedecorators, the improved decorator handling changed how these classes are typed. The new logic that checksuntype_optand falls back tomk_class_def(cls.dupe())when the decorator returns a usable type form means the decorated engine classes now resolve to their proper class types rather than decorator return types, making them compatible with the set's element type.
pandas (-4)
Errors 1-2 at lines 637 and 643 involve the
dataparameter typed asdata=None(no annotation), which pyrefly infers asUnknown. By line 622 (theelsebranch), all list-like, dict, ndarray, Series, Index, ExtensionArray, MaskedArray, DataFrame, BlockManager, and None cases have been handled, sodatamust be a scalar value. However, pyrefly's inferred typelist[Unknown] | Unknowndoesn't properly narrow through these isinstance/is_list_like checks, making these false positives from incomplete type narrowing. The PR likely improved control-flow-based type narrowing so the checker recognizesdatais scalar at that point.
Errors 3-4 at test lines 3165 and 3167 pass set[str] to index and columns parameters of DataFrame.__init__. The parameter types are Axes | None where Axes is defined as ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None. set[str] does not satisfy any of these types — set is not a Sequence so it doesn't match SequenceNotStr. The test code deliberately passes sets to verify that DataFrame.__init__ raises ValueError at runtime (lines 497-499: if isinstance(index, set): raise ValueError(...)). These are technically valid type errors since the types genuinely don't match, but they are intentional in test code that verifies error handling. Their removal suggests the PR either adjusted how test files are checked or improved handling of such intentional-mismatch test patterns.
Attribution: The changes in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now process class decorators (previously they were ignored with a TODO comment). The@set_module('pandas')decorator on theDataFrameclass is now being evaluated. The newuntype_optcheck ensures that if a decorator still returns a usable type form, the original class type is preserved. This improved type resolution forDataFrame, which cascaded to better inference for the__init__parameters, eliminating the false positiveUnknown-based errors.
core (+1)
✅ bad-return from decorated class constructor: The new class decorator analysis reveals that
SelectedEntities(**dataclasses.asdict(selected))producestarget_helpers.SelectedEntities(due to@deprecated_classdecorator effect) but the function declares return typeservice.SelectedEntities. Pyright co-reports this. This is a legitimate type issue.Overall: This is a genuine type-level issue revealed by the new decorator analysis. The
deprecated_classdecorator wraps the class, and the type system now sees the constructor as returning the parent typetarget_helpers.SelectedEntitiesrather than the childservice.SelectedEntities. Pyright agrees this is an issue. While the code works at runtime, the type annotation is technically incorrect given the decorator's effect on the type. This is a real finding from improved decorator support.Attribution: The change in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now applies class decorators to the class type. Previously decorators were ignored (TODOcomment). Now pyrefly calls the decorator on the class type and uses the return type. Thedeprecated_classdecorator likely returns something typed as producingtarget_helpers.SelectedEntitiesrather than the subclass, causing thebad-returnerror.
spack (+179, -26)
❌ not-a-type / invalid-inheritance from function type: 48 not-a-type + 12 invalid-inheritance errors all show
((realf: Unknown) -> Unknown) | Unknownwhere a class type should be. This is a decorator misresolution causing classes to be typed as functions. All pyrefly-only — regression. ❌ missing-attribute on FunctionType: 25 errors where class attributes (default_arch, from_dict, etc.) are missing because the class was resolved as FunctionType. Cascade from the decorator misresolution — regression. ❌ unexpected-keyword / bad-argument-count / missing-argument: 52 + 28 + 5 = 85 errors where constructor calls and method calls fail because classes are seen as functions with wrong signatures. Cascade from decorator misresolution — regression. ❌ missing-attribute on tuple / unsupported-operation: 3 + 2 = 5 errors from further cascading type confusion. Regression. ❌ invalid-argument: 4 errors where class objects are expected but function types are inferred. Regression. ✅ Removed bad-argument-type errors: 7 removed errors about Unknown | None not assignable to ArchSpec — these were likely false positives from previous type resolution issues. The class was probably returning Unknown before. Improvement. ✅ Removed missing-attribute on NoneType: 6 removed errors — likely false positives where optional narrowing wasn't working. Improvement. ✅ Removed missing-attribute on VariantValue/FlagMap/VariantMap: 7 removed errors — mixed. Some (likespecon FlagMap/VariantMap) were likely false positives for dynamically-set attributes. Some may be lost due to class misresolution. ❌ Removed bad-return / bad-override / bad-param-name-override: 3 removed errors — the bad-return was plausibly catching a real issue (value could be bool/tuple but declared str). The override errors may have been lost due to class misresolution. Likely regression for these specific removals.Overall: This is a clear regression. The PR's class decorator support is misresolving classes in the spack project, turning them into function types
(realf: Unknown) -> Unknown). This produces 179 new false positive errors (none confirmed by mypy/pyright) across fundamental operations like constructing specs, inheriting from base classes, and accessing class methods. The 26 removed errors are a mix of false positive removals and lost real checks, but the net effect is overwhelmingly negative.
Per-category reasoning:
- not-a-type / invalid-inheritance from function type: 48 not-a-type + 12 invalid-inheritance errors all show
((realf: Unknown) -> Unknown) | Unknownwhere a class type should be. This is a decorator misresolution causing classes to be typed as functions. All pyrefly-only — regression. - missing-attribute on FunctionType: 25 errors where class attributes (default_arch, from_dict, etc.) are missing because the class was resolved as FunctionType. Cascade from the decorator misresolution — regression.
- unexpected-keyword / bad-argument-count / missing-argument: 52 + 28 + 5 = 85 errors where constructor calls and method calls fail because classes are seen as functions with wrong signatures. Cascade from decorator misresolution — regression.
- missing-attribute on tuple / unsupported-operation: 3 + 2 = 5 errors from further cascading type confusion. Regression.
- invalid-argument: 4 errors where class objects are expected but function types are inferred. Regression.
- Removed bad-argument-type errors: 7 removed errors about Unknown | None not assignable to ArchSpec — these were likely false positives from previous type resolution issues. The class was probably returning Unknown before. Improvement.
- Removed missing-attribute on NoneType: 6 removed errors — likely false positives where optional narrowing wasn't working. Improvement.
- Removed missing-attribute on VariantValue/FlagMap/VariantMap: 7 removed errors — mixed. Some (like
specon FlagMap/VariantMap) were likely false positives for dynamically-set attributes. Some may be lost due to class misresolution. - Removed bad-return / bad-override / bad-param-name-override: 3 removed errors — the bad-return was plausibly catching a real issue (value could be bool/tuple but declared str). The override errors may have been lost due to class misresolution. Likely regression for these specific removals.
Attribution: The change to the
Binding::ClassDefmatch arm inpyrefly/lib/alt/solve.rsnow applies class decorators. When a decorator's return type cannot be resolved as a valid type form (theuntype_optcheck fails), pyrefly replaces the class type with the decorator's return type. For spack, some import or decorator is being misresolved as(realf: Unknown) -> Unknown, causing cascading errors across the entire project. Theuntype_optlogic forType::KwCall(also added in this PR) and the newExpr::Namehandling inexpr_infer_type_formmay also contribute to incorrect resolution.
spark (+1)
This is a genuine type error.
unittest.skipis typed asdef skip(reason: str) -> Callable[[_FT], _FT], so@unittest.skipwithout parentheses passes the class as thereasonparameter, which expectsstr. Pyright also flags this. The PR's new class decorator support insolve.rsnow correctly analyzes decorator application to classes, catching this real misuse. While it works at runtime because CPython'sunittest.skipimplementation explicitly checks if the argument is callable and handles the no-parentheses decorator case intentionally, the type stubs don't reflect this dual usage pattern, making it a legitimate type-level error. The code should be@unittest.skip('reason')to satisfy both the type checker and clearly express intent. Attribution: The change inpyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now applies class decorators by calling them with the class type as an argument. Previously, decorators were ignored (TODO: analyze the class decorators). Now pyrefly actually checks the decorator call, which meansunittest.skip(which expectsstr) receivingtype[SkipClassTests]is correctly flagged as a type mismatch.
django-modern-rest (+1)
This is a false positive. The
@wraps(func, updated=())decorator on the innerSSEControllerclass (line 367) is being processed by pyrefly's decorator application logic.functools.wrapsreturns the decorated object unchanged at runtime (it just copies metadata), but its type stub signature returns_Wrapped[...]. When pyrefly applies this decorator type to the class, it infers the result as_Wrapped[[HttpRequest, SSEContext[...]], Awaitable[SSEResponse[SSE]], [**kwargs: Any], _build_controller.SSEController], which doesn't match the declared return typetype[Controller[_SerializerT]].
This is a false positive because:
- The code is correct at runtime —
functools.wrapsreturns the class itself unchanged, just copying over metadata attributes like__name__,__doc__, etc. - The
# pyright: ignore[reportReturnType]comment on line 405 already indicates this is a known limitation of static type checkers with this pattern — pyright also cannot properly type this usage ofwrapson a class. - The type
_Wrapped[...]is the typeshed stub's way of representing the return offunctools.wraps, but it doesn't accurately reflect that when applied to a class, the result is still that same class type. - The new error is a regression introduced by the PR's new class decorator handling — the type checker is now applying the
wrapsdecorator's return type annotation to the class definition, producing_Wrapped[...]as the inferred type ofSSEController, which then fails the return type check againsttype[Controller[_SerializerT]].
Attribution: The change in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefbranch now applies class decorators to the class type. Previously, decorators were ignored (TODO: analyze the class decorators). Now, for theSSEControllerclass defined at line 368, the@wraps(func, updated=())decorator is being applied. Thewrapsfunction returns a_Wrappedtype (from functools stubs), so pyrefly now infers the type ofSSEControlleras_Wrapped[...]instead oftype[SSEController]. Theuntype_optcheck at the end of the decorator loop is supposed to detect when a decorator returns a non-type and fall back to the original class, but_Wrappedapparently passes throughuntype_opt(possibly via the newType::KwCallbranch added at line 5193), causing pyrefly to use the wrapped type instead of the original class type.
Specifically, the logic at lines 4815-4817 says: if untype_opt returns Some, restore the original class type. But _Wrapped is a callable type that untype_opt might not recognize as a "usable type form", so it falls through and the _Wrapped type is kept as the inferred type of SSEController, leading to the bad-return error.
Suggested fixes
Summary: The new class decorator processing in Binding::ClassDef replaces class types with decorator return types when untype_opt fails, causing massive regressions when decorators return Unknown/callable types instead of class types.
1. In the Binding::ClassDef match arm in pyrefly/lib/alt/solve.rs (around line 4815), the untype_opt guard logic is inverted. Currently, when untype_opt returns Some (decorator returns a valid type form like a class), it restores the original class type — but this is the case where the decorator's return type SHOULD be used (e.g., @remote returning ActorHandle[T]). When untype_opt returns None (decorator returns a callable/Unknown that isn't a type form), it keeps the non-class type — but this is the case where the original class type SHOULD be preserved. The fix: after calling the decorator via call_infer, check if the result is still a usable type (class-like). If the decorator returns something that contains Unknown or is a plain callable (not a class type), fall back to the original class def. Specifically, change the guard to: if the returned ty is or contains Unknown (e.g., via ty.[is_unknown()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs) or similar), OR if untype_opt returns None (meaning it's not a valid type form at all), then restore ty = self.heap.mk_class_def(cls.dupe()). Only keep the decorator's return type when untype_opt succeeds AND the type is not Unknown-contaminated. This preserves the test_class_decorator_rebinds_class_value behavior (where @remote returns ActorHandle[T], a valid type form) while preventing regressions from decorators like @deprecated that return Unknown | callable.
Files:
pyrefly/lib/alt/solve.rsConfidence: high Affected projects: scikit-learn, jax, spack, django-modern-rest Fixes:invalid-inheritance,not-a-type,missing-attribute,unexpected-keyword,bad-argument-count,missing-argument,unsupported-operation,invalid-argument,bad-specialization,bad-returnThe spack project has 179 new pyrefly-only errors all showing((realf: Unknown) -> Unknown) | Unknownwhere class types should be. scikit-learn shows((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown. In both cases, decorators with Unknown return types replace the class type. The untype_opt check fails (returns None) for these callable/Unknown types, so the non-class type is kept. Inverting the fallback logic — fall back to the original class when untype_opt fails OR when the type contains Unknown — would eliminate ~179 errors in spack, 1 error in scikit-learn (invalid-inheritance), restore the lost missing-attribute in scikit-learn, eliminate 1 error in jax (bad-specialization from decorator application), and prevent the django-modern-rest false positive. The test_class_decorator_rebinds_class_value test would still pass becauseActorHandle[T]is a concrete type form that untype_opt would recognize.
2. Additionally, in the Type::KwCall branch added to untype_opt (line 5193), recursing into call.return_ty may cause decorators like @functools.wraps(func, updated=()) to pass through untype_opt when they shouldn't (since _Wrapped[...] is callable and its return type may be a valid type). Add a guard in this branch: only recurse into KwCall's return_ty if the KwCall represents a type alias or known type-form-producing call, not arbitrary decorator applications. This would prevent the django-modern-rest false positive where _Wrapped passes through untype_opt, causing the class type to NOT be restored.
Files:
pyrefly/lib/alt/solve.rsConfidence: medium Affected projects: django-modern-rest Fixes:bad-returnThe django-modern-rest regression occurs because @wraps returns _Wrapped[...], which is a KwCall type. The new untype_opt branch for Type::KwCall recurses into its return_ty, which may succeed, causing untype_opt to return Some and triggering the class type restoration — or alternatively, it may fail, keeping the _Wrapped type. Either way, the KwCall branch should be more conservative about what it accepts. This would fix 1 bad-return error in django-modern-rest.
Was this helpful? React with 👍 or 👎
Classification by primer-classifier (8 LLM)
Diff from mypy_primer, showing the effect of this PR on open source code:
pandera (https://github.com/pandera-dev/pandera)
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:69:36-60: Argument `type[Timedelta64]` is not assignable to parameter `element` with type `type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]` in function `set.add` [bad-argument-type]
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:73:9-57: Argument `set[type[Complex256] | type[Float128]]` is not assignable to parameter `*s` with type `Iterable[type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]]` in function `set.update` [bad-argument-type]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- ERROR sklearn/linear_model/tests/test_passive_aggressive.py:298:9-22: Object of class `PassiveAggressiveRegressor` has no attribute `transform` [missing-attribute]
+ ERROR sklearn/utils/tests/test_deprecation.py:40:18-28: Invalid base class: `((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
pandas (https://github.com/pandas-dev/pandas)
- ERROR pandas/core/frame.py:637:56-60: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_1d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/core/frame.py:643:21-25: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_2d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3165:35-45: Argument `set[str]` is not assignable to parameter `index` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3167:37-52: Argument `set[str]` is not assignable to parameter `columns` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
core (https://github.com/home-assistant/core)
+ ERROR homeassistant/helpers/service.py:464:12-60: Returned type `homeassistant.helpers.target.SelectedEntities` is not assignable to declared return type `homeassistant.helpers.service.SelectedEntities` [bad-return]
spack (https://github.com/spack/spack)
- ERROR lib/spack/spack/audit.py:1168:52-91: Argument `Unknown | None` is not assignable to parameter `other` with type `ArchSpec` in function `spack.spec.ArchSpec.satisfies` [bad-argument-type]
+ ERROR lib/spack/spack/audit.py:1158:29-61: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:45:12-44: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:56:34-66: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/core.py:154:33-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:177:66-90: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:197:28-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/builder.py:222:16-55: Returned type `bool | str | tuple[bool | str, ...]` is not assignable to declared return type `str` [bad-return]
- ERROR lib/spack/spack/cmd/__init__.py:518:34-44: Argument `tuple[Literal[''], None]` is not assignable to parameter `object` with type `tuple[Unknown, Spec]` in function `list.append` [bad-argument-type]
- ERROR lib/spack/spack/cmd/arch.py:111:23-41: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/cmd/arch.py:113:23-42: Object of class `NoneType` has no attribute `generic` [missing-attribute]
+ ERROR lib/spack/spack/compilers/config.py:224:16-35: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/concretize.py:275:68-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1002:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1047:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1860:30-55: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:448:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:462:32-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:545:21-53: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/graph.py:546:21-28: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/graph.py:547:21-29: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/main.py:828:35-67: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:34:20-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:56:37-45: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/platforms/_platform.py:42:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:54:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:57:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:44-69: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:75:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:78:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:25:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/test.py:26:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/solver/asp.py:1640:39-43: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/solver/asp.py:3503:39-41: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/solver/asp.py:3523:35-67: Object of class `FunctionType` has no attribute `from_concretizer` [missing-attribute]
+ ERROR lib/spack/spack/solver/requirements.py:318:35-60: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:269:47-55: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:271:30-44: Object of class `tuple` has no attribute `platform` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:46-54: Object of class `tuple` has no attribute `os` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:56-68: Object of class `tuple` has no attribute `target` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:293:32-34: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:305:34-42: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:344:21-58: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:382:26-67: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:398:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:420:34-42: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:441:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:455:28-47: Object of class `FunctionType` has no attribute `ANY_TARGET` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:460:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:564:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:1009:9-18: Class member `FlagMap._cmp_iter` overrides parent class `HashableMap` in an inconsistent manner [bad-override]
+ ERROR lib/spack/spack/spec.py:641:32-53: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:784:81-95: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:790:13-22: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:791:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:792:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:793:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:794:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:795:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:798:34-48: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:868:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:870:30-872:10: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:871:13-19: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:31-35: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:49-56: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:71-79: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:930:15-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:930:15-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:1488:26-47: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1673:31-81: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:1673:32-38: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:47-51: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:58-65: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:69-77: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1778:35-70: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1934:13-28: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:1935:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1936:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1937:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1938:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1939:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2587:37-54: Object of class `FunctionType` has no attribute `override` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3662:31-87: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3717:9-33: Object of class `FlagMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3731:17-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3733:9-27: Object of class `VariantMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5180:9-20: Class member `VariantMap.__setitem__` overrides parent class `HashableMap` in an inconsistent manner [bad-param-name-override]
+ ERROR lib/spack/spack/spec.py:5176:18-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:5176:18-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:5182:34-49: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:5428:33-51: Object of class `FunctionType` has no attribute `from_dict` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5467:17-53: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5439:39-69: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5859:18-33: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/test/architecture.py:78:70-75: Expected 1 positional argument, got 2 [bad-argument-count]
- ERROR lib/spack/spack/test/concretization/core.py:1287:24-56: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1605:44-74: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `set.__init__` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1618:20-52: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `set.__init__` [bad-argument-type]
- ERROR lib/spack/spack/test/config.py:409:30-48: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:839:25-40: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:839:42-60: Object of class `NoneType` has no attribute `version` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:173:9-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:209:19-74: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['d30392e66c636a063769cbb1db08cd3455a424650d4494db6379d73ea799582b']` and `bool` [not-iterable]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:53-61: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:67-71: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/variant.py:345:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:348:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:351:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
- ERROR lib/spack/spack/traverse.py:236:49-53: Argument `None` is not assignable to parameter `parent` with type `Spec` in function `spack.spec.DependencySpec.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/traverse.py:37:12-37: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:236:41-86: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/traverse.py:236:42-48: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:55-59: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:63-70: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:74-82: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:460:16-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:475:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:665:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/util/path.py:76:34-52: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/variant.py:511:55-62: Argument `tuple[None]` is not assignable to parameter `value` with type `tuple[bool | str, ...]` in function `VariantValue.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/variant.py:159:41-53: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:216:32-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:218:19-51: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/variant.py:222:58-70: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:224:48-57: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:312:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:316:36-40: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:316:56-65: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:316:77-85: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:322:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:322:74-83: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:325:49-53: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:325:65-74: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:330:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:332:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:332:67-76: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:336:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:336:69-78: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:340:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:340:62-71: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:344:13-17: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:346:13-22: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:347:13-21: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:351:64-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:354:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:68-76: Unexpected keyword argument `concrete` [unexpected-keyword]
... (truncated 16 lines) ...
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/testing/tests/test_skip_class.py:20:1-15: Argument `type[SkipClassTests]` is not assignable to parameter `reason` with type `str` in function `unittest.case.skip` [bad-argument-type]
django-modern-rest (https://github.com/wemake-services/django-modern-rest)
+ ERROR dmr/sse/builder.py:423:12-25: Returned type `_Wrapped[[HttpRequest, SSEContext[_PathT, _QueryT, _HeadersT, _CookiesT]], Awaitable[SSEResponse[SSE]], [**kwargs: Any], _build_controller.SSEController]` is not assignable to declared return type `type[Controller[_SerializerT]]` [bad-return]
jax (https://github.com/google/jax)
+ ERROR jax/experimental/array_serialization/serialization_test.py:961:5-35: `UserPytreeAPITest.test_custom_node_registration.P` is not assignable to upper bound `Hashable` of type variable `H` [bad-specialization]
Primer Diff Classification
✅ 7 improvement(s) | ➖ 1 neutral | 8 project(s) total | +184, -33 errors
7 improvement(s) across pandera, scikit-learn, core, spack, spark, django-modern-rest, jax.
| Project | Verdict | Changes | Error Kinds | Root Cause |
|---|---|---|---|---|
| pandera | ✅ Improvement | -2 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| scikit-learn | ✅ Improvement | +1, -1 | invalid-inheritance on deprecated class |
pyrefly/lib/alt/solve.rs |
| pandas | ➖ Neutral | -4 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| core | ✅ Improvement | +1 | bad-return |
pyrefly/lib/alt/solve.rs |
| spack | ✅ Improvement | +179, -26 | unexpected-keyword (52 errors) |
pyrefly/lib/alt/solve.rs |
| spark | ✅ Improvement | +1 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| django-modern-rest | ✅ Improvement | +1 | bad-return from class decorator application |
pyrefly/lib/alt/solve.rs |
| jax | ✅ Improvement | +1 | bad-specialization |
pyrefly/lib/alt/solve.rs |
Detailed analysis
✅ Improvement (7)
pandera (-2)
The removed errors were false positives related to how pyrefly inferred the element type of the
PYSPARK_PANDAS_UNSUPPORTEDset. The set is initialized with a literal containing specific types fromnumpy_engineandpandas_engine(lines 46-64), and pyrefly inferred the set's element type as a union of exactly those types. Later,numpy_engine.Timedelta64is conditionally added via.add()(line 69), andnumpy_engine.Float128andnumpy_engine.Complex256are conditionally added via.update()(lines 72-74). These three types were not in the original set literal, so they weren't part of the inferred element type union.
The classes like Timedelta64, Float128, and Complex256 in pandera's numpy_engine are decorated with engine registration decorators (class decorators). Previously, pyrefly didn't properly handle class decorators, which likely caused these types to be resolved differently from the types in the initial set literal. For example, if the decorator was not properly processed, the decorated class might have been given a different type representation that didn't share a common base with the other engine types in the set. With the PR's class decorator support, these decorated classes are now correctly resolved, making them compatible with (or recognized as subtypes of) the set's element type, thus eliminating the type errors on .add() and .update() calls.
Attribution: The change in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now processes class decorators. When a decorator's return type is still a usable type form (untype_optsucceeds), pyrefly preserves the original class definition (ty = self.heap.mk_class_def(cls.dupe())). This allows pandera's decorated engine dtype classes (likeTimedelta64,Float128,Complex256) to be correctly resolved as their original class types, fixing the set element type compatibility.
scikit-learn (+1, -1)
➖ invalid-inheritance on deprecated class: The
@deprecateddecorator modifiesMockClass1's__new__/__init__to emit a warning and returns the class itself at runtime. However, the decorator's type annotations don't preserve the class type in its return signature, so pyrefly infers the decorated type as a callable, making it invalid as a base class. Pyright agrees ([pyright: yes]). This is a real limitation of the decorator's type annotations, though it creates noise for a common pattern. ✅ removed false positive for missing attribute in pytest.raises: Thereg.transform(X)call at line 298 is insidewith pytest.raises(AttributeError):, deliberately testing that the attribute doesn't exist. Pyrefly was wrong to flag this as a static error. Removing it is a clear improvement.Overall: This is a mixed result. The removed error (missing
transformattribute) was a clear false positive — the test deliberately calls a non-existent method insidepytest.raises(AttributeError). Removing it is an improvement.
The new invalid-inheritance error is more nuanced. The @deprecated decorator from sklearn modifies the class's __new__/__init__ to emit a deprecation warning and returns the class itself at runtime. However, the decorator's type annotations don't preserve the input class type in its return signature, so pyrefly's new decorator support infers the return type as a callable rather than a class. The untype_opt check in the PR is supposed to handle this case (preserving the original class when the decorator returns a usable type form), but it fails here because deprecated's return annotation resolves to a generic callable. Pyright also flags this ([pyright: yes]), suggesting it's a known limitation of static analysis with class decorators that don't preserve the class type in their return annotation. This is a borderline case — the decorator's type signature genuinely doesn't preserve the class type, so the error has some validity, but it's also a practical limitation since deprecated is meant to be transparent and the class is returned unchanged at runtime. Given that pyright agrees and the sklearn deprecated decorator genuinely doesn't have proper type annotations to preserve the class type, this new error is arguably correct (the decorator's type signature is incomplete). On balance, the removal of the false positive is a clear improvement, and the new error, while potentially noisy, reflects a real gap in the decorator's type annotations. Net effect is slightly positive.
Attribution: The PR changes in
pyrefly/lib/alt/solve.rsadd class decorator support. TheBinding::ClassDefmatch arm now processes decorators by calling them on the class type. For@deprecated('qwerty')onMockClass1, the decorator returns a callable (not a class type), so whenMockClass5tries to inherit fromMockClass1, pyrefly sees the base class as((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknowninstead oftype[MockClass1]. Theuntype_optcheck at the end of the decorator loop attempts to preserve the original class if the decorator returns a usable type form, butdeprecatedreturns a generic callable that doesn't pass this check. The removal of thetransformerror is likely a side effect of the same decorator handling changes —PassiveAggressiveRegressoris decorated with@deprecatedin sklearn, and the new decorator handling may change how the class type is resolved, potentially making attribute access less strict.
core (+1)
This is a false positive introduced by the new class decorator support. The
@deprecated_classdecorator is a Home Assistant utility that wraps a class for deprecation warnings but preserves its identity. The localSelectedEntitiesclass inherits fromtarget.SelectedEntities, and callingSelectedEntities(...)correctly produces an instance of the local class. Pyrefly's new decorator handling incorrectly resolves the type, causing it to think the return type is the parent class rather than the subclass. Attribution: The change toBinding::ClassDefhandling inpyrefly/lib/alt/solve.rsnow applies class decorators to the class value binding. When@deprecated_class(...)is applied toSelectedEntities, pyrefly appears to resolve the constructor callSelectedEntities(...)as producingtarget.SelectedEntitiesinstead ofservice.SelectedEntities. Theuntype_optcheck is supposed to preserve the original class when the decorator returns a usable type form, but something in the resolution is causing the constructed type to be the parent class instead of the decorated subclass.
spack (+179, -26)
❌ unexpected-keyword (52 errors): Cascade from classes being mistyped as FunctionType — method signatures are lost, so keyword arguments appear unexpected. ❌ not-a-type (48 errors): Classes resolved as
(realf: Unknown) -> Unknowninstead of class types, making them invalid as type forms in annotations and isinstance checks. ❌ bad-argument-count (28 errors): Cascade from mistyped classes — constructors/methods have wrong signatures when the class is seen as a function. ❌ missing-attribute on FunctionType (25 errors): Core classes like ArchSpec are incorrectly typed as FunctionType, so their class methods (default_arch, from_dict, etc.) appear missing. ❌ invalid-inheritance (12 errors): Base classes resolved as function types instead of class types, making inheritance appear invalid. ❌ missing-argument / invalid-argument / unsupported-operation / missing-attribute on tuple: All cascade errors from the root cause of classes being mistyped as functions due to broken decorator handling. ❌ Removed errors (26): Mostly masked by the type resolution failure — pyrefly can no longer check methods on classes it thinks are FunctionType. Some may have been genuine false positive fixes, but the dominant effect is loss of real checking capability.Overall: The PR introduces class decorator support but breaks type resolution for untyped/partially-typed decorators common in spack. Classes like
ArchSpecare now incorrectly typed asFunctionType, causing 179 cascading false positive errors. All 99 cross-checked errors are pyrefly-only. The 26 removed errors are a mix of masked legitimate checks and possibly-fixed false positives, but the net effect is strongly negative.
Per-category reasoning:
- unexpected-keyword (52 errors): Cascade from classes being mistyped as FunctionType — method signatures are lost, so keyword arguments appear unexpected.
- not-a-type (48 errors): Classes resolved as
(realf: Unknown) -> Unknowninstead of class types, making them invalid as type forms in annotations and isinstance checks. - bad-argument-count (28 errors): Cascade from mistyped classes — constructors/methods have wrong signatures when the class is seen as a function.
- missing-attribute on FunctionType (25 errors): Core classes like ArchSpec are incorrectly typed as FunctionType, so their class methods (default_arch, from_dict, etc.) appear missing.
- invalid-inheritance (12 errors): Base classes resolved as function types instead of class types, making inheritance appear invalid.
- missing-argument / invalid-argument / unsupported-operation / missing-attribute on tuple: All cascade errors from the root cause of classes being mistyped as functions due to broken decorator handling.
- Removed errors (26): Mostly masked by the type resolution failure — pyrefly can no longer check methods on classes it thinks are FunctionType. Some may have been genuine false positive fixes, but the dominant effect is loss of real checking capability.
Attribution: The change to
Binding::ClassDefhandling inpyrefly/lib/alt/solve.rs(around line 4801-4849) now applies class decorators. When a decorator's return type isUnknown(untyped code), theuntype_optcheck fails, and the code falls back to the original class — but apparently this fallback isn't working correctly for all cases, causing classes to be typed asFunctionTypeor(realf: Unknown) -> Unknown.
spark (+1)
This is a genuine type-level finding.
unittest.skipis typed asskip(reason: str) -> Callable[[_FT], _FT]in typeshed. When used as@unittest.skip(without parentheses), the classSkipClassTestsis passed as thereasonargument, which expectsstr. While this works at runtime due to CPython's permissive implementation, the type stubs don't model this overload. Pyright also flags this. The correct usage per the type stubs would be@unittest.skip('reason')with parentheses. This is a real type inconsistency between the code and the declared types — pyrefly is now correctly applying class decorators and catching this mismatch. Attribution: The change inpyrefly/lib/alt/solve.rsin theBinding::ClassDefbranch now applies class decorators by calling them with the class type as an argument. Previously, pyrefly had a TODO comment saying it didn't analyze class decorator application. The new code callsself.call_infer(call_target, &[arg], ...)whereargis the class type, which correctly triggers the type check ofunittest.skip(SkipClassTests)— finding thattype[SkipClassTests]doesn't match thereason: strparameter.
django-modern-rest (+1)
✅ bad-return from class decorator application: The
_build_controllerfunction applies@wraps(func, updated=())toSSEController, which transforms the class type into_Wrapped[...]. This doesn't match the declared return typetype[Controller[_SerializerT]]. The code already has# pyright: ignore[reportReturnType]acknowledging this mismatch. Pyrefly now correctly catches this thanks to the new class decorator support in the PR.Overall: This is a genuine type mismatch that the code authors already acknowledged with
# pyright: ignore[reportReturnType]. The function_build_controllerdeclares it returnstype[Controller[_SerializerT]](line 363), but@wraps(func, updated=())on theSSEControllerclass (line 367) transforms the class into a_Wrappedtype. Pyrefly's new class decorator support correctly tracks this transformation and reports the mismatch. The fact that pyright also flags this (evidenced by the# pyright: ignorecomment) confirms this is a real type issue, not a false positive. Pyrefly previously ignored class decorators entirely, so it missed this; now it correctly catches it.Attribution: The change in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefbranch now applies class decorators to the class type. Previously, pyrefly ignored class decorators entirely (the old code had a TODO comment about this). Now it processes them, which means@wraps(func, updated=())is applied toSSEController, transforming its type from a class type to whateverwrapsreturns (a_Wrapped[...]type). This transformed type is then returned, and pyrefly correctly identifies that_Wrapped[...]is not assignable totype[Controller[_SerializerT]].
jax (+1)
The PR introduces class decorator support, which now processes
@jax.tree_util.register_staticapplied to classP. This triggers abad-specializationerror claimingPdoesn't satisfy aHashablebound. The classPis defined as@dataclasswithoutfrozen=True, which means Python's@dataclassgenerates__eq__and sets__hash__ = None, making instances ofPunhashable. Therefore, pyrefly is technically correct thatPdoes not satisfy theHashableprotocol. The fact that mypy and pyright don't flag this likely reflects differences in how they handle class decorator type variable bounds rather than indicating the error is wrong. The code may work at runtime only because the hashing path isn't exercised in this particular test execution. This is a true positive that was newly detected due to the class decorator support changes. Attribution: The change toBinding::ClassDefhandling inpyrefly/lib/alt/solve.rsnow applies class decorators to the class type. Previously decorators were ignored with a TODO comment. Now pyrefly calls the decorator with the class as argument, which triggers thebad-specializationcheck againstregister_static's inferred type signature.
➖ Neutral (1)
pandas (-4)
Mixed result: 2 false positives removed from production code (Unknown-based inference errors in frame.py where
datais in the scalar branch but was incorrectly inferred aslist[Unknown] | Unknown) is a clear improvement. 2 real type errors removed from test code (set[str] passed to Axes parameter) is a regression - these errors correctly identify thatset[str]is not assignable to theAxestype, and the test code deliberately passes sets to verify that DataFrame.init raises ValueError at runtime (lines 497-499). While these are in test code that intentionally passes invalid types, the type checker was correctly flagging them. On balance, the production code improvements are valuable, but losing valid error detection in test code is a genuine regression. Attribution: The change inpyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now processes class decorators. The@set_module('pandas')decorator onDataFrame(line 269 of frame.py) is now being applied. The new logic calls the decorator and checks viauntype_opt— if the decorator returns a usable type form, it preserves the original class definition. This likely changed howDataFrame's type is resolved, affecting parameter type checking for__init__. TheUnknowninference for thedataparameter may have improved, removing the false positives. The test errors may have been removed due to changes in howDataFrame.__init__'s parameter types are resolved after decorator processing.
Was this helpful? React with 👍 or 👎
Classification by primer-classifier (8 LLM)
Diff from mypy_primer, showing the effect of this PR on open source code:
pandera (https://github.com/pandera-dev/pandera)
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:69:36-60: Argument `type[Timedelta64]` is not assignable to parameter `element` with type `type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]` in function `set.add` [bad-argument-type]
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:73:9-57: Argument `set[type[Complex256] | type[Float128]]` is not assignable to parameter `*s` with type `Iterable[type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]]` in function `set.update` [bad-argument-type]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- ERROR sklearn/linear_model/tests/test_passive_aggressive.py:298:9-22: Object of class `PassiveAggressiveRegressor` has no attribute `transform` [missing-attribute]
+ ERROR sklearn/utils/tests/test_deprecation.py:40:18-28: Invalid base class: `((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
pandas (https://github.com/pandas-dev/pandas)
- ERROR pandas/core/frame.py:637:56-60: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_1d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/core/frame.py:643:21-25: Argument `list[Unknown] | Unknown` is not assignable to parameter `value` with type `Interval[Unknown] | Timedelta | Timestamp | bool | bytes | complex | complexfloating | date | datetime | datetime64 | float | floating | int | integer | str | timedelta | timedelta64` in function `pandas.core.dtypes.cast.construct_2d_arraylike_from_scalar` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3165:35-45: Argument `set[str]` is not assignable to parameter `index` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
- ERROR pandas/tests/frame/test_constructors.py:3167:37-52: Argument `set[str]` is not assignable to parameter `columns` with type `ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.__init__` [bad-argument-type]
core (https://github.com/home-assistant/core)
+ ERROR homeassistant/helpers/service.py:464:12-60: Returned type `homeassistant.helpers.target.SelectedEntities` is not assignable to declared return type `homeassistant.helpers.service.SelectedEntities` [bad-return]
spack (https://github.com/spack/spack)
- ERROR lib/spack/spack/audit.py:1168:52-91: Argument `Unknown | None` is not assignable to parameter `other` with type `ArchSpec` in function `spack.spec.ArchSpec.satisfies` [bad-argument-type]
+ ERROR lib/spack/spack/audit.py:1158:29-61: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:45:12-44: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:56:34-66: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/core.py:154:33-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:177:66-90: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:197:28-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/builder.py:222:16-55: Returned type `bool | str | tuple[bool | str, ...]` is not assignable to declared return type `str` [bad-return]
- ERROR lib/spack/spack/cmd/__init__.py:518:34-44: Argument `tuple[Literal[''], None]` is not assignable to parameter `object` with type `tuple[Unknown, Spec]` in function `list.append` [bad-argument-type]
- ERROR lib/spack/spack/cmd/arch.py:111:23-41: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/cmd/arch.py:113:23-42: Object of class `NoneType` has no attribute `generic` [missing-attribute]
+ ERROR lib/spack/spack/compilers/config.py:224:16-35: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/concretize.py:275:68-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1002:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1047:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1860:30-55: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:448:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:462:32-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:545:21-53: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/graph.py:546:21-28: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/graph.py:547:21-29: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/main.py:828:35-67: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:34:20-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:56:37-45: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/platforms/_platform.py:42:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:54:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:57:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:44-69: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:75:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:78:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:25:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/test.py:26:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/solver/asp.py:1640:39-43: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/solver/asp.py:3503:39-41: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/solver/asp.py:3523:35-67: Object of class `FunctionType` has no attribute `from_concretizer` [missing-attribute]
+ ERROR lib/spack/spack/solver/requirements.py:318:35-60: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:269:47-55: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:271:30-44: Object of class `tuple` has no attribute `platform` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:46-54: Object of class `tuple` has no attribute `os` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:56-68: Object of class `tuple` has no attribute `target` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:293:32-34: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:305:34-42: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:344:21-58: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:382:26-67: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:398:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:420:34-42: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:441:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:455:28-47: Object of class `FunctionType` has no attribute `ANY_TARGET` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:460:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:564:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:1009:9-18: Class member `FlagMap._cmp_iter` overrides parent class `HashableMap` in an inconsistent manner [bad-override]
+ ERROR lib/spack/spack/spec.py:641:32-53: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:784:81-95: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:790:13-22: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:791:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:792:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:793:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:794:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:795:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:798:34-48: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:868:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:870:30-872:10: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:871:13-19: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:31-35: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:49-56: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:71-79: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:930:15-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:930:15-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:1488:26-47: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1673:31-81: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:1673:32-38: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:47-51: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:58-65: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1673:69-77: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1778:35-70: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1934:13-28: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:1935:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1936:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1937:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1938:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1939:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2587:37-54: Object of class `FunctionType` has no attribute `override` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3662:31-87: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3717:9-33: Object of class `FlagMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3731:17-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3733:9-27: Object of class `VariantMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5180:9-20: Class member `VariantMap.__setitem__` overrides parent class `HashableMap` in an inconsistent manner [bad-param-name-override]
+ ERROR lib/spack/spack/spec.py:5176:18-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:5176:18-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:5182:34-49: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:5428:33-51: Object of class `FunctionType` has no attribute `from_dict` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5467:17-53: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5439:39-69: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5859:18-33: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/test/architecture.py:78:70-75: Expected 1 positional argument, got 2 [bad-argument-count]
- ERROR lib/spack/spack/test/concretization/core.py:1287:24-56: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1605:44-74: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `set.__init__` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1618:20-52: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `set.__init__` [bad-argument-type]
- ERROR lib/spack/spack/test/config.py:409:30-48: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:839:25-40: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:839:42-60: Object of class `NoneType` has no attribute `version` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:173:9-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:183:12-57: `in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['2f2b087a8f84834fd03d4d1d5b43584011e869e4657504ef3f8b0a672a5c222e']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:186:12-61: `not in` is not supported between `Literal['a69b288d7393261e613c276c6d38a01461028291f6e381623acc58139d01f54d']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:209:19-74: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c']` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:359:12-72: `not in` is not supported between `Literal['d30392e66c636a063769cbb1db08cd3455a424650d4494db6379d73ea799582b']` and `bool` [not-iterable]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2036:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2037:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2045:53-61: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2337:67-71: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2338:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2435:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/variant.py:345:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:348:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:351:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
- ERROR lib/spack/spack/traverse.py:236:49-53: Argument `None` is not assignable to parameter `parent` with type `Spec` in function `spack.spec.DependencySpec.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/traverse.py:37:12-37: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:236:41-86: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/traverse.py:236:42-48: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:55-59: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:63-70: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:74-82: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:460:16-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:475:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:665:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/util/path.py:76:34-52: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/variant.py:511:55-62: Argument `tuple[None]` is not assignable to parameter `value` with type `tuple[bool | str, ...]` in function `VariantValue.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/variant.py:159:41-53: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:216:32-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:218:19-51: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/variant.py:222:58-70: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:224:48-57: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:312:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:316:36-40: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:316:56-65: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:316:77-85: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:322:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:322:74-83: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:325:49-53: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:325:65-74: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:330:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:332:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:332:67-76: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:336:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:336:69-78: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:340:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:340:62-71: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:344:13-17: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:346:13-22: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:347:13-21: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:351:64-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:354:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:68-76: Unexpected keyword argument `concrete` [unexpected-keyword]
... (truncated 16 lines) ...
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/testing/tests/test_skip_class.py:20:1-15: Argument `type[SkipClassTests]` is not assignable to parameter `reason` with type `str` in function `unittest.case.skip` [bad-argument-type]
django-modern-rest (https://github.com/wemake-services/django-modern-rest)
+ ERROR dmr/sse/builder.py:423:12-25: Returned type `_Wrapped[[HttpRequest, SSEContext[_PathT, _QueryT, _HeadersT, _CookiesT]], Awaitable[SSEResponse[SSE]], [**kwargs: Any], _build_controller.SSEController]` is not assignable to declared return type `type[Controller[_SerializerT]]` [bad-return]
jax (https://github.com/google/jax)
+ ERROR jax/experimental/array_serialization/serialization_test.py:961:5-35: `UserPytreeAPITest.test_custom_node_registration.P` is not assignable to upper bound `Hashable` of type variable `H` [bad-specialization]
Primer Diff Classification
❌ 2 regression(s) | ✅ 6 improvement(s) | 8 project(s) total | +184, -33 errors
2 regression(s) across scikit-learn, jax. error kinds: invalid-inheritance on decorated class used as base, removed missing-attribute in pytest.raises block, False positive bad-specialization on class decorator. 6 improvement(s) across pandera, pandas, core, spack, spark, django-modern-rest.
| Project | Verdict | Changes | Error Kinds | Root Cause |
|---|---|---|---|---|
| pandera | ✅ Improvement | -2 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| scikit-learn | ❌ Regression | +1, -1 | invalid-inheritance on decorated class used as base |
pyrefly/lib/alt/solve.rs |
| pandas | ✅ Improvement | -4 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| core | ✅ Improvement | +1 | bad-return |
pyrefly/lib/alt/solve.rs |
| spack | ✅ Improvement | +179, -26 | missing-attribute on FunctionType (25 errors) |
is_some() |
| spark | ✅ Improvement | +1 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| django-modern-rest | ✅ Improvement | +1 | bad-return |
pyrefly/lib/alt/solve.rs |
| jax | ❌ Regression | +1 | False positive bad-specialization on class decorator |
pyrefly/lib/alt/solve.rs |
Detailed analysis
❌ Regression (2)
scikit-learn (+1, -1)
❌ invalid-inheritance on decorated class used as base: False positive. sklearn's
deprecateddecorator returns the original class at runtime. Theinvalid-inheritanceerror arises because pyrefly now processes class decorators and infers the return type ofdeprecated.__call__as a generic callable((*args, **kwargs) -> Unknown) | Unknownrather than preserving the class type. This is a limitation of the new decorator handling — it doesn't recognize thatdeprecatedreturns the same class. Pyright also flags this, but mypy does not. ❌ removed missing-attribute in pytest.raises block: The removed error was technically correct —PassiveAggressiveRegressordoesn't have atransformattribute. However, the code is insidepytest.raises(AttributeError), deliberately testing that the attribute doesn't exist. The removal is likely a side effect of the new decorator handling (sincePassiveAggressiveRegressoris decorated with@deprecated). This is a minor regression in that a real missing attribute is no longer detected, though the practical impact is low since the test expects the error.Overall: The analysis is factually accurate. The
invalid-inheritanceerror is indeed a false positive — sklearn'sdeprecateddecorator returns the original class (it wraps__new__and__init__but the class itself remains usable as a base class). The error arises because pyrefly's new decorator handling infers the return type ofdeprecated.__call__as((*args, **kwargs) -> Unknown) | Unknownrather than preserving the class type. The analysis correctly notes that pyright also flags this while mypy does not. The analysis of the removedmissing-attributeerror is also correct — the code at line 298 (reg.transform(X)) is inside apytest.raises(AttributeError)block, deliberately testing that the attribute doesn't exist. The removal is indeed likely a side effect of the decorator handling changing howPassiveAggressiveRegressor(which is decorated with@deprecated) is typed. The overall assessment that the new false positive outweighs the removed error is reasonable.Attribution: The new
invalid-inheritanceerror is caused by the changes inpyrefly/lib/alt/solve.rsin theBinding::ClassDefbranch. The PR now applies class decorators to the class type. When@deprecated('qwerty')is applied toMockClass1, the decorator's return type is inferred as a callable (not a class type). Theuntype_optcheck at the end of the decorator loop tries to determine if the result is still a usable type form — if it can't determine this, the decorated type replaces the class definition. WhenMockClass5tries to inherit fromMockClass1, the type is((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown(the return type of thedeprecateddecorator), which is not a valid base class. The removedmissing-attributeerror is likely also related to the decorator handling changes —PassiveAggressiveRegressoris decorated with@deprecated, and the new decorator handling may change how the class type is resolved, potentially affecting attribute resolution differently.
jax (+1)
❌ False positive bad-specialization on class decorator: The PR's new class decorator handling now flows the class through
@jax.tree_util.register_static, which triggers aHashablebound check on the dataclassP. Since@dataclasswith default settings (eq=True, frozen=False) sets__hash__ = None, instances ofPare not hashable, giving pyrefly's check some basis. However,register_staticis a class decorator — it receives the class object as its argument, and class objects (instances oftype) are always hashable. Pyrefly is incorrectly checking instance-level hashability of the type parameterHrather than recognizing that the actual argument to the decorator is the class object itself. This is pyrefly-only (neither mypy nor pyright flag it), the decorator works correctly at runtime, and this is a false positive introduced by the new feature.Overall: This is a borderline case. The
@dataclassdecorator withoutfrozen=True(with defaulteq=True) does set__hash__ = Noneon instances, making them unhashable. Ifregister_static's type signature has a type parameterHbounded byHashable, pyrefly is checking whether the typePsatisfiesHashableat the instance level. Since@dataclasswith default settings sets__hash__ = None, instances ofPare indeed not hashable, so pyrefly's check has some basis. However, this is pyrefly-only — neither mypy nor pyright flag it. The most likely explanation is thatjax.tree_util.register_staticis a class decorator that receives the class object as its argument, and class objects are always hashable (they inherit__hash__fromtype). Pyrefly's new class decorator handling is incorrectly checking instance-level hashability of the type parameter rather than recognizing that the decorator argument is the class object itself. Given that this is a well-tested JAX project and the decorator works correctly at runtime, this is a false positive introduced by the new decorator analysis feature.Attribution: The PR changes in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now apply class decorators to the class value instead of ignoring them. Previously, the code had a TODO comment saying 'we don't actually support any type-level analysis of class decorators.' Now it iterates through decorators and calls them. This new decorator application is what causes@jax.tree_util.register_staticto be analyzed as a call on classP, triggering thebad-specializationerror when checking ifPsatisfies theHashablebound ofregister_static's type variable.
✅ Improvement (6)
pandera (-2)
Both removed errors were false positives caused by pyrefly inferring the element type of
PYSPARK_PANDAS_UNSUPPORTEDtoo narrowly. The set contains various pandera engine dtype classes, and the code conditionally adds more dtype classes via.add()and.update(). All these classes share common base types. The PR's new class decorator handling likely improved type resolution for these decorated engine classes, allowing pyrefly to infer a broader (and correct) element type for the set. Removing these false positives is an improvement. Attribution: The change inpyrefly/lib/alt/solve.rsin theBinding::ClassDefarm now applies class decorators to the class value binding while preserving the original class object when the decorator returns a usable type form (theuntype_optcheck at the end). Previously, decorators were ignored entirely for class defs. The numpy/pandas engine dtype classes (likeTimedelta64,Float128,Complex256,Complex128, etc.) are likely decorated with engine registration decorators. The new decorator handling changes how these classes' types are resolved, which in turn affects the inferred element type of thePYSPARK_PANDAS_UNSUPPORTEDset, making it broad enough to accept the additional types.
pandas (-4)
All 4 removed errors were false positives. The frame.py errors (lines 637, 643) involve the untyped
dataparameter whose type pyrefly infers asUnknown. By the time execution reaches the scalar code path (the finalelsebranch),datahas been narrowed at runtime through isinstance checks against DataFrame, BlockManager, dict, MaskedArray, ndarray/Series/Index/ExtensionArray, and the is_list_like check. However, pyrefly cannot fully narrow theUnknowntype through this chain of negative checks, leaving it aslist[Unknown] | Unknown, which doesn't match the scalar type expected byconstruct_1d_arraylike_from_scalarandconstruct_2d_arraylike_from_scalar. At runtime,datais guaranteed to be a scalar at these points. The test file errors (lines 3165, 3167) flagset[str]being passed asindexandcolumnsparameters toDataFrame.__init__. Thesettype is indeed not part of the accepted union type (ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray | range | None). However, these test lines are intentionally passing invalid types to verify that the constructor raisesValueError(as seen in the__init__code at lines 497-499:if isinstance(index, set): raise ValueError(...)). These are deliberate error-path tests, not bugs. Removing all 4 errors reduces noise without losing real bug detection. Attribution: The changes inpyrefly/lib/alt/solve.rsto theBinding::ClassDefbranch and the newExpr::Namebranch for type form resolution improved type inference, which likely resolved theUnknowntype propagation that caused the false positives in frame.py. Theuntype_optaddition forType::KwCallmay also have contributed to better type resolution.
core (+1)
This is a false positive introduced by the PR's new class decorator handling. The
SelectedEntitiesclass inservice.py(line 244) isclass SelectedEntities(target_helpers.SelectedEntities)decorated with@deprecated_class(...). The functionasync_extract_referenced_entity_ids(line 456-464) has return typeSelectedEntities(the local subclass) and returnsSelectedEntities(**dataclasses.asdict(selected))— constructing an instance of the local class. This is perfectly valid code. Thedeprecated_classdecorator is a Home Assistant utility that wraps the class for deprecation warnings but still returns a compatible class. Pyrefly's new decorator application logic is incorrectly resolving the type of the constructedSelectedEntities(...)call tohomeassistant.helpers.target.SelectedEntities(the parent) instead ofhomeassistant.helpers.service.SelectedEntities(the actual local class being constructed). Neither mypy nor pyright flag this. Attribution: The PR adds class decorator support inpyrefly/lib/alt/solve.rs. TheSelectedEntitiesclass at line 244 is decorated with@deprecated_class(...). Before this PR, class decorators were ignored (the class type was preserved as-is). Now, pyrefly applies the decorator to the class value binding. Thedeprecated_classdecorator likely returns a wrapper that pyrefly resolves totarget_helpers.SelectedEntities(the parent class) rather thanhomeassistant.helpers.service.SelectedEntities(the decorated subclass). The key logic is in the new code block inBinding::ClassDefhandling: after applying the decorator, ifuntype_optsucceeds (meaning the result is still a usable type form), it falls back toself.heap.mk_class_def(cls.dupe())— but the runtime value binding (ty) has been changed to the decorator's return type. This causes pyrefly to see the class's runtime type astarget_helpers.SelectedEntitiesinstead ofservice.SelectedEntities, leading to the type mismatch on the return statement.
spack (+179, -26)
❌ missing-attribute on FunctionType (25 errors): Classes decorated with unresolvable decorators are retyped as FunctionType, so attribute access like
ArchSpec.default_arch()fails. False positives. ❌ not-a-type (48 errors): Decorated classes used as type annotations fail because pyrefly sees them as function types, not class types. False positives. ❌ unexpected-keyword (52 errors): Constructor calls to decorated classes fail because pyrefly sees a function signature instead of init. False positives. ❌ bad-argument-count (28 errors): Same root cause — constructor calls mismatch because the class is typed as a function. False positives. ❌ invalid-inheritance (12 errors): Inheriting from decorated classes fails because pyrefly sees them as functions. False positives. ❌ missing-argument (5 errors): Cascade from decorator mishandling. False positives. ❌ invalid-argument (4 errors): Passing decorated class where type[X] expected fails. False positives. ❌ missing-attribute on tuple (3 errors): ArchSpec.default_arch() returns wrong type due to class being mistyped. False positives. ❌ unsupported-operation (2 errors): Subscripting decorated class fails. False positives. ❌ Removed errors (26 total): Mix of lost real error detection and removed false positives, but primarily a side effect of the class type corruption — pyrefly can no longer reason about these classes at all.Overall: This is a clear regression. The PR's class decorator support mishandles decorators whose return types are Unknown/unresolvable, causing 179 false positive errors across the spack project. The decorator
@lang.lazy_lexicographic_orderingreturns the class itself at runtime, but pyrefly now types the class as((realf: Unknown) -> Unknown) | Unknown, cascading into missing-attribute, not-a-type, invalid-inheritance, unexpected-keyword, and other errors. None of these are flagged by mypy or pyright.
Per-category reasoning:
- missing-attribute on FunctionType (25 errors): Classes decorated with unresolvable decorators are retyped as FunctionType, so attribute access like
ArchSpec.default_arch()fails. False positives. - not-a-type (48 errors): Decorated classes used as type annotations fail because pyrefly sees them as function types, not class types. False positives.
- unexpected-keyword (52 errors): Constructor calls to decorated classes fail because pyrefly sees a function signature instead of init. False positives.
- bad-argument-count (28 errors): Same root cause — constructor calls mismatch because the class is typed as a function. False positives.
- invalid-inheritance (12 errors): Inheriting from decorated classes fails because pyrefly sees them as functions. False positives.
- missing-argument (5 errors): Cascade from decorator mishandling. False positives.
- invalid-argument (4 errors): Passing decorated class where type[X] expected fails. False positives.
- missing-attribute on tuple (3 errors): ArchSpec.default_arch() returns wrong type due to class being mistyped. False positives.
- unsupported-operation (2 errors): Subscripting decorated class fails. False positives.
- Removed errors (26 total): Mix of lost real error detection and removed false positives, but primarily a side effect of the class type corruption — pyrefly can no longer reason about these classes at all.
Attribution: The change to
Binding::ClassDefhandling inpyrefly/lib/alt/solve.rs(around line 4801-4849) now applies class decorators by calling them and using the return type. When a decorator likelazy_lexicographic_orderingreturns an unresolvable type ((realf: Unknown) -> Unknown), theuntype_optcheck on line 4840 tries to recover by restoring the original class, but the conditionself.untype_opt(ty.clone(), range, errors).[is_some()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs)apparently doesn't trigger correctly for theUnknownunion case, causing the class to be rebound to the decorator's return type instead of preserving the class definition.
spark (+1)
This is a genuine type error. The typeshed stub for
unittest.skipdeclaresdef skip(reason: str) -> Callable[[_FT], _FT]. Using@unittest.skipwithout parentheses passes the class as thereasonparameter, which istype[SkipClassTests], notstr. The correct usage would be@unittest.skip('reason')with parentheses. While CPython's runtime implementation happens to handle this case gracefully (in modern Python versions, it checks ifreasonis callable and treats it as the decorated object directly), the type stubs don't reflect this behavior. Pyright also flags this error, confirming it's a legitimate type mismatch per the stubs. This is pyrefly correctly catching a real type inconsistency now that it supports class decorator analysis. Attribution: The change inpyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now applies class decorators by calling them with the class type as an argument. Previously, pyrefly skipped decorator analysis for classes entirely (the old code had a TODO comment saying 'we don't actually support any type-level analysis of class decorators'). Now pyrefly passes the class type through the decorator's call signature, which correctly detects thatunittest.skipexpectsstrbut receivestype[SkipClassTests].
django-modern-rest (+1)
This is a correct error that pyrefly is now catching. The
@wraps(func, updated=())decorator onSSEController(line 367) transforms the class's type fromtype[SSEController](which is assignable totype[Controller[_SerializerT]]) to_Wrapped[...](which is not). Pyright also flags this — evidenced by the# pyright: ignore[reportReturnType]suppression comment on line 423. The function_build_controllerdeclares it returnstype[Controller[_SerializerT]](line 363), but after the@wrapsdecorator is applied, the type ofSSEControlleris_Wrapped[...], which is not assignable totype[Controller[_SerializerT]]. This is a genuine type-level mismatch. The code works at runtime becausewrapsreturns the original class object, but from a static typing perspective, the types don't align. The fact that the project already suppresses this error for pyright confirms it's a known type issue in the code, not a false positive from pyrefly. Attribution: The change inpyrefly/lib/alt/solve.rsin theBinding::ClassDefbranch now applies class decorators to the class type. Previously, pyrefly ignored class decorators entirely (the old code had a TODO comment about this). Now it processes each decorator by calling it with the class type and using the return type. ForSSEController, the@wraps(func, updated=())decorator is applied, andwrapsreturns a_Wrapped[...]type rather thantype[Controller[_SerializerT]]. The new code has a check (untype_opt) that tries to preserve the original class type if the decorator still returns a usable type form, but_Wrappedis not a type form, so the decorator's return type (_Wrapped[...]) becomes the inferred type ofSSEController, causing thebad-returnerror.
Suggested fixes
Summary: The PR's new class decorator handling in Binding::ClassDef corrupts class types when decorators return Unknown/unresolvable types, causing massive false positives in scikit-learn (1 error) and jax (1 error), plus 179 errors in spack (classified as improvement but actually regression).
1. In the Binding::ClassDef match arm in solve.rs (around line 4798-4849), add a guard to preserve the original class type when the decorator call returns an Unknown, union-with-Unknown, or callable type that is not itself a valid class type. Currently, the untype_opt check only restores the class when the result IS a valid type form. The logic should be inverted/expanded: if the decorator result is NOT a class type (Type::ClassDef or similar), fall back to preserving the original class. Specifically, after ty = self.call_infer(...), add a check like: if ty.is_unknown() || ty.is_callable_but_not_class() || ty.is_union_containing_unknown() { ty = self.heap.mk_class_def(cls.dupe()); continue; }. This ensures that decorators whose return types cannot be resolved to a concrete class type (like @deprecated, @lazy_lexicographic_ordering, @jax.tree_util.register_static) don't corrupt the class binding.
Files:
pyrefly/lib/alt/solve.rsConfidence: high Affected projects: scikit-learn, jax, spack Fixes:invalid-inheritance,bad-specialization,missing-attribute,not-a-type,unexpected-keyword,bad-argument-count,missing-argument,invalid-argument,unsupported-operationThe root cause is the same across all regression projects: when a class decorator's return type is Unknown, a callable, or a union containing Unknown (e.g.,((*args, **kwargs) -> Unknown) | Unknown), theuntype_optcheck on line ~4840 fails to recognize this as a type form, so it does NOT restore the original class. The decorated class then gets rebound to the decorator's return type (a function/Unknown), causing cascading errors: invalid-inheritance (scikit-learn), bad-specialization (jax), and 179 errors across multiple categories in spack. The fix should preserve the original class type whenever the decorator result is not itself a class type. This eliminates 1 invalid-inheritance in scikit-learn, 1 bad-specialization in jax, and 179 errors in spack.
2. More specifically, in the decorator loop in Binding::ClassDef (line ~4840), change the fallback condition from if self.untype_opt(ty.clone(), range, errors).is_some() { ty = self.heap.mk_class_def(cls.dupe()); } to instead check whether the result is a class-like type: if !ty.is_class_def() && !ty.is_class_type() { ty = self.heap.mk_class_def(cls.dupe()); }. The current logic says 'if the result CAN be untyped to a type form, restore the class' — but this is backwards. It should say 'if the result is NOT a class type, restore the class, because a decorator that transforms a class into a non-class type is likely not correctly modeled'. The test case test_class_decorator_rebinds_class_value (where @remote returns ActorHandle[T]) would need special handling — only preserve the class when the result looks like Unknown/callable, not when it's a concrete non-class type like ActorHandle.
Files:
pyrefly/lib/alt/solve.rsConfidence: medium Affected projects: scikit-learn, jax, spack Fixes:invalid-inheritance,bad-specialization,missing-attribute,not-a-type,unexpected-keyword,bad-argument-countTheuntype_optcheck is the wrong heuristic. It checks if the decorator result is a valid type annotation, but what we really want to know is whether the decorator preserved the class identity or transformed it into something else. For decorators like@deprecatedthat return the same class at runtime but whose return type annotation isUnknownor a generic callable, we should preserve the class. For decorators like@remotein the test case that genuinely transform the class into a different type (ActorHandle), we should use the new type. A better heuristic: preserve the class when the result contains Unknown or is a bare callable type, but use the decorator result when it's a concrete non-callable type.
Was this helpful? React with 👍 or 👎
Classification by primer-classifier (8 LLM)
Overall: This is a clear regression. The PR's class decorator support mishandles decorators whose return types are Unknown/unresolvable, causing 179 false positive errors across the spack project. The decorator @lang.lazy_lexicographic_ordering returns the class itself at runtime, but pyrefly now types the class as ((realf: Unknown) -> Unknown) | Unknown, cascading into missing-attribute, not-a-type, invalid-inheritance, unexpected-keyword, and other errors. None of these are flagged by mypy or pyright.
@migeed-z why does this get classified as "improvement" lol
Diff from mypy_primer, showing the effect of this PR on open source code:
jax (https://github.com/google/jax)
+ ERROR jax/experimental/array_serialization/serialization_test.py:961:5-35: `UserPytreeAPITest.test_custom_node_registration.P` is not assignable to upper bound `Hashable` of type variable `H` [bad-specialization]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- ERROR sklearn/linear_model/tests/test_passive_aggressive.py:298:9-22: Object of class `PassiveAggressiveRegressor` has no attribute `transform` [missing-attribute]
+ ERROR sklearn/utils/tests/test_deprecation.py:40:18-28: Invalid base class: `((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
pandera (https://github.com/pandera-dev/pandera)
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:69:36-60: Argument `type[Timedelta64]` is not assignable to parameter `element` with type `type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]` in function `set.add` [bad-argument-type]
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:73:9-57: Argument `set[type[Complex256] | type[Float128]]` is not assignable to parameter `*s` with type `Iterable[type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]]` in function `set.update` [bad-argument-type]
core (https://github.com/home-assistant/core)
+ ERROR homeassistant/helpers/service.py:464:12-60: Returned type `homeassistant.helpers.target.SelectedEntities` is not assignable to declared return type `homeassistant.helpers.service.SelectedEntities` [bad-return]
spack (https://github.com/spack/spack)
- ERROR lib/spack/spack/audit.py:1168:52-91: Argument `Unknown | None` is not assignable to parameter `other` with type `ArchSpec` in function `spack.spec.ArchSpec.satisfies` [bad-argument-type]
+ ERROR lib/spack/spack/audit.py:1158:29-61: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:45:12-44: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:56:34-66: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/core.py:154:33-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:177:66-90: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:197:28-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/builder.py:222:16-55: Returned type `bool | str | tuple[bool | str, ...]` is not assignable to declared return type `str` [bad-return]
- ERROR lib/spack/spack/cmd/__init__.py:519:34-44: Argument `tuple[Literal[''], None]` is not assignable to parameter `object` with type `tuple[Unknown, Spec]` in function `list.append` [bad-argument-type]
- ERROR lib/spack/spack/cmd/arch.py:111:23-41: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/cmd/arch.py:113:23-42: Object of class `NoneType` has no attribute `generic` [missing-attribute]
+ ERROR lib/spack/spack/compilers/config.py:224:16-35: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/concretize.py:275:68-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1012:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1057:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1874:30-55: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:448:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:462:32-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:545:21-53: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/graph.py:546:21-28: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/graph.py:547:21-29: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/main.py:828:35-67: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:34:20-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:56:37-45: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/platforms/_platform.py:42:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:54:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:57:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:44-69: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:75:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:78:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:25:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/test.py:26:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/solver/asp.py:1640:39-43: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/solver/asp.py:3503:39-41: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/solver/asp.py:3523:35-67: Object of class `FunctionType` has no attribute `from_concretizer` [missing-attribute]
+ ERROR lib/spack/spack/solver/requirements.py:318:35-60: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:269:47-55: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:271:30-44: Object of class `tuple` has no attribute `platform` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:46-54: Object of class `tuple` has no attribute `os` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:271:56-68: Object of class `tuple` has no attribute `target` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:293:32-34: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:305:34-42: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:344:21-58: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:382:26-67: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:398:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:420:34-42: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:441:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:455:28-47: Object of class `FunctionType` has no attribute `ANY_TARGET` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:460:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:564:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:1009:9-18: Class member `FlagMap._cmp_iter` overrides parent class `HashableMap` in an inconsistent manner [bad-override]
+ ERROR lib/spack/spack/spec.py:641:32-53: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:784:81-95: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:790:13-22: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:791:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:792:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:793:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:794:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:795:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:798:34-48: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:868:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:870:30-872:10: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:871:13-19: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:31-35: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:49-56: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:871:71-79: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:930:15-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:930:15-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:1090:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:1494:13-26: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:1495:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1496:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1497:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1565:26-47: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1750:31-81: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:1750:32-38: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1750:47-51: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1750:58-65: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1750:69-77: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1855:35-70: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:2011:13-28: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:2012:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2013:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2014:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2015:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2016:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2664:37-54: Object of class `FunctionType` has no attribute `override` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3645:32-88: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3697:9-33: Object of class `FlagMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3711:17-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3713:9-27: Object of class `VariantMap` has no attribute `spec` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:4455:30-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:4462:31-45: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:5160:9-20: Class member `VariantMap.__setitem__` overrides parent class `HashableMap` in an inconsistent manner [bad-param-name-override]
+ ERROR lib/spack/spack/spec.py:5156:18-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:5156:18-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:5162:34-49: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:5408:33-51: Object of class `FunctionType` has no attribute `from_dict` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5447:17-53: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5419:39-69: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5839:18-33: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/test/architecture.py:78:70-75: Expected 1 positional argument, got 2 [bad-argument-count]
- ERROR lib/spack/spack/test/concretization/core.py:1287:24-56: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1605:44-74: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `set.__init__` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1618:20-52: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `set.__init__` [bad-argument-type]
- ERROR lib/spack/spack/test/config.py:409:30-48: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:839:25-40: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:839:42-60: Object of class `NoneType` has no attribute `version` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:173:9-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:210:12-57: `in` is not supported between `str` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:213:12-61: `not in` is not supported between `str` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:236:19-74: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:386:12-72: `not in` is not supported between `str` and `bool` [not-iterable]
+ ERROR lib/spack/spack/test/spec_semantics.py:2115:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2115:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2115:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2116:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2116:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2116:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2124:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2124:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2124:53-61: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2416:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2416:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2416:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2416:67-71: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2417:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2417:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2417:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2514:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2514:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/variant.py:345:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:348:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:351:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
- ERROR lib/spack/spack/traverse.py:236:49-53: Argument `None` is not assignable to parameter `parent` with type `Spec` in function `spack.spec.DependencySpec.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/traverse.py:37:12-37: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:236:41-86: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/traverse.py:236:42-48: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:55-59: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:63-70: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:74-82: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:460:16-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:475:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:665:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/util/path.py:76:34-52: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/variant.py:511:55-62: Argument `tuple[None]` is not assignable to parameter `value` with type `tuple[bool | str, ...]` in function `VariantValue.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/variant.py:159:41-53: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:216:32-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:218:19-51: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/variant.py:222:58-70: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:224:48-57: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:312:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:316:36-40: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:316:56-65: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:316:77-85: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:322:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:322:74-83: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:325:49-53: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:325:65-74: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:330:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:332:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:332:67-76: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:336:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:336:69-78: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:340:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:340:62-71: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:344:13-17: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:346:13-22: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:347:13-21: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:351:64-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:354:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:356:68-76: Unexpected keyword argument `concrete` [unexpected-keyword]
... (truncated 16 lines) ...
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/testing/tests/test_skip_class.py:20:1-15: Argument `type[SkipClassTests]` is not assignable to parameter `reason` with type `str` in function `unittest.case.skip` [bad-argument-type]
Primer Diff Classification
❌ 3 regression(s) | ✅ 3 improvement(s) | 6 project(s) total | +190, -29 errors
3 regression(s) across jax, scikit-learn, core. error kinds: bad-specialization, invalid-inheritance on decorated class, removed missing-attribute on PassiveAggressiveRegressor. 3 improvement(s) across pandera, spack, spark.
| Project | Verdict | Changes | Error Kinds | Root Cause |
|---|---|---|---|---|
| jax | ❌ Regression | +1 | bad-specialization |
pyrefly/lib/alt/solve.rs |
| scikit-learn | ❌ Regression | +1, -1 | invalid-inheritance on decorated class |
pyrefly/lib/alt/solve.rs |
| pandera | ✅ Improvement | -2 | bad-argument-type |
untype_opt() |
| core | ❌ Regression | +1 | bad-return |
pyrefly/lib/alt/solve.rs |
| spack | ✅ Improvement | +186, -26 | missing-attribute on FunctionType |
pyrefly/lib/alt/solve.rs |
| spark | ✅ Improvement | +1 | class decorator argument type mismatch |
as_call_target_or_error() |
Detailed analysis
❌ Regression (3)
jax (+1)
This is a false positive introduced by the new class decorator support. The error arises because pyrefly now processes
@jax.tree_util.register_staticas a decorator call and infers aHashableupper bound on its type parameter. While@dataclasstechnically makes__hash__None (making the class not Hashable per the protocol), neither mypy nor pyright flag this. The code works correctly at runtime. This is likely either an overly strict interpretation of the decorator's type signature or an issue with how pyrefly resolves the JAX stub types. Attribution: The change toBinding::ClassDefhandling inpyrefly/lib/alt/solve.rsnow processes class decorators by calling them on the class type. Previously decorators were ignored (the TODO comment). This causes@jax.tree_util.register_staticto be evaluated as a call on classP, and pyrefly infers aHashablebound on the type variable thatPdoesn't satisfy (due to@dataclassmaking it unhashable).
scikit-learn (+1, -1)
❌ invalid-inheritance on decorated class: The
deprecateddecorator returns the original class at runtime, but pyrefly's new decorator analysis infers the return type as a callable/Unknown union, causing a false positiveinvalid-inheritanceerror when another class tries to inherit from the decorated class. Pyright also flags this, but mypy does not. The code works correctly at runtime. ❌ removed missing-attribute on PassiveAggressiveRegressor: The removed error was technically correct —PassiveAggressiveRegressordoesn't havetransform. However, the code is inside awith pytest.raises(AttributeError):block, meaning the test intentionally expects this error at runtime. The removal is likely caused byPassiveAggressiveRegressoralso being decorated with@deprecated, so the PR's new decorator handling changed how its type is resolved to Unknown, losing attribute checking capability. This is a minor regression in type checking coverage, though the practical impact is low since the test was explicitly checking for the missing attribute.Overall: The new
invalid-inheritanceerror is a false positive. Thedeprecateddecorator from sklearn returns the original class (it only modifies__new__), but pyrefly's new decorator handling infers the return type as a generic callable rather than recognizing it still returns the class. Thedeprecatedclass's__call__method likely lacks precise return type annotations, causing pyrefly to infer((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknowninstead of the original class type. This is a regression in pyrefly's handling of class decorators that return the decorated class. The removed error was a true positive in the sense thatPassiveAggressiveRegressorgenuinely doesn't have atransformattribute. However, the code is inside awith pytest.raises(AttributeError):block, meaning the test intentionally exercises this missing attribute. The removal is likely a side effect of the same decorator handling change — sincePassiveAggressiveRegressoris also decorated with@deprecated, pyrefly now infers its type as Unknown, losing attribute checking capability. Net effect: one new false positive added, one true positive removed — both stem from the same regression in decorator handling.Attribution: The PR changes
Binding::ClassDefhandling inpyrefly/lib/alt/solve.rs. Previously, class decorators were ignored (TODO: analyze the class decorators). Now, the code iterates through decorators, calls them, and uses the return type. Theuntype_optcheck at the end tries to determine if the result is still a usable type form — if so, it preserves the original class definition. Forsklearn.utils.deprecation.deprecated, the decorator likely has a return type annotation of a callable/function type (or no annotation, yieldingUnknown), so pyrefly infersMockClass1as((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknowninstead of the original class. WhenMockClass5tries to inherit fromMockClass1, pyrefly sees a non-class type and reportsinvalid-inheritance. The removedmissing-attributeerror may be related toPassiveAggressiveRegressoralso being decorated with@deprecated, and the new decorator handling changing how its type is resolved.
core (+1)
This is a false positive. The local class
service.SelectedEntitiesinherits fromtarget.SelectedEntitiesand is decorated with@deprecated_class(...). The constructor callSelectedEntities(...)at line 464 creates aservice.SelectedEntitiesinstance, which matches the declared return type. The PR's new class decorator handling is incorrectly resolving the class binding, causing pyrefly to think the nameSelectedEntitiesrefers to the parent class rather than the local subclass. Attribution: The change toBinding::ClassDefhandling inpyrefly/lib/alt/solve.rsnow applies class decorators to the runtime class-value binding. For@deprecated_class(...)(a parameterized decorator), the new logic appears to incorrectly resolve the decorated class nameSelectedEntitiesto the parent typetarget.SelectedEntitiesinstead of preserving the local subclassservice.SelectedEntities. Theuntype_optcheck at the end of the new decorator loop may be failing to recognize the decorated result as a valid type form, or the decorator call inference is producing the wrong type.
✅ Improvement (3)
pandera (-2)
Both removed errors were false positives caused by pyrefly inferring an overly narrow element type for the
PYSPARK_PANDAS_UNSUPPORTEDset. The set is initialized with a literal containing specific dtype classes fromnumpy_engineandpandas_engine(lines 46-64), and pyrefly inferred the set's element type as the exact union of those specifictype[...]entries. When.add(numpy_engine.Timedelta64)is called on line 69 and.update({numpy_engine.Float128, numpy_engine.Complex256})is called on line 72-73, pyrefly rejected these becauseTimedelta64,Float128, andComplex256were not part of the inferred union type. In reality, all these classes are validtypeobjects from the pandera engine modules and are perfectly valid elements for this set. The fix likely improved how pyrefly handles set element type inference - either by widening the inferred type to a common base class (these are all pandera engine dtype classes) or by being more permissive when adding elements to sets whose type was inferred from a literal. The specific mechanism (whether class decorator support or set type inference improvement) would depend on the actual PR changes. Attribution: The changes toBinding::ClassDefhandling inpyrefly/lib/alt/solve.rsnow process class decorators. The pandera engine dtype classes are likely decorated (e.g., with@Engine.register_dtype), and the new decorator support changes how pyrefly resolves their types. Additionally, the newType::KwCallcase inuntype_opt()and theExpr::Namehandling in type form resolution may contribute to better type resolution for these decorated classes, making them compatible with the set's inferred element type.
spack (+186, -26)
❌ missing-attribute on FunctionType: Classes like ArchSpec are being incorrectly resolved as FunctionType after decorator application, causing false missing-attribute errors for valid classmethods like
default_arch()❌ not-a-type errors: Types like((realf: Unknown) -> Unknown) | Unknownappearing where class types should be — decorator handling is corrupting class type resolution ❌ unexpected-keyword errors: Cascade from corrupted class types — when a class is resolved as a function type, its constructor signature is wrong, causing false keyword argument errors ❌ bad-argument-count errors: Cascade from corrupted class types — constructor calls get wrong argument count expectations ❌ invalid-inheritance errors: Base classes resolved as((realf: Unknown) -> Unknown) | Unknowninstead of class types, causing false invalid-inheritance errors ❌ missing-argument/invalid-argument/unsupported-operation: All cascade errors from the same root cause — decorator handling corrupting class type resolution ➖ removed errors: Mixed bag — some were false positives being correctly removed (e.g., missing-attribute on FlagMap.spec), some were real bugs no longer caught (e.g., missing-attribute on NoneType). Net effect of removals is roughly neutral.Overall: The PR introduces 186 new errors (all pyrefly-only) while removing only 26. The new errors are overwhelmingly false positives caused by the decorator handling change corrupting class types — classes like
ArchSpecare being resolved asFunctionType, causing cascadingmissing-attribute,unexpected-keyword,bad-argument-count,not-a-type, andinvalid-inheritanceerrors. The(realf: Unknown) -> Unknowntype appearing in error messages is a clear sign of type inference failure. This is a net regression.
Per-category reasoning:
- missing-attribute on FunctionType: Classes like ArchSpec are being incorrectly resolved as FunctionType after decorator application, causing false missing-attribute errors for valid classmethods like
default_arch() - not-a-type errors: Types like
((realf: Unknown) -> Unknown) | Unknownappearing where class types should be — decorator handling is corrupting class type resolution - unexpected-keyword errors: Cascade from corrupted class types — when a class is resolved as a function type, its constructor signature is wrong, causing false keyword argument errors
- bad-argument-count errors: Cascade from corrupted class types — constructor calls get wrong argument count expectations
- invalid-inheritance errors: Base classes resolved as
((realf: Unknown) -> Unknown) | Unknowninstead of class types, causing false invalid-inheritance errors - missing-argument/invalid-argument/unsupported-operation: All cascade errors from the same root cause — decorator handling corrupting class type resolution
- removed errors: Mixed bag — some were false positives being correctly removed (e.g., missing-attribute on FlagMap.spec), some were real bugs no longer caught (e.g., missing-attribute on NoneType). Net effect of removals is roughly neutral.
Attribution: The change in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now applies decorators to class definitions. Theuntype_optcheck (line ~4895) is supposed to preserve the original class type when the decorator returns a usable type form, but it appears to be failing for many spack patterns, causing classes to be resolved asFunctionTypeor callable types instead of their actual class types. The newExpr::Namehandling insolve.rs(line ~5675) also contributes by changing how names are resolved in type form contexts.
spark (+1)
✅ class decorator argument type mismatch: The
@unittest.skipdecorator without parentheses passes the class as thereason: strparameter. This is a genuine type error per the typeshed stubs, also flagged by pyright. The PR's new class decorator analysis correctly identifies this.Overall: This is a genuine type error that pyright also catches. The typeshed signature for
unittest.skipisdef skip(reason: str) -> Callable[[_FT], _FT]. Using@unittest.skipwithout parentheses passes the class as thereasonparameter, which istype[SkipClassTests], notstr. While CPython handles this at runtime via duck-typing (checking ifreasonis callable), the static type signature doesn't reflect this. Pyrefly is now correctly analyzing class decorator applications per the PR's changes, and this error is consistent with pyright's behavior. This is an improvement — pyrefly is catching a real type-level mismatch that the code relies on an undocumented runtime behavior to work around.Attribution: The change in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now applies class decorators to the class type. Previously, pyrefly had a TODO comment saying 'we don't actually support any type-level analysis of class decorators.' The new code callsself.[as_call_target_or_error()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs)andself.[call_infer()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs)for each decorator, which means@unittest.skipis now checked as a call with the class as an argument. Sinceunittest.skipexpectsstr, this produces thebad-argument-typeerror.
Suggested fixes
Summary: The new class decorator handling in Binding::ClassDef corrupts class types when decorators don't return a recognizable type form, causing cascading false positives across jax, scikit-learn, core, and spack.
1. In the Binding::ClassDef match arm in pyrefly/lib/alt/solve.rs (~line 4880), the untype_opt check is inverted in its logic. Currently, when untype_opt returns Some (meaning the decorator result IS a valid type form, like a class), it discards the decorator result and restores the original class. When untype_opt returns None (meaning the result is NOT a valid type form, e.g. a callable/Unknown), it keeps the corrupted type. The fix should be: when the decorator's return type is not a recognizable type form (i.e., untype_opt returns None), fall back to preserving the original class definition instead of using the corrupted type. Change the condition from if self.untype_opt(ty.clone(), range, errors).[is_some()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs) { ty = self.heap.mk_class_def(cls.dupe()); } to if self.untype_opt(ty.clone(), range, errors).[is_none()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs) { ty = self.heap.mk_class_def(cls.dupe()); }. This way, decorators that return a valid type form (like ActorHandle[T] in the test case) will rebind the class, while decorators whose return type can't be resolved to a type form (like deprecated, register_static, deprecated_class) will preserve the original class type.
Files:
pyrefly/lib/alt/solve.rsConfidence: high Affected projects: jax, scikit-learn, core, spack Fixes:invalid-inheritance,bad-argument-type,missing-attribute,not-a-type,unexpected-keyword,bad-argument-count,missing-argument,invalid-argument,unsupported-operationThe current logic says: 'if the decorator result CAN be untyped to a valid type, then restore the original class'. This is backwards. The intent (based on the test casetest_class_decorator_rebinds_class_value) is that decorators likeremotethat return a different type (ActorHandle[T]) should rebind the class. But decorators likedeprecatedthat return the same class (or an unresolvable type) should preserve the original class. Theuntype_optcheck should be: 'if the result is NOT a valid type form, preserve the original class'. Currentlydeprecatedreturns something like((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown, which failsuntype_opt(returns None), so the corrupted type is kept. Flipping the condition would make it fall back to the original class in this case. For theremotedecorator returningActorHandle[T],untype_optwould succeed (it's a valid class type), so the rebinding would be preserved — matching the test expectation. This single fix eliminates the invalid-inheritance errors in scikit-learn and core, the Hashable bound error in jax, and the massive cascade of 186 errors in spack (missing-attribute on FunctionType, not-a-type, unexpected-keyword, bad-argument-count, invalid-inheritance, etc.).
Was this helpful? React with 👍 or 👎
Classification by primer-classifier (6 LLM)
Diff from mypy_primer, showing the effect of this PR on open source code:
jax (https://github.com/google/jax)
+ ERROR jax/experimental/array_serialization/serialization_test.py:954:5-35: `UserPytreeAPITest.test_custom_node_registration.P` is not assignable to upper bound `Hashable` of type variable `H` [bad-specialization]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- ERROR sklearn/linear_model/tests/test_passive_aggressive.py:298:9-22: Object of class `PassiveAggressiveRegressor` has no attribute `transform` [missing-attribute]
+ ERROR sklearn/utils/tests/test_deprecation.py:40:18-28: Invalid base class: `((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
pandera (https://github.com/pandera-dev/pandera)
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:69:36-60: Argument `type[Timedelta64]` is not assignable to parameter `element` with type `type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]` in function `set.add` [bad-argument-type]
- ERROR tests/pyspark/test_schemas_on_pyspark_pandas.py:73:9-57: Argument `set[type[Complex256] | type[Float128]]` is not assignable to parameter `*s` with type `Iterable[type[Category] | type[pandera.engines.numpy_engine.Complex128@310:11-21] | type[pandera.engines.numpy_engine.Complex128@318:11-21] | type[Complex64] | type[Date] | type[Float16] | type[Interval] | type[Object] | type[Period] | type[Sparse] | type[UINT16] | type[UINT32] | type[UINT64] | type[UINT8] | type[UInt16] | type[UInt32] | type[UInt64] | type[UInt8]]` in function `set.update` [bad-argument-type]
core (https://github.com/home-assistant/core)
+ ERROR homeassistant/helpers/service.py:460:12-60: Returned type `homeassistant.helpers.target.SelectedEntities` is not assignable to declared return type `homeassistant.helpers.service.SelectedEntities` [bad-return]
spack (https://github.com/spack/spack)
- ERROR lib/spack/spack/audit.py:1169:52-91: Argument `Unknown | None` is not assignable to parameter `other` with type `ArchSpec` in function `spack.spec.ArchSpec.satisfies` [bad-argument-type]
+ ERROR lib/spack/spack/audit.py:1159:29-61: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:46:12-44: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/clingo.py:57:34-66: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/bootstrap/core.py:154:33-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:177:66-90: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/bootstrap/core.py:197:28-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/builder.py:222:16-55: Returned type `bool | str | tuple[bool | str, ...]` is not assignable to declared return type `str` [bad-return]
- ERROR lib/spack/spack/cmd/__init__.py:519:34-44: Argument `tuple[Literal[''], None]` is not assignable to parameter `object` with type `tuple[Unknown, Spec]` in function `list.append` [bad-argument-type]
- ERROR lib/spack/spack/cmd/arch.py:111:23-41: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/cmd/arch.py:113:23-42: Object of class `NoneType` has no attribute `generic` [missing-attribute]
+ ERROR lib/spack/spack/compilers/config.py:225:16-35: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/concretize.py:276:68-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1012:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1057:31-56: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/database.py:1874:30-55: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:449:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:463:32-57: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/graph.py:546:21-53: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/graph.py:547:21-28: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/graph.py:548:21-29: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/main.py:809:35-67: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/freebsd.py:11:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/linux_distro.py:20:19-34: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/mac_os.py:109:13-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/operating_systems/windows_os.py:28:17-32: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/package_base.py:987:50-68: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `path` with type `str` in function `spack.llnl.util.filesystem.recursive_mtime_greater_than` [bad-argument-type]
+ ERROR lib/spack/spack/platforms/__init__.py:34:20-28: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/__init__.py:56:37-45: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/platforms/_platform.py:42:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:54:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:57:20-45: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:63:44-69: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:75:20-45: Object of class `FunctionType` has no attribute `deprecated_names` [missing-attribute]
+ ERROR lib/spack/spack/platforms/_platform.py:78:20-41: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/darwin.py:13:14-22: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/freebsd.py:11:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/linux.py:11:13-21: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/test.py:13:12-20: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/platforms/test.py:25:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/test.py:26:96-97: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/platforms/windows.py:12:15-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/solver/asp.py:1637:39-43: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/solver/asp.py:3507:39-41: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/solver/asp.py:3527:35-67: Object of class `FunctionType` has no attribute `from_concretizer` [missing-attribute]
+ ERROR lib/spack/spack/solver/requirements.py:428:35-60: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:270:47-55: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:272:30-44: Object of class `tuple` has no attribute `platform` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:272:46-54: Object of class `tuple` has no attribute `os` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:272:56-68: Object of class `tuple` has no attribute `target` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:294:32-34: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:306:34-42: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:345:21-58: Object of class `FunctionType` has no attribute `reserved_oss` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:383:26-67: Object of class `FunctionType` has no attribute `reserved_targets` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:399:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:421:34-42: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:442:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:456:28-47: Object of class `FunctionType` has no attribute `ANY_TARGET` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:461:41-49: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:565:33-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:1009:9-18: Class member `FlagMap._cmp_iter` overrides parent class `HashableMap` in an inconsistent manner [bad-override]
+ ERROR lib/spack/spack/spec.py:642:32-53: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:785:81-95: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:791:13-22: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:792:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:793:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:794:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:795:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:796:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:799:34-48: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:869:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:871:30-873:10: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:872:13-19: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:872:31-35: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:872:49-56: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:872:71-79: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:931:15-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:931:15-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:1090:24-38: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:1494:13-26: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:1495:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1496:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1497:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1565:26-47: Object of class `FunctionType` has no attribute `default_arch` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:1750:31-81: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/spec.py:1750:32-38: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1750:47-51: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1750:58-65: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1750:69-77: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:1855:35-70: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:2011:13-28: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/spec.py:2012:13-20: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2013:13-21: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2014:13-19: Unexpected keyword argument `direct` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2015:13-24: Unexpected keyword argument `propagation` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2016:13-17: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/spec.py:2664:37-54: Object of class `FunctionType` has no attribute `override` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3645:32-88: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3697:9-33: Object of class `FlagMap` has no attribute `spec` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3711:17-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/spec.py:3713:9-27: Object of class `VariantMap` has no attribute `spec` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:4455:30-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/spec.py:4462:31-45: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/spec.py:5160:9-20: Class member `VariantMap.__setitem__` overrides parent class `HashableMap` in an inconsistent manner [bad-override-param-name]
+ ERROR lib/spack/spack/spec.py:5156:18-56: Invalid base class: `((realf: Unknown) -> Unknown) | Unknown` [invalid-inheritance]
+ ERROR lib/spack/spack/spec.py:5156:18-56: `(realf: Unknown) -> Unknown` is not subscriptable [unsupported-operation]
+ ERROR lib/spack/spack/spec.py:5162:34-49: Expected class object, got `(realf: Unknown) -> Unknown` [invalid-argument]
+ ERROR lib/spack/spack/spec.py:5408:33-51: Object of class `FunctionType` has no attribute `from_dict` [missing-attribute]
- ERROR lib/spack/spack/spec.py:5447:17-53: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5419:39-69: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/spec.py:5839:18-33: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/test/architecture.py:78:70-75: Expected 1 positional argument, got 2 [bad-argument-count]
- ERROR lib/spack/spack/test/concretization/core.py:1287:24-56: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1605:44-74: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `set.__init__` [bad-argument-type]
- ERROR lib/spack/spack/test/concretization/core.py:1618:20-52: Argument `bool | str | tuple[bool | str, ...]` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `set.__init__` [bad-argument-type]
- ERROR lib/spack/spack/test/config.py:409:30-48: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:839:25-40: Object of class `NoneType` has no attribute `name` [missing-attribute]
- ERROR lib/spack/spack/test/conftest.py:839:42-60: Object of class `NoneType` has no attribute `version` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:173:9-65: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:210:12-57: `in` is not supported between `str` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:213:12-61: `not in` is not supported between `str` and `bool` [not-iterable]
- ERROR lib/spack/spack/test/patch.py:236:19-74: Object of class `VariantValue` has no attribute `_patches_in_order_of_appearance` [missing-attribute]
- ERROR lib/spack/spack/test/patch.py:386:12-72: `not in` is not supported between `str` and `bool` [not-iterable]
+ ERROR lib/spack/spack/test/spec_semantics.py:2115:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2115:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2115:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2116:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2116:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2116:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2124:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2124:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2124:53-61: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2418:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2418:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2418:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2418:67-71: Unexpected keyword argument `when` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2419:36-41: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2419:43-50: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2419:54-62: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/test/spec_semantics.py:2516:35-40: Expected 1 positional argument, got 2 [bad-argument-count]
+ ERROR lib/spack/spack/test/spec_semantics.py:2516:42-49: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/test/variant.py:345:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:348:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
+ ERROR lib/spack/spack/test/variant.py:351:9-36: Object of class `FunctionType` has no attribute `from_node_dict` [missing-attribute]
- ERROR lib/spack/spack/traverse.py:236:49-53: Argument `None` is not assignable to parameter `parent` with type `Spec` in function `spack.spec.DependencySpec.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/traverse.py:37:12-37: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:236:41-86: Missing argument `realf` [missing-argument]
+ ERROR lib/spack/spack/traverse.py:236:42-48: Unexpected keyword argument `parent` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:55-59: Unexpected keyword argument `spec` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:63-70: Unexpected keyword argument `depflag` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:236:74-82: Unexpected keyword argument `virtuals` [unexpected-keyword]
+ ERROR lib/spack/spack/traverse.py:460:16-41: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:475:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:490:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:22-47: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:503:62-87: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/traverse.py:665:27-52: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
- ERROR lib/spack/spack/util/path.py:77:34-52: Object of class `NoneType` has no attribute `family` [missing-attribute]
- ERROR lib/spack/spack/variant.py:512:55-62: Argument `tuple[None]` is not assignable to parameter `value` with type `tuple[bool | str, ...]` in function `VariantValue.__init__` [bad-argument-type]
+ ERROR lib/spack/spack/variant.py:160:41-53: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:217:32-44: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:219:19-51: Object of class `FunctionType` has no attribute `from_string_or_bool` [missing-attribute]
+ ERROR lib/spack/spack/variant.py:223:58-70: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:225:48-57: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:313:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:317:36-40: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:317:56-65: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:317:77-85: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:323:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:323:74-83: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:326:49-53: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:326:65-74: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:331:11-23: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:333:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:333:67-76: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:337:35-39: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:337:69-78: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:341:52-56: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:341:62-71: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:345:13-17: Expected 1 positional argument, got 3 [bad-argument-count]
+ ERROR lib/spack/spack/variant.py:347:13-22: Unexpected keyword argument `propagate` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:348:13-21: Unexpected keyword argument `concrete` [unexpected-keyword]
+ ERROR lib/spack/spack/variant.py:352:64-76: Expected a type form, got instance of `((realf: Unknown) -> Unknown) | Unknown` [not-a-type]
+ ERROR lib/spack/spack/variant.py:355:51-55: Expected 1 positional argument, got 3 [bad-argument-count]
... (truncated 18 lines) ...
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/testing/tests/test_skip_class.py:20:1-15: Argument `type[SkipClassTests]` is not assignable to parameter `reason` with type `str` in function `unittest.case.skip` [bad-argument-type]
Primer Diff Classification
❌ 1 regression(s) | ✅ 5 improvement(s) | 6 project(s) total | +190, -30 errors
1 regression(s) across scikit-learn. error kinds: invalid-inheritance on deprecated class, removed missing-attribute on PassiveAggressiveRegressor. caused by is_some(). 5 improvement(s) across jax, pandera, core, spack, spark.
| Project | Verdict | Changes | Error Kinds | Root Cause |
|---|---|---|---|---|
| jax | ✅ Improvement | +1 | bad-specialization |
pyrefly/lib/alt/solve.rs |
| scikit-learn | ❌ Regression | +1, -1 | invalid-inheritance on deprecated class |
is_some() |
| pandera | ✅ Improvement | -2 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
| core | ✅ Improvement | +1 | class decorator type transformation |
pyrefly/lib/alt/solve.rs |
| spack | ✅ Improvement | +186, -27 | missing-attribute on FunctionType |
pyrefly/lib/alt/solve.rs |
| spark | ✅ Improvement | +1 | bad-argument-type |
pyrefly/lib/alt/solve.rs |
Detailed analysis
❌ Regression (1)
scikit-learn (+1, -1)
❌ invalid-inheritance on deprecated class: The
@deprecateddecorator returns the original class (it only wraps__new__). The PR's new decorator handling infers the return type as a callable rather than recognizing it's still the same class, causing a falseinvalid-inheritanceerror whenMockClass5inherits fromMockClass1. This is a regression — the code is valid. ❌ removed missing-attribute on PassiveAggressiveRegressor: Themissing-attributeerror was technically correct (transformdoesn't exist onPassiveAggressiveRegressor), but the code is insidepytest.raises(AttributeError)— it's deliberately testing for the missing attribute. The removal is likely a side effect of the decorator handling changes affecting how the@deprecated-decorated class is resolved. This is a minor regression (lost a true positive), though the practical impact is low given the test context.Overall: The analysis is factually correct. The
@deprecateddecorator in sklearn wraps__new__but returns the original class, making it valid as a base class. Theinvalid-inheritanceerror is indeed a false positive caused by pyrefly inferring the decorated class as((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknownrather than recognizing it as a class type. The removedmissing-attributeerror was a true positive (PassiveAggressiveRegressor genuinely lackstransform), and its disappearance is correctly attributed to the decorator handling changes affecting how the@deprecated-decorated class is resolved. The overall assessment of a net regression is accurate.Attribution: The new
invalid-inheritanceerror is caused by the changes inpyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm. The PR now applies class decorators to the class binding. ForMockClass1(decorated with@deprecated('qwerty')), the decorator's return type is inferred as a callable/function type rather than a class type. Theuntype_optcheck at the end (if self.untype_opt(ty.clone(), range, errors).[is_some()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs)) is supposed to detect when the decorator still returns a usable type form and preserve the original class, but it appears thedeprecateddecorator's return type doesn't pass this check, soMockClass1gets bound to the decorator's return type (a callable). WhenMockClass5tries to inherit fromMockClass1, it sees a callable type instead of a class type, triggeringinvalid-inheritance. The removedmissing-attributeerror is likely a side effect of the same decorator handling changes — the decorator application logic may have changed howPassiveAggressiveRegressor(which is also decorated with@deprecated) is resolved.
✅ Improvement (5)
jax (+1)
The
@dataclassdecorator on classP(withoutfrozen=Trueorunsafe_hash=True) sets__hash__ = Nonewheneq=True(the default), making instances ofPgenuinely unhashable per Python's dataclass specification. Thejax.tree_util.register_staticfunction's type signature in pyrefly includes a type variableHbounded byHashable, and sincePis not hashable, the error is technically correct. The reason this is[pyrefly-only]is most likely that other type checkers use different type stubs forjax.tree_util.register_staticthat don't express theHashablebound, rather than being lenient about dataclass hashability. That said, at runtime JAX'sregister_staticdoes require hashability for correctness, so this error is arguably a true positive that catches a real potential issue — though in practice the code may work if__eq__and the defaultobject.__hash__behavior suffice or if JAX handles this case specially. Attribution: The change toBinding::ClassDefhandling inpyrefly/lib/alt/solve.rsnow applies class decorators by calling them with the class type as an argument. This causesjax.tree_util.register_staticto be type-checked as a call withPas the argument, triggering thebad-specializationerror becauseP(a default dataclass) doesn't satisfy theHashableupper bound of the type variableH.
pandera (-2)
The removed errors were false positives caused by pyrefly inferring an overly narrow element type for the
PYSPARK_PANDAS_UNSUPPORTEDset. The set is initialized with a literal containing specific dtype classes (lines 46-64), and pyrefly inferred the set's type as a union of only those specifictype[...]entries. Whenset.add(numpy_engine.Timedelta64)(line 69) andset.update({numpy_engine.Float128, numpy_engine.Complex256})(lines 72-74) are called, pyrefly rejected these becauseTimedelta64,Float128, andComplex256were not in the inferred element type union. In reality, all these classes (from numpy_engine and pandas_engine) share common base classes in pandera's engine hierarchy, so the set should be able to hold all of them. The@Engine.register_dtypedecorator is applied to these dtype classes in pandera's engine modules, and with the PR's improved class decorator support, pyrefly can now properly process these decorators and understand the resulting class types and their relationships. This allows pyrefly to infer a wider, correct element type for the set that accommodates all the dtype classes being added. Attribution: The change toBinding::ClassDefhandling inpyrefly/lib/alt/solve.rsnow processes class decorators (like pandera's@Engine.register_dtype) and resolves the decorated class type. Previously decorators were ignored (TODOcomment). This likely changed how the numpy_engine dtype classes (which are decorated) are typed, allowing pyrefly to see their common base type and accept them as valid set elements.
core (+1)
✅ class decorator type transformation: The
@deprecated_classdecorator changes the type ofSelectedEntitiesfrom the local subclass to the parent class. The return type annotation expects the local subclass, creating a genuine type mismatch. Pyright co-reports this error.Overall: This is a genuine type-level issue caused by the
@deprecated_classdecorator changing the perceived type ofSelectedEntities. Pyright agrees. The decorator's return type annotation likely doesn't preserve the exact subclass type, making the return type mismatch real at the type level. While the runtime behavior is correct, the type-level analysis is sound — the decorator genuinely transforms the class binding. This is an improvement in pyrefly's analysis capability.Attribution: The change in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now applies class decorators to the class type. Previously, decorators were ignored (TODOcomment). Now, the@deprecated_classdecorator is applied toSelectedEntities, which changes its binding type fromtype[homeassistant.helpers.service.SelectedEntities]totype[homeassistant.helpers.target.SelectedEntities](the parent class). Theuntype_optcheck tries to preserve the original class if the decorator returns a usable type form, butdeprecated_classapparently returns a type that resolves to the parent class.
spack (+186, -27)
❌ missing-attribute on FunctionType: Pyrefly incorrectly resolves decorated classes (e.g., ArchSpec, Spec) as FunctionType due to decorator inference failure, then reports missing attributes like
default_arch,from_dictetc. These are real class methods. All pyrefly-only. Regression. ❌ not-a-type errors: Classes used as type annotations are seen as(realf: Unknown) -> Unknowninstead of class types. Inference failure from decorator handling. All pyrefly-only. Regression. ❌ invalid-inheritance: Classes inheriting from decorated base classes fail because the base is seen as a function type. Inference failure. All pyrefly-only. Regression. ❌ unexpected-keyword / bad-argument-count / missing-argument: Constructor calls to decorated classes fail because pyrefly sees them as functions with wrong signatures. Inference failure cascade. All pyrefly-only. Regression. ❌ unsupported-operation / invalid-argument: Subscripting and instantiation of decorated classes fails. Same root cause. Regression. ❌ missing-attribute on tuple: ArchSpec properties like platform/os/target reported missing on tuple — likely ArchSpec resolved to wrong type. Regression. ✅ Removed bad-argument-type and missing-attribute errors: Most removed errors appear to be false positives (e.g., Unknown|None not assignable, missing attributes on NoneType). Their removal is an improvement, though some override checks may have been legitimate.Overall: The PR introduces class decorator support but has an inference failure when processing spack's class decorators. Classes like
ArchSpec,Spec, and various OS classes get their types replaced with(realf: Unknown) -> Unknown(a function type) instead of preserving the class type. This causes 186 cascading false positive errors (missing attributes on FunctionType, invalid inheritance, unexpected keywords, etc.). Meanwhile, ~27 errors were removed, some of which were likely false positives (improvement) but some may have been legitimate checks lost. The net effect is strongly negative: 186 new false positives vs ~27 removed errors.
Per-category reasoning:
- missing-attribute on FunctionType: Pyrefly incorrectly resolves decorated classes (e.g., ArchSpec, Spec) as FunctionType due to decorator inference failure, then reports missing attributes like
default_arch,from_dictetc. These are real class methods. All pyrefly-only. Regression. - not-a-type errors: Classes used as type annotations are seen as
(realf: Unknown) -> Unknowninstead of class types. Inference failure from decorator handling. All pyrefly-only. Regression. - invalid-inheritance: Classes inheriting from decorated base classes fail because the base is seen as a function type. Inference failure. All pyrefly-only. Regression.
- unexpected-keyword / bad-argument-count / missing-argument: Constructor calls to decorated classes fail because pyrefly sees them as functions with wrong signatures. Inference failure cascade. All pyrefly-only. Regression.
- unsupported-operation / invalid-argument: Subscripting and instantiation of decorated classes fails. Same root cause. Regression.
- missing-attribute on tuple: ArchSpec properties like platform/os/target reported missing on tuple — likely ArchSpec resolved to wrong type. Regression.
- Removed bad-argument-type and missing-attribute errors: Most removed errors appear to be false positives (e.g., Unknown|None not assignable, missing attributes on NoneType). Their removal is an improvement, though some override checks may have been legitimate.
Attribution: The changes in
pyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm now apply decorators to class definitions. When a decorator's return type resolves to something like(realf: Unknown) -> Unknown(an inference failure), theuntype_optcheck fails, and the class binding gets the decorator's return type instead of preserving the class type. This cascades into all 186 new errors. TheExpr::Namebranch addition andType::KwCallhandling inuntype_optalso contribute.
spark (+1)
This is a real type error according to the type stubs.
unittest.skipis declared asdef skip(reason: str) -> Callable[[_FT], _FT]in typeshed. When used as@unittest.skip(without parentheses) on a class, the classtype[SkipClassTests]is passed as thereasonparameter, which expectsstr. While this works at runtime (CPython handles both cases), the type stubs don't reflect this dual usage. Pyright also flags this. The PR's new class decorator analysis correctly identifies this type mismatch per the declared signatures. This is an improvement — pyrefly is now analyzing class decorators and catching a genuine type stub violation that pyright also catches. Attribution: The change inpyrefly/lib/alt/solve.rsin theBinding::ClassDefmatch arm is directly responsible. Previously, pyrefly had a TODO comment saying it didn't analyze class decorators at all — it just returnedself.heap.mk_class_def(cls.dupe()). The new code iterates over decorators, callsas_call_target_or_errorandcall_inferto type-check the decorator application. This means pyrefly now checks that the class type is assignable to the decorator's parameter, which catches thetype[SkipClassTests]vsstrmismatch inunittest.skip.
Suggested fixes
Summary: The new class decorator handling in Binding::ClassDef replaces class types with broken decorator return types when decorator inference fails (returns Unknown-containing callables), causing massive regressions in spack (186 errors) and scikit-learn (1 error).
1. In the Binding::ClassDef match arm in pyrefly/lib/alt/solve.rs, after calling call_infer() for a decorator, add a guard that preserves the original class type (cls) when the decorator's return type contains Unknown or is a callable with Unknown parameters. Specifically, after ty = self.call_infer(...) and before the untype_opt check, add: if the returned ty is a callable/function type where parameters or return contain Unknown (e.g., (realf: Unknown) -> Unknown), fall back to self.heap.mk_class_def(cls.dupe()). The existing untype_opt check handles the case where the decorator returns a valid type form (like a class), but it doesn't handle the case where inference completely fails and returns a garbage callable type. Something like: if ty.[contains_unknown()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs) || ty.[is_callable_with_unknown_params()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/solve.rs) { ty = self.heap.mk_class_def(cls.dupe()); } before the untype_opt check.
Files:
pyrefly/lib/alt/solve.rsConfidence: high Affected projects: spack, scikit-learn Fixes:missing-attribute,not-a-type,invalid-inheritance,unexpected-keyword,bad-argument-count,missing-argument,unsupported-operation,invalid-argumentWhen spack's decorators (and sklearn's @deprecated) are processed, call_infer returns types like(realf: Unknown) -> Unknownbecause the decorator's type signature can't be fully resolved. The untype_opt check only catches cases where the return is a valid type form (class type), not cases where inference failed entirely. By detecting Unknown-containing return types and falling back to the original class, we preserve correct class typing. This eliminates 186 errors in spack and the invalid-inheritance error in scikit-learn.
2. Alternative/complementary fix: In the Binding::ClassDef match arm, after ty = self.call_infer(...), expand the fallback condition. Currently the code does if self.untype_opt(ty.clone(), range, errors).is_some() { ty = self.heap.mk_class_def(cls.dupe()); }. Change this to ALSO fall back when ty is a plain callable/function type (not a class type or type form). The logic should be: if self.untype_opt(ty.clone(), range, errors).is_some() || ty.is_function_type() { ty = self.heap.mk_class_def(cls.dupe()); }. This way, when a decorator returns a function type instead of a class type (due to inference failure), we preserve the original class.
Files:
pyrefly/lib/alt/solve.rsConfidence: medium Affected projects: spack, scikit-learn Fixes:missing-attribute,not-a-type,invalid-inheritance,unexpected-keyword,bad-argument-count,missing-argumentThe untype_opt check catches decorators that return class types (preserving the original class), but decorators that return function types with Unknown params slip through. Checking if the result is a function/callable type (rather than a class type) and falling back would catch the spack and scikit-learn cases. However, this would also affect the intentional test_class_decorator_rebinds_class_value test case where @remote intentionally rebinds a class to ActorHandle, so the check needs to be specifically for Unknown-containing callables, not all callables.
Was this helpful? React with 👍 or 👎
Classification by primer-classifier (6 LLM)
Thank you for your work on this but wouldn't real-world decorators (@deprecated, @wraps, @lazy_lexicographic_ordering, etc.) have return types that resolve to Unknown or generic callables, so the original class type must be preserved. This is what is causing the regressions.
Tagging @samwgoldman / @stroxler because it is their domain.
This may also be worth scoping down to only support decorators whose return type resolves to a concrete class/type-form, instead of unknowns which could be picked in a follow-up.