forked from crystal-lang/crystal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compiler: refactor and slightly optimize merging two types (crystal-l…
…ang#12436) * Use early returns in type_merge_two * Don't flip types in type_merge_two * Don't return tuple in type_merge_two * Add some type annotations * Rename type_merge_two to just type_merge * Avoid creating intermediate array in Type.merge! * Add a few more type annotations * Generalize the case of a non-union type merged with a union type * Consider NoReturn when merging two types * Use suffix if and add a few more comments * Don't create intermediate arrays when calling Type.merge!
- Loading branch information
Showing
3 changed files
with
44 additions
and
52 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