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](
|
||
---|---|---|
.. | ||
Algebra | ||
Analyzer | ||
Cli | ||
Codebase | ||
DataFlow | ||
Diff | ||
ExecutionEnvironment | ||
FileManipulation | ||
Fork | ||
Json | ||
LanguageServer | ||
PhpTraverser | ||
PhpVisitor | ||
PluginManager | ||
Provider | ||
Scanner | ||
Scope | ||
Stubs/Generator | ||
Type | ||
TypeVisitor | ||
Algebra.php | ||
Clause.php | ||
CliUtils.php | ||
Composer.php | ||
ErrorHandler.php | ||
EventDispatcher.php | ||
IncludeCollector.php | ||
MethodIdentifier.php | ||
ReferenceConstraint.php | ||
RuntimeCaches.php |