You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mypyc] Report error when registering a nested function (#19450)
Fixesmypyc/mypyc#1118
Added a check for nested `@singledispatch` functions and nested
functions registered to `@singledispatch` functions to report an error
in mypyc. Currently either of those cases causes mypyc to crash because
of the different handling of nested and top-level functions.
Changed to abort the compilation early when these errors are found so
that in the transform code we can assume that the singledispatch
functions are valid. This means that mypyc might not report as many
errors until it quits as before, so I have split the error output test
in `commandline.test` into two.
class NonExt(Concrete1): # E: Non-extension classes may not inherit from extension classes
166
-
pass
167
-
168
-
169
217
class NopeMultipleInheritance(Concrete1, Concrete2): # E: Multiple inheritance is not supported (except for traits)
170
218
pass
171
219
@@ -175,13 +223,6 @@ class NopeMultipleInheritanceAndBadOrder(Concrete1, Trait1, Concrete2): # E: Mu
175
223
class NopeMultipleInheritanceAndBadOrder2(Concrete1, Concrete2, Trait1): # E: Multiple inheritance is not supported (except for traits)
176
224
pass
177
225
178
-
class NopeMultipleInheritanceAndBadOrder3(Trait1, Concrete1, Concrete2): # E: Non-trait base must appear first in parent list # E: Multiple inheritance is not supported (except for traits)
179
-
pass
180
-
181
-
class NopeBadOrder(Trait1, Concrete2): # E: Non-trait base must appear first in parent list
182
-
pass
183
-
184
-
185
226
@decorator
186
227
class NonExt2:
187
228
@property # E: Property setters not supported in non-extension classes
@@ -219,26 +260,6 @@ class AllowInterp2(PureTrait): # E: Base class "test.PureTrait" does not allow
0 commit comments