1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 09:19:40 +01:00
psalm/src/Psalm/Internal
Anner Visser d10b1f91bb
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](1986c8b4a8/src/Psalm/Type/Atomic.php (L407))
2022-11-15 14:46:31 +01:00
..
Algebra Applied ArraySpreadInsteadOfArrayMergeRector (take 2) 2022-07-29 18:17:21 -04:00
Analyzer Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
Cli improve annotation 2022-11-11 20:17:05 -05:00
Codebase Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
DataFlow Immutable unions (#8627) 2022-11-04 19:04:23 +01:00
Diff Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ExecutionEnvironment Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
FileManipulation Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
Fork Immutable unions (#8627) 2022-11-04 19:04:23 +01:00
Json
LanguageServer Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
PhpTraverser
PhpVisitor Allow using imported types in other types within the same file 2022-11-15 14:46:31 +01:00
PluginManager Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
Provider Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
Scanner Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
Scope
Stubs/Generator Immutable readonly 3 2022-10-03 15:13:47 +02:00
Type Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
TypeVisitor Emit DeprecatedInterface when an interface is referenced in a generic 2022-11-08 20:34:08 -04:00
Algebra.php Merge branch '4.x' 2022-07-07 15:01:38 -05:00
Clause.php Fix tests 2022-11-08 10:45:21 +01:00
CliUtils.php Immutable readonly 3 2022-10-03 15:13:47 +02:00
Composer.php
ErrorHandler.php
EventDispatcher.php Applied ArraySpreadInsteadOfArrayMergeRector (take 2) 2022-07-29 18:17:21 -04:00
IncludeCollector.php Applied ArraySpreadInsteadOfArrayMergeRector (take 2) 2022-07-29 18:17:21 -04:00
MethodIdentifier.php Immutable unions (#8627) 2022-11-04 19:04:23 +01:00
ReferenceConstraint.php Immutable Unions 2022-10-03 10:45:36 +02:00
RuntimeCaches.php