Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow using imported types in other types within the same file
In the test case (from issue #7116) both the type definition and the import of the typed lived in the same file. This caused `OpeningTypes` to be an `InlineTypeAlias` instead of a `LinkableTypeAlias`, in turn causing an 'Invalid type alias' exception[^1]. By replacing the array union (+) with an array_merge, the import of the type overrides the initial type declaration within the `Main` class. This means type imports within one file act more like they would when in separate files. Fixes #7116 [^1]: [src/Psalm/Type/Atomic.php:407](https://github.com/vimeo/psalm/blob/1986c8b4a8018b1819bc4b83b0f7e69c2c936792/src/Psalm/Type/Atomic.php#L407)
- Loading branch information
1 parent
2a29fd7
commit d10b1f9
Showing
2 changed files
with
28 additions
and
1 deletion.
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