mirror of
https://github.com/danog/psalm.git
synced 2024-12-12 09:19:40 +01:00
d10b1f91bb
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](
|
||
---|---|---|
.. | ||
CodeLocation | ||
Config | ||
Exception | ||
Internal | ||
Issue | ||
Node | ||
Plugin | ||
Progress | ||
Report | ||
SourceControl | ||
Storage | ||
Type | ||
Aliases.php | ||
Codebase.php | ||
CodeLocation.php | ||
Config.php | ||
Context.php | ||
DocComment.php | ||
ErrorBaseline.php | ||
FileBasedPluginAdapter.php | ||
FileManipulation.php | ||
FileSource.php | ||
IssueBuffer.php | ||
NodeTypeProvider.php | ||
PluginFileExtensionsSocket.php | ||
PluginRegistrationSocket.php | ||
Report.php | ||
StatementsSource.php | ||
Type.php |