-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eliminate unbound
TypeVar
s on argtypes
construction
This commit eliminates unbound `TypeVar`s from `argtypes` in order to make the analysis much easier down the road. At runtime, only `Type{...}::DataType` can contain invalid type parameters, but we may have arbitrary malformed user-constructed type arguments given at inference entries. So we will replace only the malformed `Type{...}::DataType` with `Type` and simply replace other possibilities with `Any`. The replacement might not be that accurate, but an unbound `TypeVar` is really invalid in anyway. Like the change added on `arrayref_tfunc`, now we may be able to remove some `isa(x, TypeVar)`/`has_free_typevars` predicates used in various places, but it is left as an exercise for the reader. (cherry picked from commit 36cc1c1)
- Loading branch information
1 parent
bbe91db
commit 2a4d14f
Showing
4 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters