Vscode-intelephense: Expected type 'int'. Found 'numeric'.intelephense(10006)

Created on 21 Feb 2019  路  2Comments  路  Source: bmewburn/vscode-intelephense

...

public static function test(int $param1, int $param2) : int
{
    return ($param1 + $param2);
}

Returned type int is underlined with the message:
Expected type 'int'. Found 'numeric'.intelephense(10006)

resolved in 1.0.3

Most helpful comment

I've a simillar issue:

"Expected Type Closure. Found callable|Function" #10006

image

Had also issues with a return type of self which is gone now, but I don't really know why.

class A {
  public function foo() : self
  {
    return new self();
  }
}

self was underlined in red and the error message was something like the following:

Expected type A found self

All 2 comments

I've a simillar issue:

"Expected Type Closure. Found callable|Function" #10006

image

Had also issues with a return type of self which is gone now, but I don't really know why.

class A {
  public function foo() : self
  {
    return new self();
  }
}

self was underlined in red and the error message was something like the following:

Expected type A found self

@damixxx @jakubjo I can report I鈥檝e encountered both of these scenarios in the last 24 hours too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

muuvmuuv picture muuvmuuv  路  4Comments

9brada6 picture 9brada6  路  3Comments

ottopic picture ottopic  路  3Comments

steven7mwesigwa picture steven7mwesigwa  路  4Comments

umpirsky picture umpirsky  路  4Comments