-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash on lambda in generic context with generic method in body (#…
…15155) Fixes #15060 The example in the issue contains another case where an erased type may legitimately appear in a generic function. Namely, when we have a lambda in a generic context, and its body contains a call to a generic _method_. First, since we infer the type of lambda in erased context, some of lambda parameters may get assigned a type containing erased components. Then, when accessing a generic method on such type we may get a callable that is both generic and has erased components, thus causing the crash (actually there are two very similar crashes depending on the details of the generic method). Provided that we now have two legitimate cases for erased type appearing in `expand_type()`, and special-casing (enabling) them would be tricky (a lot of functions will need to have `allow_erased_callables`), I propose to simply remove the check. Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
- Loading branch information
1 parent
6f28cc3
commit 9f69bea
Showing
4 changed files
with
28 additions
and
36 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