mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-05 12:27:30 +03:00
None derives from object.
This commit is contained in:
parent
42a19a82c5
commit
017c21dcb1
@ -10,9 +10,9 @@ import * as assert from 'assert';
|
||||
|
||||
import { ParameterCategory } from '../parser/parseNodes';
|
||||
import { Symbol } from './symbol';
|
||||
import { ClassType, FunctionType, ObjectType,
|
||||
OverloadedFunctionType, TupleType, Type, TypeCategory, TypeVarType,
|
||||
UnboundType, UnionType, UnknownType } from './types';
|
||||
import { ClassType, FunctionType, NoneType,
|
||||
ObjectType, OverloadedFunctionType, TupleType, Type, TypeCategory,
|
||||
TypeVarType, UnboundType, UnionType, UnknownType } from './types';
|
||||
|
||||
export interface ClassMember {
|
||||
symbol?: Symbol;
|
||||
@ -173,6 +173,16 @@ export class TypeUtils {
|
||||
return true;
|
||||
}
|
||||
|
||||
// None derives from object.
|
||||
if (srcType instanceof NoneType) {
|
||||
if (destType instanceof ObjectType) {
|
||||
let destClassType = destType.getClassType();
|
||||
if (destClassType.isBuiltIn() && destClassType.getClassName() === 'object') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user