@zzzen/pyright-internal 1.2.0-dev.20230507 → 1.2.0-dev.20230521

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/analyzer/analyzerFileInfo.d.ts +1 -0
  2. package/dist/analyzer/analyzerFileInfo.js +4 -3
  3. package/dist/analyzer/analyzerFileInfo.js.map +1 -1
  4. package/dist/analyzer/backgroundAnalysisProgram.d.ts +17 -15
  5. package/dist/analyzer/backgroundAnalysisProgram.js +43 -53
  6. package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -1
  7. package/dist/analyzer/binder.d.ts +0 -2
  8. package/dist/analyzer/binder.js +2 -20
  9. package/dist/analyzer/binder.js.map +1 -1
  10. package/dist/analyzer/checker.d.ts +1 -1
  11. package/dist/analyzer/checker.js +97 -29
  12. package/dist/analyzer/checker.js.map +1 -1
  13. package/dist/analyzer/constraintSolver.js +14 -15
  14. package/dist/analyzer/constraintSolver.js.map +1 -1
  15. package/dist/analyzer/constructorTransform.js +5 -1
  16. package/dist/analyzer/constructorTransform.js.map +1 -1
  17. package/dist/analyzer/constructors.js +248 -189
  18. package/dist/analyzer/constructors.js.map +1 -1
  19. package/dist/analyzer/dataClasses.js +5 -2
  20. package/dist/analyzer/dataClasses.js.map +1 -1
  21. package/dist/analyzer/declarationUtils.js +1 -0
  22. package/dist/analyzer/declarationUtils.js.map +1 -1
  23. package/dist/analyzer/docStringConversion.js +1 -1
  24. package/dist/analyzer/docStringConversion.js.map +1 -1
  25. package/dist/analyzer/enums.js +8 -0
  26. package/dist/analyzer/enums.js.map +1 -1
  27. package/dist/analyzer/importResolver.d.ts +4 -4
  28. package/dist/analyzer/importResolver.js +93 -69
  29. package/dist/analyzer/importResolver.js.map +1 -1
  30. package/dist/analyzer/importResult.d.ts +2 -2
  31. package/dist/analyzer/importStatementUtils.js +2 -2
  32. package/dist/analyzer/importStatementUtils.js.map +1 -1
  33. package/dist/analyzer/namedTuples.js +2 -5
  34. package/dist/analyzer/namedTuples.js.map +1 -1
  35. package/dist/analyzer/packageTypeVerifier.js +1 -1
  36. package/dist/analyzer/packageTypeVerifier.js.map +1 -1
  37. package/dist/analyzer/parseTreeUtils.js +2 -34
  38. package/dist/analyzer/parseTreeUtils.js.map +1 -1
  39. package/dist/analyzer/parseTreeWalker.js +2 -2
  40. package/dist/analyzer/parseTreeWalker.js.map +1 -1
  41. package/dist/analyzer/patternMatching.js +1 -0
  42. package/dist/analyzer/patternMatching.js.map +1 -1
  43. package/dist/analyzer/program.d.ts +18 -34
  44. package/dist/analyzer/program.js +57 -259
  45. package/dist/analyzer/program.js.map +1 -1
  46. package/dist/analyzer/protocols.js +4 -2
  47. package/dist/analyzer/protocols.js.map +1 -1
  48. package/dist/analyzer/service.d.ts +8 -16
  49. package/dist/analyzer/service.js +33 -47
  50. package/dist/analyzer/service.js.map +1 -1
  51. package/dist/analyzer/sourceFile.d.ts +1 -15
  52. package/dist/analyzer/sourceFile.js +14 -96
  53. package/dist/analyzer/sourceFile.js.map +1 -1
  54. package/dist/analyzer/sourceMapper.js +1 -1
  55. package/dist/analyzer/sourceMapper.js.map +1 -1
  56. package/dist/analyzer/symbol.d.ts +3 -1
  57. package/dist/analyzer/symbol.js +5 -0
  58. package/dist/analyzer/symbol.js.map +1 -1
  59. package/dist/analyzer/typeDocStringUtils.js +1 -1
  60. package/dist/analyzer/typeDocStringUtils.js.map +1 -1
  61. package/dist/analyzer/typeEvaluator.d.ts +2 -2
  62. package/dist/analyzer/typeEvaluator.js +495 -196
  63. package/dist/analyzer/typeEvaluator.js.map +1 -1
  64. package/dist/analyzer/typeEvaluatorTypes.d.ts +7 -2
  65. package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
  66. package/dist/analyzer/typeGuards.js +1 -0
  67. package/dist/analyzer/typeGuards.js.map +1 -1
  68. package/dist/analyzer/typePrinter.d.ts +3 -3
  69. package/dist/analyzer/typePrinter.js +255 -101
  70. package/dist/analyzer/typePrinter.js.map +1 -1
  71. package/dist/analyzer/typeUtils.d.ts +12 -7
  72. package/dist/analyzer/typeUtils.js +174 -49
  73. package/dist/analyzer/typeUtils.js.map +1 -1
  74. package/dist/analyzer/typeVarContext.d.ts +1 -2
  75. package/dist/analyzer/typeVarContext.js +16 -34
  76. package/dist/analyzer/typeVarContext.js.map +1 -1
  77. package/dist/analyzer/typedDicts.js +138 -41
  78. package/dist/analyzer/typedDicts.js.map +1 -1
  79. package/dist/analyzer/types.d.ts +10 -3
  80. package/dist/analyzer/types.js +32 -16
  81. package/dist/analyzer/types.js.map +1 -1
  82. package/dist/backgroundAnalysisBase.d.ts +25 -19
  83. package/dist/backgroundAnalysisBase.js +161 -115
  84. package/dist/backgroundAnalysisBase.js.map +1 -1
  85. package/dist/backgroundThreadBase.d.ts +1 -1
  86. package/dist/backgroundThreadBase.js +1 -1
  87. package/dist/backgroundThreadBase.js.map +1 -1
  88. package/dist/commands/dumpFileDebugInfoCommand.js +3 -4
  89. package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
  90. package/dist/common/configOptions.js +1 -1
  91. package/dist/common/configOptions.js.map +1 -1
  92. package/dist/common/extensibility.d.ts +26 -5
  93. package/dist/common/extensibility.js.map +1 -1
  94. package/dist/common/logTracker.d.ts +2 -0
  95. package/dist/common/logTracker.js +8 -1
  96. package/dist/common/logTracker.js.map +1 -1
  97. package/dist/common/lspUtils.d.ts +4 -1
  98. package/dist/common/lspUtils.js +38 -1
  99. package/dist/common/lspUtils.js.map +1 -1
  100. package/dist/common/pythonVersion.d.ts +2 -1
  101. package/dist/common/pythonVersion.js +1 -0
  102. package/dist/common/pythonVersion.js.map +1 -1
  103. package/dist/common/textRange.js +1 -1
  104. package/dist/common/textRange.js.map +1 -1
  105. package/dist/common/workspaceEditUtils.d.ts +3 -3
  106. package/dist/common/workspaceEditUtils.js +15 -17
  107. package/dist/common/workspaceEditUtils.js.map +1 -1
  108. package/dist/languageServerBase.d.ts +2 -5
  109. package/dist/languageServerBase.js +35 -62
  110. package/dist/languageServerBase.js.map +1 -1
  111. package/dist/languageService/autoImporter.d.ts +51 -52
  112. package/dist/languageService/autoImporter.js +126 -211
  113. package/dist/languageService/autoImporter.js.map +1 -1
  114. package/dist/languageService/callHierarchyProvider.js +8 -33
  115. package/dist/languageService/callHierarchyProvider.js.map +1 -1
  116. package/dist/languageService/completionProvider.d.ts +42 -81
  117. package/dist/languageService/completionProvider.js +608 -841
  118. package/dist/languageService/completionProvider.js.map +1 -1
  119. package/dist/languageService/documentSymbolCollector.d.ts +2 -2
  120. package/dist/languageService/documentSymbolCollector.js +40 -30
  121. package/dist/languageService/documentSymbolCollector.js.map +1 -1
  122. package/dist/languageService/documentSymbolProvider.d.ts +13 -35
  123. package/dist/languageService/documentSymbolProvider.js +52 -264
  124. package/dist/languageService/documentSymbolProvider.js.map +1 -1
  125. package/dist/languageService/hoverProvider.d.ts +1 -3
  126. package/dist/languageService/hoverProvider.js +11 -97
  127. package/dist/languageService/hoverProvider.js.map +1 -1
  128. package/dist/languageService/referencesProvider.d.ts +3 -3
  129. package/dist/languageService/referencesProvider.js +6 -8
  130. package/dist/languageService/referencesProvider.js.map +1 -1
  131. package/dist/languageService/renameProvider.d.ts +0 -1
  132. package/dist/languageService/renameProvider.js +2 -6
  133. package/dist/languageService/renameProvider.js.map +1 -1
  134. package/dist/languageService/signatureHelpProvider.js +1 -1
  135. package/dist/languageService/signatureHelpProvider.js.map +1 -1
  136. package/dist/languageService/symbolIndexer.d.ts +23 -0
  137. package/dist/languageService/symbolIndexer.js +105 -0
  138. package/dist/languageService/symbolIndexer.js.map +1 -0
  139. package/dist/languageService/tooltipUtils.d.ts +8 -1
  140. package/dist/languageService/tooltipUtils.js +102 -1
  141. package/dist/languageService/tooltipUtils.js.map +1 -1
  142. package/dist/languageService/workspaceSymbolProvider.d.ts +17 -0
  143. package/dist/languageService/workspaceSymbolProvider.js +133 -0
  144. package/dist/languageService/workspaceSymbolProvider.js.map +1 -0
  145. package/dist/localization/localize.d.ts +38 -4
  146. package/dist/localization/localize.js +21 -4
  147. package/dist/localization/localize.js.map +1 -1
  148. package/dist/localization/package.nls.en-us.json +23 -6
  149. package/dist/parser/parseNodes.d.ts +8 -8
  150. package/dist/parser/parseNodes.js +20 -10
  151. package/dist/parser/parseNodes.js.map +1 -1
  152. package/dist/parser/parser.d.ts +3 -3
  153. package/dist/parser/parser.js +136 -159
  154. package/dist/parser/parser.js.map +1 -1
  155. package/dist/parser/stringTokenUtils.d.ts +3 -13
  156. package/dist/parser/stringTokenUtils.js +8 -181
  157. package/dist/parser/stringTokenUtils.js.map +1 -1
  158. package/dist/parser/tokenizer.d.ts +3 -0
  159. package/dist/parser/tokenizer.js +211 -24
  160. package/dist/parser/tokenizer.js.map +1 -1
  161. package/dist/parser/tokenizerTypes.d.ts +31 -1
  162. package/dist/parser/tokenizerTypes.js +51 -1
  163. package/dist/parser/tokenizerTypes.js.map +1 -1
  164. package/dist/pyright.js +26 -4
  165. package/dist/pyright.js.map +1 -1
  166. package/dist/readonlyAugmentedFileSystem.js +1 -1
  167. package/dist/readonlyAugmentedFileSystem.js.map +1 -1
  168. package/dist/tests/chainedSourceFiles.test.js +15 -20
  169. package/dist/tests/chainedSourceFiles.test.js.map +1 -1
  170. package/dist/tests/checker.test.js +14 -0
  171. package/dist/tests/checker.test.js.map +1 -1
  172. package/dist/tests/completions.test.js +11 -236
  173. package/dist/tests/completions.test.js.map +1 -1
  174. package/dist/tests/docStringConversion.test.js +36 -2
  175. package/dist/tests/docStringConversion.test.js.map +1 -1
  176. package/dist/tests/fourslash/completions.override2.fourslash.js +1 -16
  177. package/dist/tests/fourslash/completions.override2.fourslash.js.map +1 -1
  178. package/dist/tests/harness/fourslash/testLanguageService.js +1 -1
  179. package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
  180. package/dist/tests/harness/fourslash/testState.d.ts +14 -8
  181. package/dist/tests/harness/fourslash/testState.js +27 -37
  182. package/dist/tests/harness/fourslash/testState.js.map +1 -1
  183. package/dist/tests/importResolver.test.js +84 -4
  184. package/dist/tests/importResolver.test.js.map +1 -1
  185. package/dist/tests/textRange.test.js +45 -0
  186. package/dist/tests/textRange.test.js.map +1 -0
  187. package/dist/tests/tokenizer.test.js +272 -58
  188. package/dist/tests/tokenizer.test.js.map +1 -1
  189. package/dist/tests/typeEvaluator2.test.js +16 -0
  190. package/dist/tests/typeEvaluator2.test.js.map +1 -1
  191. package/dist/tests/typeEvaluator3.test.js +14 -0
  192. package/dist/tests/typeEvaluator3.test.js.map +1 -1
  193. package/dist/tests/typeEvaluator4.test.js +7 -2
  194. package/dist/tests/typeEvaluator4.test.js.map +1 -1
  195. package/dist/tests/typeEvaluator5.test.js +29 -9
  196. package/dist/tests/typeEvaluator5.test.js.map +1 -1
  197. package/dist/tests/workspaceEditUtils.test.js +15 -10
  198. package/dist/tests/workspaceEditUtils.test.js.map +1 -1
  199. package/dist/workspaceFactory.js +3 -5
  200. package/dist/workspaceFactory.js.map +1 -1
  201. package/package.json +1 -1
  202. package/dist/languageService/importAdder.d.ts +0 -40
  203. package/dist/languageService/importAdder.js +0 -388
  204. package/dist/languageService/importAdder.js.map +0 -1
  205. package/dist/tests/fourslash/completions.commitChars.fourslash.d.ts +0 -1
  206. package/dist/tests/fourslash/completions.commitChars.fourslash.js +0 -81
  207. package/dist/tests/fourslash/completions.commitChars.fourslash.js.map +0 -1
  208. package/dist/tests/importAdder.test.js +0 -1325
  209. package/dist/tests/importAdder.test.js.map +0 -1
  210. /package/dist/tests/{importAdder.test.d.ts → textRange.test.d.ts} +0 -0
@@ -14,6 +14,7 @@
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.createFunctionFromConstructor = exports.validateConstructorArguments = void 0;
17
+ const collectionUtils_1 = require("../common/collectionUtils");
17
18
  const diagnosticRules_1 = require("../common/diagnosticRules");
18
19
  const localize_1 = require("../localization/localize");
19
20
  const analyzerNodeInfo_1 = require("./analyzerNodeInfo");
@@ -27,7 +28,6 @@ const types_1 = require("./types");
27
28
  // If successful, it returns the resulting (specialized) object type that
28
29
  // is allocated by the constructor. If unsuccessful, it reports diagnostics.
29
30
  function validateConstructorArguments(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext) {
30
- var _a;
31
31
  // If there a custom `__call__` method on the metaclass, assume that it
32
32
  // overrides the normal `type.__call__` logic and don't perform the usual
33
33
  // __new__ and __init__ validation.
@@ -36,170 +36,109 @@ function validateConstructorArguments(evaluator, errorNode, argList, type, skipU
36
36
  return metaclassResult;
37
37
  }
38
38
  // Determine whether the class overrides the object.__new__ method.
39
- const newMethodInfo = evaluator.getTypeOfClassMemberName(errorNode, type,
39
+ const newMethodTypeResult = evaluator.getTypeOfClassMemberName(errorNode, type,
40
40
  /* isAccessedThroughObject */ false, '__new__', { method: 'get' },
41
41
  /* diag */ undefined, 1 /* AccessClassMembersOnly */ |
42
42
  4 /* SkipObjectBaseClass */ |
43
43
  16 /* TreatConstructorAsClassMethod */, type);
44
- // Determine whether the class overrides the object.__init__ method.
45
- const initMethodInfo = evaluator.getTypeOfObjectMember(errorNode, types_1.ClassType.cloneAsInstance(type), '__init__', { method: 'get' },
46
- /* diag */ undefined, 4 /* SkipObjectBaseClass */ | 64 /* SkipAttributeAccessOverride */);
47
44
  let returnType;
48
- let validatedTypes = false;
45
+ let validatedArgExpressions = false;
49
46
  let argumentErrors = false;
50
47
  let isTypeIncomplete = false;
51
48
  const overloadsUsedForCall = [];
52
- // If the class doesn't override object.__new__ or object.__init__, use the
53
- // fallback constructor type evaluation for the `object` class.
54
- if (!newMethodInfo && !initMethodInfo) {
55
- const callResult = validateFallbackConstructorCall(evaluator, errorNode, argList, type, inferenceContext);
56
- if (callResult.argumentErrors) {
57
- argumentErrors = true;
49
+ let newMethodReturnType;
50
+ const useConstructorTransform = (0, constructorTransform_1.hasConstructorTransform)(type);
51
+ // If there is a constructor transform, evaluate all arguments speculatively
52
+ // so we can later re-evaluate them in the context of the transform.
53
+ evaluator.useSpeculativeMode(useConstructorTransform ? errorNode : undefined, () => {
54
+ var _a;
55
+ // Validate __new__ if it is present.
56
+ if (newMethodTypeResult) {
57
+ // Use speculative mode for arg expressions because we don't know whether
58
+ // we'll need to re-evaluate these expressions later for __init__.
59
+ const newCallResult = validateNewMethod(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, newMethodTypeResult,
60
+ /* useSpeculativeModeForArgs */ true);
61
+ if (newCallResult.argumentErrors) {
62
+ argumentErrors = true;
63
+ }
64
+ else {
65
+ (0, collectionUtils_1.appendArray)(overloadsUsedForCall, newCallResult.overloadsUsedForCall);
66
+ }
67
+ if (newCallResult.isTypeIncomplete) {
68
+ isTypeIncomplete = true;
69
+ }
70
+ newMethodReturnType = newCallResult.returnType;
58
71
  }
59
- else {
60
- overloadsUsedForCall.push(...callResult.overloadsUsedForCall);
72
+ if (!newMethodReturnType) {
73
+ newMethodReturnType = types_1.ClassType.cloneAsInstance(type);
61
74
  }
62
- returnType = (_a = callResult.returnType) !== null && _a !== void 0 ? _a : types_1.UnknownType.create();
63
- }
64
- else {
65
- // Validate __init__
66
- // We validate __init__ before __new__ because the former typically has
67
- // more specific type annotations, and we want to evaluate the arguments
68
- // in the context of these types. The __new__ method often uses generic
69
- // vargs and kwargs.
70
- const initMethodType = initMethodInfo === null || initMethodInfo === void 0 ? void 0 : initMethodInfo.type;
71
- if (initMethodType && !shouldSkipConstructorCheck(initMethodType)) {
72
- // If there is an expected type, analyze the constructor call
73
- // for each of the subtypes that comprise the expected type. If
74
- // one or more analyzes with no errors, use those results.
75
- if (inferenceContext) {
76
- const expectedCallResult = validateConstructorMethodWithContext(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, initMethodType);
77
- if (expectedCallResult && !expectedCallResult.argumentErrors) {
78
- returnType = expectedCallResult.returnType;
79
- if (expectedCallResult.isTypeIncomplete) {
80
- isTypeIncomplete = true;
81
- }
82
- }
75
+ else if (!(0, types_1.isNever)(newMethodReturnType)) {
76
+ if (!(0, types_1.isClassInstance)(newMethodReturnType)) {
77
+ // If the __new__ method returns something other than an object or
78
+ // NoReturn, we'll ignore its return type.
79
+ newMethodReturnType = types_1.ClassType.cloneAsInstance(type);
83
80
  }
84
- if (!returnType) {
85
- const typeVarContext = type.typeArguments
86
- ? (0, typeUtils_1.buildTypeVarContextFromSpecializedClass)(type, /* makeConcrete */ false)
87
- : new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(type));
88
- typeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(initMethodType));
89
- const callResult = evaluator.validateCallArguments(errorNode, argList, { type: initMethodType }, typeVarContext, skipUnknownArgCheck);
90
- let adjustedClassType = type;
91
- if (callResult.specializedInitSelfType &&
92
- (0, types_1.isClassInstance)(callResult.specializedInitSelfType) &&
93
- types_1.ClassType.isSameGenericClass(callResult.specializedInitSelfType, type)) {
94
- adjustedClassType = types_1.ClassType.cloneAsInstantiable(callResult.specializedInitSelfType);
95
- }
96
- returnType = applyExpectedTypeForConstructor(evaluator, adjustedClassType,
97
- /* inferenceContext */ undefined, typeVarContext);
98
- if (callResult.isTypeIncomplete) {
99
- isTypeIncomplete = true;
100
- }
101
- if (callResult.argumentErrors) {
81
+ }
82
+ let initMethodTypeResult;
83
+ // Validate __init__ if it's present. Skip if the __new__ method produced errors.
84
+ if (!argumentErrors &&
85
+ !(0, types_1.isNever)(newMethodReturnType) &&
86
+ !shouldSkipInitEvaluation(evaluator, type, newMethodReturnType)) {
87
+ // If the __new__ method returned the same type as the class it's constructing
88
+ // but didn't supply solved type arguments, we'll ignore its specialized return
89
+ // type and rely on the __init__ method to supply the type arguments instead.
90
+ let initMethodBindToType = newMethodReturnType;
91
+ if ((0, typeUtils_1.isPartlyUnknown)(initMethodBindToType)) {
92
+ initMethodBindToType = types_1.ClassType.cloneAsInstance(type);
93
+ }
94
+ // Determine whether the class overrides the object.__init__ method.
95
+ initMethodTypeResult = evaluator.getTypeOfObjectMember(errorNode, types_1.ClassType.cloneAsInstance(initMethodBindToType), '__init__', { method: 'get' },
96
+ /* diag */ undefined, 4 /* SkipObjectBaseClass */ | 64 /* SkipAttributeAccessOverride */);
97
+ // Validate __init__ if it's present.
98
+ if (initMethodTypeResult) {
99
+ const initCallResult = validateInitMethod(evaluator, errorNode, argList, initMethodBindToType, skipUnknownArgCheck, inferenceContext, initMethodTypeResult.type);
100
+ if (initCallResult.argumentErrors) {
102
101
  argumentErrors = true;
103
102
  }
104
103
  else {
105
- overloadsUsedForCall.push(...callResult.overloadsUsedForCall);
104
+ overloadsUsedForCall.push(...initCallResult.overloadsUsedForCall);
106
105
  }
107
- }
108
- validatedTypes = true;
109
- skipUnknownArgCheck = true;
110
- }
111
- // Validate __new__
112
- // Don't report errors for __new__ if __init__ already generated errors. They're
113
- // probably going to be entirely redundant anyway.
114
- if (!argumentErrors && newMethodInfo && !shouldSkipConstructorCheck(newMethodInfo.type)) {
115
- const constructorMethodType = newMethodInfo.type;
116
- let newReturnType;
117
- // If there is an expected type that was not applied above when
118
- // handling the __init__ method, try to apply it with the __new__ method.
119
- if (inferenceContext && !returnType) {
120
- const expectedCallResult = validateConstructorMethodWithContext(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, constructorMethodType);
121
- if (expectedCallResult && !expectedCallResult.argumentErrors) {
122
- newReturnType = expectedCallResult.returnType;
123
- returnType = newReturnType;
124
- if (expectedCallResult.isTypeIncomplete) {
125
- isTypeIncomplete = true;
126
- }
106
+ if (initCallResult.isTypeIncomplete) {
107
+ isTypeIncomplete = true;
127
108
  }
109
+ returnType = initCallResult.returnType;
110
+ validatedArgExpressions = true;
111
+ skipUnknownArgCheck = true;
128
112
  }
129
- const typeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(type));
130
- if (type.typeAliasInfo) {
131
- typeVarContext.addSolveForScope(type.typeAliasInfo.typeVarScopeId);
132
- }
133
- typeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(constructorMethodType));
134
- // Use speculative mode if we're going to later apply a constructor transform.
135
- // This allows us to use bidirectional type inference for arguments in the transform.
136
- const callResult = evaluator.useSpeculativeMode((0, constructorTransform_1.hasConstructorTransform)(type) ? errorNode : undefined, () => {
137
- return evaluator.validateCallArguments(errorNode, argList, newMethodInfo, typeVarContext, skipUnknownArgCheck);
138
- });
139
- if (callResult.isTypeIncomplete) {
140
- isTypeIncomplete = true;
113
+ }
114
+ if (!validatedArgExpressions && newMethodTypeResult) {
115
+ // If we skipped the __init__ method and the __new__ method was evaluated only
116
+ // speculatively, evaluate it non-speculatively now so we can report errors.
117
+ if (!evaluator.isSpeculativeModeInUse(errorNode)) {
118
+ validateNewMethod(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, newMethodTypeResult,
119
+ /* useSpeculativeModeForArgs */ false);
141
120
  }
121
+ validatedArgExpressions = true;
122
+ returnType = newMethodReturnType;
123
+ }
124
+ // If the class doesn't override object.__new__ or object.__init__, use the
125
+ // fallback constructor type evaluation for the `object` class.
126
+ if (!newMethodTypeResult && !initMethodTypeResult) {
127
+ const callResult = validateFallbackConstructorCall(evaluator, errorNode, argList, type, inferenceContext);
142
128
  if (callResult.argumentErrors) {
143
129
  argumentErrors = true;
144
130
  }
145
- else if (!newReturnType) {
146
- newReturnType = callResult.returnType;
147
- if (overloadsUsedForCall.length === 0) {
148
- overloadsUsedForCall.push(...callResult.overloadsUsedForCall);
149
- }
150
- // If the constructor returned an object whose type matches the class of
151
- // the original type being constructed, use the return type in case it was
152
- // specialized. If it doesn't match, we'll fall back on the assumption that
153
- // the constructed type is an instance of the class type. We need to do this
154
- // in cases where we're inferring the return type based on a call to
155
- // super().__new__().
156
- if (newReturnType) {
157
- if ((0, types_1.isClassInstance)(newReturnType) && types_1.ClassType.isSameGenericClass(newReturnType, type)) {
158
- // If the specialized return type derived from the __init__
159
- // method is "better" than the return type provided by the
160
- // __new__ method (where "better" means that the type arguments
161
- // are all known), stick with the __init__ result.
162
- if ((!(0, typeUtils_1.isPartlyUnknown)(newReturnType) && !(0, typeUtils_1.requiresSpecialization)(newReturnType)) ||
163
- returnType === undefined) {
164
- // Special-case the 'tuple' type specialization to use
165
- // the homogenous arbitrary-length form.
166
- if ((0, types_1.isClassInstance)(newReturnType) &&
167
- types_1.ClassType.isTupleClass(newReturnType) &&
168
- !newReturnType.tupleTypeArguments &&
169
- newReturnType.typeArguments &&
170
- newReturnType.typeArguments.length === 1) {
171
- newReturnType = (0, typeUtils_1.specializeTupleClass)(newReturnType, [
172
- { type: newReturnType.typeArguments[0], isUnbounded: true },
173
- ]);
174
- }
175
- returnType = newReturnType;
176
- }
177
- }
178
- else if (!returnType && !(0, types_1.isUnknown)(newReturnType)) {
179
- returnType = newReturnType;
180
- }
181
- }
182
- }
183
- if (!returnType) {
184
- returnType = applyExpectedTypeForConstructor(evaluator, type, inferenceContext, typeVarContext);
131
+ else {
132
+ (0, collectionUtils_1.appendArray)(overloadsUsedForCall, callResult.overloadsUsedForCall);
185
133
  }
186
- else if ((0, types_1.isClassInstance)(returnType) && (0, typeUtils_1.isTupleClass)(returnType) && !returnType.tupleTypeArguments) {
187
- returnType = applyExpectedTypeForTupleConstructor(returnType, inferenceContext);
134
+ if (callResult.isTypeIncomplete) {
135
+ isTypeIncomplete = true;
188
136
  }
189
- validatedTypes = true;
137
+ returnType = (_a = callResult.returnType) !== null && _a !== void 0 ? _a : types_1.UnknownType.create();
190
138
  }
191
- }
192
- // If we weren't able to validate the args, analyze the expressions here
193
- // to mark symbols referenced and report expression evaluation errors.
194
- if (!validatedTypes) {
195
- argList.forEach((arg) => {
196
- if (arg.valueExpression && !evaluator.isSpeculativeModeInUse(arg.valueExpression)) {
197
- evaluator.getTypeOfExpression(arg.valueExpression);
198
- }
199
- });
200
- }
139
+ });
201
140
  // Apply a constructor transform if applicable.
202
- if (!argumentErrors && returnType) {
141
+ if (!argumentErrors && returnType && useConstructorTransform) {
203
142
  const transformed = (0, constructorTransform_1.applyConstructorTransform)(evaluator, errorNode, argList, type, {
204
143
  argumentErrors,
205
144
  returnType,
@@ -212,10 +151,153 @@ function validateConstructorArguments(evaluator, errorNode, argList, type, skipU
212
151
  if (transformed.argumentErrors) {
213
152
  argumentErrors = true;
214
153
  }
154
+ validatedArgExpressions = true;
155
+ }
156
+ // If we weren't able to validate the args, analyze the expressions here
157
+ // to mark symbols referenced and report expression evaluation errors.
158
+ if (!validatedArgExpressions) {
159
+ argList.forEach((arg) => {
160
+ if (arg.valueExpression && !evaluator.isSpeculativeModeInUse(arg.valueExpression)) {
161
+ evaluator.getTypeOfExpression(arg.valueExpression);
162
+ }
163
+ });
215
164
  }
216
165
  return { argumentErrors, returnType, isTypeIncomplete, overloadsUsedForCall };
217
166
  }
218
167
  exports.validateConstructorArguments = validateConstructorArguments;
168
+ // Evaluates the __new__ method for type correctness. If useSpeculativeModeForArgs
169
+ // is true, use speculative mode to evaluate the arguments (unless an argument
170
+ // error is produced, in which case it's OK to use speculative mode).
171
+ function validateNewMethod(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, newMethodTypeResult, useSpeculativeModeForArgs) {
172
+ let newReturnType;
173
+ let isTypeIncomplete = false;
174
+ let argumentErrors = false;
175
+ const overloadsUsedForCall = [];
176
+ const typeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(type));
177
+ typeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(newMethodTypeResult.type));
178
+ if (type.typeAliasInfo) {
179
+ typeVarContext.addSolveForScope(type.typeAliasInfo.typeVarScopeId);
180
+ }
181
+ const callResult = evaluator.useSpeculativeMode(useSpeculativeModeForArgs ? errorNode : undefined, () => {
182
+ return evaluator.validateCallArguments(errorNode, argList, newMethodTypeResult, typeVarContext, skipUnknownArgCheck, inferenceContext);
183
+ });
184
+ if (callResult.isTypeIncomplete) {
185
+ isTypeIncomplete = true;
186
+ }
187
+ if (callResult.argumentErrors) {
188
+ argumentErrors = true;
189
+ // Evaluate the arguments in a non-speculative manner to generate any diagnostics.
190
+ typeVarContext.unlock();
191
+ evaluator.validateCallArguments(errorNode, argList, newMethodTypeResult, typeVarContext, skipUnknownArgCheck);
192
+ }
193
+ else {
194
+ newReturnType = callResult.returnType;
195
+ if (overloadsUsedForCall.length === 0) {
196
+ overloadsUsedForCall.push(...callResult.overloadsUsedForCall);
197
+ }
198
+ // If the constructor returned an object whose type matches the class of
199
+ // the original type being constructed, use the return type in case it was
200
+ // specialized. If it doesn't match, we'll fall back on the assumption that
201
+ // the constructed type is an instance of the class type. We need to do this
202
+ // in cases where we're inferring the return type based on a call to
203
+ // super().__new__().
204
+ if (newReturnType) {
205
+ if ((0, types_1.isClassInstance)(newReturnType) && types_1.ClassType.isSameGenericClass(newReturnType, type)) {
206
+ // If the specialized return type derived from the __init__
207
+ // method is "better" than the return type provided by the
208
+ // __new__ method (where "better" means that the type arguments
209
+ // are all known), stick with the __init__ result.
210
+ if (!(0, typeUtils_1.isPartlyUnknown)(newReturnType) && !(0, typeUtils_1.requiresSpecialization)(newReturnType)) {
211
+ // Special-case the 'tuple' type specialization to use
212
+ // the homogenous arbitrary-length form.
213
+ if ((0, types_1.isClassInstance)(newReturnType) &&
214
+ types_1.ClassType.isTupleClass(newReturnType) &&
215
+ !newReturnType.tupleTypeArguments &&
216
+ newReturnType.typeArguments &&
217
+ newReturnType.typeArguments.length === 1) {
218
+ newReturnType = (0, typeUtils_1.specializeTupleClass)(newReturnType, [
219
+ { type: newReturnType.typeArguments[0], isUnbounded: true },
220
+ ]);
221
+ }
222
+ }
223
+ }
224
+ }
225
+ }
226
+ if (!newReturnType) {
227
+ newReturnType = applyExpectedTypeForConstructor(evaluator, type, inferenceContext, typeVarContext);
228
+ }
229
+ else if ((0, types_1.isClassInstance)(newReturnType) && (0, typeUtils_1.isTupleClass)(newReturnType) && !newReturnType.tupleTypeArguments) {
230
+ newReturnType = applyExpectedTypeForTupleConstructor(newReturnType, inferenceContext);
231
+ }
232
+ return { argumentErrors, returnType: newReturnType, isTypeIncomplete, overloadsUsedForCall };
233
+ }
234
+ function validateInitMethod(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, initMethodType) {
235
+ let returnType;
236
+ let isTypeIncomplete = false;
237
+ let argumentErrors = false;
238
+ const overloadsUsedForCall = [];
239
+ // If there is an expected type, analyze the __init__ call for each of the
240
+ // subtypes that comprise the expected type. If one or more analyzes with no
241
+ // errors, use those results. This requires special-case processing because
242
+ // the __init__ method doesn't return the expected type. It always
243
+ // returns None.
244
+ if (inferenceContext) {
245
+ returnType = (0, typeUtils_1.mapSubtypes)(inferenceContext.expectedType, (expectedSubType) => {
246
+ expectedSubType = (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(expectedSubType);
247
+ const typeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(type));
248
+ typeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(initMethodType));
249
+ if ((0, constraintSolver_1.populateTypeVarContextBasedOnExpectedType)(evaluator, types_1.ClassType.cloneAsInstance(type), expectedSubType, typeVarContext, (0, parseTreeUtils_1.getTypeVarScopesForNode)(errorNode))) {
250
+ const specializedConstructor = (0, typeUtils_1.applySolvedTypeVars)(initMethodType, typeVarContext);
251
+ let callResult;
252
+ callResult = evaluator.useSpeculativeMode(errorNode, () => {
253
+ return evaluator.validateCallArguments(errorNode, argList, { type: specializedConstructor }, typeVarContext.clone(), skipUnknownArgCheck);
254
+ });
255
+ if (!callResult.argumentErrors) {
256
+ // Call validateCallArguments again, this time without speculative
257
+ // mode, so any errors are reported.
258
+ callResult = evaluator.validateCallArguments(errorNode, argList, { type: specializedConstructor }, typeVarContext, skipUnknownArgCheck);
259
+ if (callResult.isTypeIncomplete) {
260
+ isTypeIncomplete = true;
261
+ }
262
+ if (callResult.argumentErrors) {
263
+ argumentErrors = true;
264
+ }
265
+ (0, collectionUtils_1.appendArray)(overloadsUsedForCall, callResult.overloadsUsedForCall);
266
+ return applyExpectedSubtypeForConstructor(evaluator, type, expectedSubType, typeVarContext);
267
+ }
268
+ }
269
+ return undefined;
270
+ });
271
+ if ((0, types_1.isNever)(returnType) || argumentErrors) {
272
+ returnType = undefined;
273
+ }
274
+ }
275
+ if (!returnType) {
276
+ const typeVarContext = type.typeArguments
277
+ ? (0, typeUtils_1.buildTypeVarContextFromSpecializedClass)(type, /* makeConcrete */ false)
278
+ : new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(type));
279
+ typeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(initMethodType));
280
+ const callResult = evaluator.validateCallArguments(errorNode, argList, { type: initMethodType }, typeVarContext, skipUnknownArgCheck);
281
+ let adjustedClassType = type;
282
+ if (callResult.specializedInitSelfType &&
283
+ (0, types_1.isClassInstance)(callResult.specializedInitSelfType) &&
284
+ types_1.ClassType.isSameGenericClass(callResult.specializedInitSelfType, adjustedClassType)) {
285
+ adjustedClassType = types_1.ClassType.cloneAsInstantiable(callResult.specializedInitSelfType);
286
+ }
287
+ returnType = applyExpectedTypeForConstructor(evaluator, adjustedClassType,
288
+ /* inferenceContext */ undefined, typeVarContext);
289
+ if (callResult.isTypeIncomplete) {
290
+ isTypeIncomplete = true;
291
+ }
292
+ if (callResult.argumentErrors) {
293
+ argumentErrors = true;
294
+ }
295
+ else {
296
+ overloadsUsedForCall.push(...callResult.overloadsUsedForCall);
297
+ }
298
+ }
299
+ return { argumentErrors, returnType, isTypeIncomplete, overloadsUsedForCall };
300
+ }
219
301
  function validateFallbackConstructorCall(evaluator, errorNode, argList, type, inferenceContext) {
220
302
  let reportedErrors = false;
221
303
  if (argList.length > 0) {
@@ -267,51 +349,11 @@ function validateMetaclassCall(evaluator, errorNode, argList, type, skipUnknownA
267
349
  }
268
350
  return undefined;
269
351
  }
270
- // For a constructor call that targets a generic class and an "expected type"
271
- // (i.e. bidirectional inference), this function attempts to infer the correct
272
- // specialized return type for the constructor.
273
- function validateConstructorMethodWithContext(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, constructorMethodType) {
274
- let isTypeIncomplete = false;
275
- let argumentErrors = false;
276
- const overloadsUsedForCall = [];
277
- const returnType = (0, typeUtils_1.mapSubtypes)(inferenceContext.expectedType, (expectedSubType) => {
278
- expectedSubType = (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(expectedSubType);
279
- const typeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(type));
280
- typeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(constructorMethodType));
281
- if ((0, constraintSolver_1.populateTypeVarContextBasedOnExpectedType)(evaluator, types_1.ClassType.cloneAsInstance(type), expectedSubType, typeVarContext, (0, parseTreeUtils_1.getTypeVarScopesForNode)(errorNode))) {
282
- const specializedConstructor = (0, typeUtils_1.applySolvedTypeVars)(constructorMethodType, typeVarContext);
283
- let callResult;
284
- evaluator.useSpeculativeMode(errorNode, () => {
285
- callResult = evaluator.validateCallArguments(errorNode, argList, { type: specializedConstructor }, typeVarContext.clone(), skipUnknownArgCheck);
286
- });
287
- if (!callResult.argumentErrors) {
288
- // Call validateCallArguments again, this time without speculative
289
- // mode, so any errors are reported.
290
- callResult = evaluator.validateCallArguments(errorNode, argList, { type: specializedConstructor }, typeVarContext, skipUnknownArgCheck);
291
- if (callResult.isTypeIncomplete) {
292
- isTypeIncomplete = true;
293
- }
294
- if (callResult.argumentErrors) {
295
- argumentErrors = true;
296
- }
297
- overloadsUsedForCall.push(...callResult.overloadsUsedForCall);
298
- return applyExpectedSubtypeForConstructor(evaluator, type, expectedSubType, inferenceContext, typeVarContext);
299
- }
300
- }
301
- return undefined;
352
+ function applyExpectedSubtypeForConstructor(evaluator, type, expectedSubtype, typeVarContext) {
353
+ const specializedType = (0, typeUtils_1.applySolvedTypeVars)(types_1.ClassType.cloneAsInstance(type), typeVarContext, {
354
+ applyInScopePlaceholders: true,
302
355
  });
303
- if ((0, types_1.isNever)(returnType)) {
304
- return undefined;
305
- }
306
- return { returnType, isTypeIncomplete, argumentErrors, overloadsUsedForCall };
307
- }
308
- function applyExpectedSubtypeForConstructor(evaluator, type, expectedSubtype, inferenceContext, typeVarContext) {
309
- var _a;
310
- const specializedType = (0, typeUtils_1.applySolvedTypeVars)(types_1.ClassType.cloneAsInstance(type), typeVarContext);
311
- if (!evaluator.assignType(expectedSubtype, specializedType,
312
- /* diag */ undefined,
313
- /* destTypeVarContext */ (_a = inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.typeVarContext) === null || _a === void 0 ? void 0 : _a.clone(),
314
- /* srcTypeVarContext */ undefined)) {
356
+ if (!evaluator.assignType(expectedSubtype, specializedType)) {
315
357
  return undefined;
316
358
  }
317
359
  // If the expected type is "Any", transform it to an Any.
@@ -326,7 +368,7 @@ function applyExpectedTypeForConstructor(evaluator, type, inferenceContext, type
326
368
  let unsolvedTypeVarsAreUnknown = true;
327
369
  if (inferenceContext) {
328
370
  const specializedExpectedType = (0, typeUtils_1.mapSubtypes)(inferenceContext.expectedType, (expectedSubtype) => {
329
- return applyExpectedSubtypeForConstructor(evaluator, type, expectedSubtype, inferenceContext, typeVarContext);
371
+ return applyExpectedSubtypeForConstructor(evaluator, type, expectedSubtype, typeVarContext);
330
372
  });
331
373
  if (!(0, types_1.isNever)(specializedExpectedType)) {
332
374
  return specializedExpectedType;
@@ -448,9 +490,26 @@ function createFunctionFromConstructor(evaluator, classType, recursionCount = 0)
448
490
  return constructorFunction;
449
491
  }
450
492
  exports.createFunctionFromConstructor = createFunctionFromConstructor;
451
- // Determines whether we should skip argument validation. This is required
452
- // for certain synthesized constructor types, namely NamedTuples.
453
- function shouldSkipConstructorCheck(type) {
454
- return (0, types_1.isFunction)(type) && types_1.FunctionType.isSkipConstructorCheck(type);
493
+ // If __new__ returns a type that is not an instance of the class, skip the
494
+ // __init__ method evaluation. This is consistent with the behavior of the
495
+ // type.__call__ runtime behavior.
496
+ function shouldSkipInitEvaluation(evaluator, classType, newMethodReturnType) {
497
+ const returnType = evaluator.makeTopLevelTypeVarsConcrete(newMethodReturnType);
498
+ let skipInitCheck = false;
499
+ (0, typeUtils_1.doForEachSubtype)(returnType, (subtype) => {
500
+ if ((0, types_1.isAnyOrUnknown)(subtype)) {
501
+ return;
502
+ }
503
+ if ((0, types_1.isClassInstance)(subtype)) {
504
+ const inheritanceChain = [];
505
+ const isDerivedFrom = types_1.ClassType.isDerivedFrom(subtype, classType, inheritanceChain);
506
+ if (!isDerivedFrom) {
507
+ skipInitCheck = true;
508
+ }
509
+ return;
510
+ }
511
+ skipInitCheck = true;
512
+ });
513
+ return skipInitCheck;
455
514
  }
456
515
  //# sourceMappingURL=constructors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constructors.js","sourceRoot":"","sources":["../../../src/analyzer/constructors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,+DAA2D;AAC3D,uDAAqD;AAErD,yDAAiD;AACjD,yDAA+E;AAC/E,iEAA4F;AAC5F,qDAA2D;AAE3D,2CAcqB;AACrB,qDAAkD;AAClD,mCAciB;AAEjB,kEAAkE;AAClE,yEAAyE;AACzE,4EAA4E;AAC5E,SAAgB,4BAA4B,CACxC,SAAwB,EACxB,SAAyB,EACzB,OAA2B,EAC3B,IAAe,EACf,mBAA4B,EAC5B,gBAA8C;;IAE9C,uEAAuE;IACvE,yEAAyE;IACzE,mCAAmC;IACnC,MAAM,eAAe,GAAG,qBAAqB,CACzC,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EACJ,mBAAmB,EACnB,gBAAgB,CACnB,CAAC;IACF,IAAI,eAAe,EAAE;QACjB,OAAO,eAAe,CAAC;KAC1B;IAED,mEAAmE;IACnE,MAAM,aAAa,GAAG,SAAS,CAAC,wBAAwB,CACpD,SAAS,EACT,IAAI;IACJ,6BAA6B,CAAC,KAAK,EACnC,SAAS,EACT,EAAE,MAAM,EAAE,KAAK,EAAE;IACjB,UAAU,CAAC,SAAS,EACpB;mCACyC;8CACU,EACnD,I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,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC;KACvE;IAED,OAAO,mBAAmB,CAAC;AAC/B,CAAC;AAlID,sEAkIC;AAED,0EAA0E;AAC1E,iEAAiE;AACjE,SAAS,0BAA0B,CAAC,IAAU;IAC1C,OAAO,IAAA,kBAAU,EAAC,IAAI,CAAC,IAAI,oBAAY,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;AACzE,CAAC"}
1
+ {"version":3,"file":"constructors.js","sourceRoot":"","sources":["../../../src/analyzer/constructors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,+DAAwD;AACxD,+DAA2D;AAC3D,uDAAqD;AAErD,yDAAiD;AACjD,yDAA+E;AAC/E,iEAA4F;AAC5F,qDAA2D;AAE3D,2CAeqB;AACrB,qDAAkD;AAClD,mCAgBiB;AAEjB,kEAAkE;AAClE,yEAAyE;AACzE,4EAA4E;AAC5E,SAAgB,4BAA4B,CACxC,SAAwB,EACxB,SAAyB,EACzB,OAA2B,EAC3B,IAAe,EACf,mBAA4B,EAC5B,gBAA8C;IAE9C,uEAAuE;IACvE,yEAAyE;IACzE,mCAAmC;IACnC,MAAM,eAAe,GAAG,qBAAqB,CACzC,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EACJ,mBAAmB,EACnB,gBAAgB,CACnB,CAAC;IACF,IAAI,eAAe,EAAE;QACjB,OAAO,eAAe,CAAC;KAC1B;IAED,mEAAmE;IACnE,MAAM,mBAAmB,GAAG,SAAS,CAAC,wBAAwB,CAC1D,SAAS,EACT,IAAI;IACJ,6BAA6B,CAAC,KAAK,EACnC,SAAS,EACT,EAAE,MAAM,EAAE,KAAK,EAAE;IACjB,UAAU,CAAC,SAAS,EACpB;mCACyC;8CACU,EACnD,IAAI,CACP,CAAC;IAEF,IAAI,UAA4B,CAAC;IACjC,IAAI,uBAAuB,GAAG,KAAK,CAAC;IACpC,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,IAAI,gB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;QACvE,mBAAmB,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC;KACvE;IAED,OAAO,mBAAmB,CAAC;AAC/B,CAAC;AAlID,sEAkIC;AAED,2EAA2E;AAC3E,0EAA0E;AAC1E,kCAAkC;AAClC,SAAS,wBAAwB,CAAC,SAAwB,EAAE,SAAoB,EAAE,mBAAyB;IACvG,MAAM,UAAU,GAAG,SAAS,CAAC,4BAA4B,CAAC,mBAAmB,CAAC,CAAC;IAE/E,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,IAAA,4BAAgB,EAAC,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE;QACrC,IAAI,IAAA,sBAAc,EAAC,OAAO,CAAC,EAAE;YACzB,OAAO;SACV;QAED,IAAI,IAAA,uBAAe,EAAC,OAAO,CAAC,EAAE;YAC1B,MAAM,gBAAgB,GAAqB,EAAE,CAAC;YAC9C,MAAM,aAAa,GAAG,iBAAS,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;YAEpF,IAAI,CAAC,aAAa,EAAE;gBAChB,aAAa,GAAG,IAAI,CAAC;aACxB;YAED,OAAO;SACV;QAED,aAAa,GAAG,IAAI,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACzB,CAAC"}
@@ -52,6 +52,9 @@ function synthesizeDataClassMethods(evaluator, node, classType, skipSynthesizeIn
52
52
  const classTypeVar = (0, typeUtils_1.synthesizeTypeVarForSelfCls)(classType, /* isClsParam */ true);
53
53
  const newType = types_1.FunctionType.createSynthesizedInstance('__new__', 1 /* ConstructorMethod */);
54
54
  const initType = types_1.FunctionType.createSynthesizedInstance('__init__');
55
+ // Override `__new__` because some dataclasses (such as those that are
56
+ // created by subclassing from NamedTuple) may have their own custom
57
+ // __new__ that requires overriding.
55
58
  types_1.FunctionType.addParameter(newType, {
56
59
  category: 0 /* Simple */,
57
60
  name: 'cls',
@@ -472,10 +475,10 @@ function synthesizeDataClassMethods(evaluator, node, classType, skipSynthesizeIn
472
475
  const hashMethod = types_1.FunctionType.createSynthesizedInstance('__hash__');
473
476
  types_1.FunctionType.addParameter(hashMethod, selfParam);
474
477
  hashMethod.details.declaredReturnType = evaluator.getBuiltInObject(node, 'int');
475
- symbolTable.set('__hash__', symbol_1.Symbol.createWithType(4 /* ClassMember */, hashMethod));
478
+ symbolTable.set('__hash__', symbol_1.Symbol.createWithType(4 /* ClassMember */ | 4096 /* IgnoredForOverrideChecks */, hashMethod));
476
479
  }
477
480
  else if (synthesizeHashNone && !skipSynthesizeHash) {
478
- symbolTable.set('__hash__', symbol_1.Symbol.createWithType(4 /* ClassMember */, types_1.NoneType.createInstance()));
481
+ symbolTable.set('__hash__', symbol_1.Symbol.createWithType(4 /* ClassMember */ | 4096 /* IgnoredForOverrideChecks */, types_1.NoneType.createInstance()));
479
482
  }
480
483
  let dictType = evaluator.getBuiltInType(node, 'dict');
481
484
  if ((0, types_1.isInstantiableClass)(dictType)) {