-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working
Description
Describe the bug
Pyright takes 10 seconds to type-check the code below, while for Mypy it's 0.4 seconds. This issue comes from #7612.
Code or Screenshots
The repro could probably be smaller, I'm sorry for this. Note that the more
x: NodeFile
y: Node = x
I add, the slower it becomes.
import typing
class NodeFile(typing.TypedDict, total=False):
name: typing.Literal["FILE"]
class NodeDocument(typing.TypedDict, total=False):
name: typing.Literal["DOCUMENTDEF"]
children: list[typing.Union['NodeField', 'NodeGroup', 'NodeValidation', 'NodeFormat', 'NodeEnv', 'NodePreValidation', 'NodeImports']]
class NodeGroup(typing.TypedDict, total=False):
name: typing.Literal["GROUPDEF"]
children: list[typing.Union['NodeField', 'NodeGroup', 'NodeValidation', 'NodeHelp', 'NodeEnv', 'NodePreValidation']]
class NodeField(typing.TypedDict, total=False):
name: typing.Literal["FIELDDEF"]
children: list[typing.Union['NodeValidation', 'NodeHelp', 'NodeFormat']]
class NodeJava(typing.TypedDict, total=False):
name: typing.Literal["java"]
text: str
class NodeFieldFormat(typing.TypedDict, total=False):
name: typing.Literal["FIELDFMT"]
text: str
class NodeValidation(typing.TypedDict, total=False):
name: typing.Literal["VALIDATION"]
children: list['NodeJava']
class NodeImports(typing.TypedDict, total=False):
name: typing.Literal["IMPORTS"]
text: str
class NodeFormat(typing.TypedDict, total=False):
name: typing.Literal["FORMAT"]
children: list[typing.Union['NodeDelimiter', 'NodeFieldFormat']]
class NodePreValidation(typing.TypedDict, total=False):
name: typing.Literal["PREVALIDATION"]
children: list['NodeJava']
class NodeHelp(typing.TypedDict, total=False):
name: typing.Literal["HELP"]
text: str
class NodeEnv(typing.TypedDict, total=False):
name: typing.Literal["ENVIRONMENT"]
children: list['NodeJava']
class NodeDelimiter(typing.TypedDict, total=False):
name: typing.Literal["DELIMITER"]
text: str
Node = typing.Union['NodeFile', 'NodeDocument', 'NodeGroup', 'NodeField', 'NodeJava', 'NodeFieldFormat', 'NodeValidation', 'NodeImports', 'NodeFormat', 'NodePreValidation', 'NodeHelp', 'NodeEnv', 'NodeDelimiter']
x: NodeFile
y: Node = x
x: NodeFile
y: Node = x
x: NodeFile
y: Node = x
x: NodeFile
y: Node = x
x: NodeFile
y: Node = xVS Code extension or command-line
Command line, 1.1.357
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working