1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
psalm/tests
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
..
CommandFunctions Apply literal number separator rector 2022-01-05 01:00:05 +02:00
Config Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
EndToEnd 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
FileUpdates Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
fixtures Merge remote-tracking branch 'origin/4.x' into HEAD 2022-10-16 13:41:27 +02:00
Internal Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
LanguageServer Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
Loop Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
Progress Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
ReturnTypeProvider Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
Template Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
Traits Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
Type Format declare(strict_types=1) 2021-12-15 04:42:37 +01:00
TypeReconciliation Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
AlgebraTest.php Immutable assertions 2022-10-03 11:32:15 +02:00
AnnotationTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ArgTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ArrayAccessTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ArrayAssignmentTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ArrayFunctionCallTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ArrayKeysTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
AssertAnnotationTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
AssignmentTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
AttributeTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
BadFormatTest.php Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
BinaryOperationTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
CallableTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
CastTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
CheckTypeTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
ClassLikeDocblockParserTest.php remove unused imports 2022-01-21 00:17:06 +01:00
ClassLikeStringTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
ClassLoadOrderTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
ClassScopeTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
ClassTest.php Mark inferred mutation-free constructor as such 2022-11-10 19:55:25 -04:00
CloneTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
ClosureTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
CodebaseTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
CommentAnalyzerTest.php Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
ComposerLockTest.php Applied JsonThrowOnErrorRector 2022-01-05 19:32:43 +02:00
ConstantTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ConstValuesTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
CoreStubsTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
DateTimeTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
DeprecatedAnnotationTest.php Emit DeprecatedInterface when an interface is referenced in a generic 2022-11-08 20:34:08 -04:00
DocblockInheritanceTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
DocCommentTest.php Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
DocumentationTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
EnumTest.php Merge pull request #8693 from weirdan/fix-8267 2022-11-10 21:13:12 -04:00
ErrorBaselineTest.php Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
ExtendsFinalClassTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
ExtensionRequirementTest.php Ensure that all entries in test arrays have explicit keys (#7386) 2022-01-13 13:49:37 -05:00
FileDiffTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
FileReferenceTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ForbiddenCodeTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
FunctionCallTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
FunctionLikeDocblockParserTest.php update test cases 2022-06-15 12:31:53 +02:00
GeneratorTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
IfThisIsTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ImmutableAnnotationTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ImplementationRequirementTest.php Ensure that all entries in test arrays have explicit keys (#7386) 2022-01-13 13:49:37 -05:00
IncludeTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
InterfaceTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
InternalAnnotationTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
IntRangeTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
IssueBufferTest.php Strip colours from success message 2022-02-09 15:35:40 +02:00
IssueSuppressionTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
JsonOutputTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
junit.xsd
KeyOfArrayTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ListTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
MagicMethodAnnotationTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
MagicPropertyTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
MatchTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
MethodCallTest.php Implement subtype checks for stringable-object 2022-11-10 19:55:36 -04:00
MethodMutationTest.php Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
MethodSignatureTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
MixinAnnotationTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
NamespaceTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
NativeIntersectionsTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
NativeUnionsTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
Php40Test.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
Php55Test.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
Php56Test.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
Php70Test.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
Php71Test.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
ProjectCheckerTest.php Fix tests. 2022-06-22 01:53:42 -05:00
PropertiesOfTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
PropertyTypeInvarianceTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
PropertyTypeTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
PsalmPluginTest.php drop compatibility aliases 2022-01-19 19:29:16 +01:00
PureAnnotationTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
PureCallableTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
ReadonlyPropertyTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
ReferenceConstraintTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ReferenceTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ReportOutputTest.php Merge remote-tracking branch 'origin/4.x' into HEAD 2022-10-16 13:41:27 +02:00
ReturnTypeTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
somefile.php
StubTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
SuperGlobalsTest.php Fix tests 2022-11-08 10:45:21 +01:00
SwitchTypeTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
TaintTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
TestCase.php Avoid json_encode when serializing non-UTF8 literals 2022-04-27 01:42:37 -04:00
TestConfig.php Enable extensions based on composer.json instead of those loaded at runtime (fixes #5482). 2022-01-27 16:30:14 -06:00
ThisOutTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
ThrowsAnnotationTest.php Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
ThrowsInGlobalScopeTest.php Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
ToStringTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
TraceTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
TraitTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
TryCatchTest.php Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
TypeAnnotationTest.php Allow using imported types in other types within the same file 2022-11-15 14:46:31 +01:00
TypeCombinationTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
TypeComparatorTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
TypeParseTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
UnresolvableIncludeTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
UnusedCodeTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
UnusedVariableTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ValueOfTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
VariadicTest.php Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00