Skip to content

Conversation

ytetsuro
Copy link
Contributor

@ytetsuro ytetsuro commented May 22, 2021

Example

const engine = new PHPParser.Engine({
      parser: {
        extractDoc: true,
      },
      lexer: {
        all_tokens: true,
      },
    });

const tokens: (string|string[])[] = engine.tokenGetAll('<?php echo "hello";'); // error

Expected

No error.

Actual

I happen error following.

Type 'String[]' is not assignable to type 'string[]'.

The return value of tokenGetAll is represented in the doc comment as an array of AST's String class, but it is actually an array of strings.

@coveralls
Copy link

coveralls commented May 22, 2021

Coverage Status

Coverage remained the same at 96.142% when pulling 0600e4c on ytetsuro:fix/ASTStringToString into 1471870 on glayzzle:master.

Copy link
Member

@ichiriac ichiriac left a comment

Choose a reason for hiding this comment

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

👍 thanks @ytetsuro

@ichiriac ichiriac merged commit 1f55eb7 into glayzzle:master Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants