Skip to content

[NETBEANS-5599] PHP 8.1 Support: Never type - #3340

Merged
tmysik merged 3 commits into
apache:php81-supportfrom
junichi11:php81-never-type
Nov 30, 2021
Merged

[NETBEANS-5599] PHP 8.1 Support: Never type#3340
tmysik merged 3 commits into
apache:php81-supportfrom
junichi11:php81-never-type

Conversation

@junichi11

Copy link
Copy Markdown
Member

https://issues.apache.org/jira/browse/NETBEANS-5599

RFC: https://wiki.php.net/rfc/noreturn_type

  • Convert from UnusableTypesUnhandledError to UnusableTypesHintError

(Part 1)

  • Add hasNeverType() to PhpVersion
  • Fix the lexer
  • Mark as an error if something is returned when the return type is never
  • Mark as an error if never is used at incorrect places (e.g. private never $propertyType)
  • Add unit tests for the lexer and hints

(Part 2)

  • Fix the code completion
  • Add and fix unit tests for the code completion

Screenshot

nb-php81-never-type

- Use `HintErrorRule` instead of `UnhandledError`
- Add unit tests
https://issues.apache.org/jira/browse/NETBEANS-5599

RFC: https://wiki.php.net/rfc/noreturn_type

- Add `hasNeverType()` to `PhpVersion`
- Fix the lexer
- Mark as an error if something is returned when the return type is `never`
- Mark as an error if `never` is used at incorrect places (e.g. private never $propertyType)
- Add unit tests for the lexer and hints
@junichi11 junichi11 added the PHP [ci] enable extra PHP tests (php/php.editor) label Nov 28, 2021
@junichi11 junichi11 added this to the NB13 milestone Nov 28, 2021
@junichi11

Copy link
Copy Markdown
Member Author

CI failed: see #3339

@junichi11
junichi11 requested a review from tmysik November 29, 2021 22:09
@junichi11

Copy link
Copy Markdown
Member Author

@tmysik Could you please have a look at this? If there is no problem, let's merge it. Thanks.

@tmysik tmysik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, many unit tests. Thanks for your great work!

@tmysik
tmysik merged commit f654361 into apache:php81-support Nov 30, 2021
@junichi11

Copy link
Copy Markdown
Member Author

Thank you for your review :)

@junichi11
junichi11 deleted the php81-never-type branch November 30, 2021 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PHP [ci] enable extra PHP tests (php/php.editor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants