-
Notifications
You must be signed in to change notification settings - Fork 133
Give diagnostic when inheriting from something that is not a class #1337
Conversation
|
A question, what would the diagnostics be for something like this? X = 123
class Foo(X):
pass
class Bar(Foo):
passIs it going to complain at both |
Just tested it. It only complains at Foo. It will only complain about a direct inheritance, not a chain. |
|
Perfect, but would you mind adding a test for it so we don't regress later on? (And fix the merge conflicts). Then this should be good. |
|
Sorry, just haven't pushed test yet. |
…into scratch/InheritNonClass
…icrosoft#1337) * When creating a class, give diagnostic if bases are not class types
Fixes #1278
Try number 2.
Test Plan:
Diagnostic
Inheriting a variable that is a constant
Inheriting a constant
Inheriting a function
Inheriting a method
Inheriting an object instance
Inheriting a property that returns a constant
Inheriting a property that returns a function
Inheriting a property that returns a method
No Diagnostic
Builltin types
Renamed builin types
User Class
A property that returns nothing