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

resource is a reserved word in @template context #2625

Closed
SignpostMarv opened this issue Jan 15, 2020 · 3 comments
Closed

resource is a reserved word in @template context #2625

SignpostMarv opened this issue Jan 15, 2020 · 3 comments
Labels

Comments

@SignpostMarv
Copy link
Contributor

related to #1644 #2618 https://psalm.dev/r/e903579634

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/e903579634
<?php

/**
* @template T as scalar|array|object|resource|null
*
* @param T $s
*
* @return T
*/
function foo($s) {
  /** @var T */
  return $s;
}
Psalm output (using commit 389af1b):

ERROR: ReservedWord - 6:10 - 'resource' is a reserved word

@SignpostMarv
Copy link
Contributor Author

for completeness have checked, it's fine in @psalm-type context: https://psalm.dev/r/1eb2ffcac4

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/1eb2ffcac4
<?php

/**
* @psalm-type T = scalar|array|object|resource|null
*
* @param T $s
*
* @return T
*/
function foo($s) {
  /** @var T */
  return $s;
}
Psalm output (using commit 389af1b):

No issues!

@muglug muglug added the bug label Jan 15, 2020
@muglug muglug closed this as completed in a840743 Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants