Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias chains are not understood #6330

Closed
weirdan opened this issue Aug 17, 2021 · 2 comments · Fixed by #6335
Closed

Alias chains are not understood #6330

weirdan opened this issue Aug 17, 2021 · 2 comments · Fixed by #6335
Labels

Comments

@weirdan
Copy link
Collaborator

weirdan commented Aug 17, 2021

https://psalm.dev/r/db0e8cc040 is valid: https://3v4l.org/1OFJK

@weirdan weirdan added the bug label Aug 17, 2021
@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/db0e8cc040
<?php
interface I {}
class_alias(I::class, I1::class);
class_alias(I1::class, I2::class);

class C implements I2 {}

function f(I1 $_): void {}

f(new C);
Psalm output (using commit fdd286f):

ERROR: UndefinedClass - 4:24 - Class, interface or enum named I2 does not exist

INFO: MixedArgument - 4:24 - Argument 2 of class_alias cannot be mixed, expecting string

ERROR: MissingDependency - 10:7 - C depends on class or interface i1 that does not exist

INFO: MixedArgument - 10:3 - Argument 1 of f cannot be mixed, expecting I1

ERROR: UndefinedClass - 6:20 - Class, interface or enum named I2 does not exist

@boesing
Copy link
Contributor

boesing commented Aug 18, 2021

I've added a fix for this issue in #6335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants