-
Notifications
You must be signed in to change notification settings - Fork 660
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
InvalidDocblock: Invalid array key type type-alias(...) #10503
Comments
I found these snippets: https://psalm.dev/r/e02932aa33<?php
/**
* @psalm-type ValueOfGreetings = Greetings::*
*/
class Greetings {
public const HI = 'hi';
public const HELLO = 'hello';
}
/**
* @psalm-import-type ValueOfGreetings from Greetings
*/
class Greetor {
/**
* @return array<ValueOfGreetings, string>
*/
public function getAll() {
return [
Greetings::HI => "mom",
Greetings::HELLO => "world",
];
}
}
|
ging-dev
added a commit
to ging-dev/psalm
that referenced
this issue
Dec 19, 2023
ging-dev
added a commit
to ging-dev/psalm
that referenced
this issue
Dec 19, 2023
ging-dev
added a commit
to ging-dev/psalm
that referenced
this issue
Dec 19, 2023
ging-dev
added a commit
to ging-dev/psalm
that referenced
this issue
Dec 20, 2023
ging-dev
added a commit
to ging-dev/psalm
that referenced
this issue
Dec 20, 2023
Merged
orklah
added a commit
that referenced
this issue
Jan 9, 2024
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When importing a type and using it as the array key in another type, then I get the following error:
I didn't manage to reproduce it in the playground, probably because the psalm version differs with the one on my machine. I'm using version
5.18.0
. In any case this is the reproduction I wrote at the playground:https://psalm.dev/r/e02932aa33
The text was updated successfully, but these errors were encountered: