-
Notifications
You must be signed in to change notification settings - Fork 0
has type errors #3
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type check error found in your pull request.
-
src/Stack.hh
The type Traversable expects 1 type parameter(s)
9: 10: public function __construct(Traversable $items = []) ^^^^^^^^^^^ 11: {
https://github.com/hhpack/hackunit-docker-example/blob/feature/type_errors/src/Stack.hh#L10
-
src/Stack.hh
Wrong type hint
9: 10: public function __construct(Traversable $items = []) ^^^^^^ 11: {
https://github.com/hhpack/hackunit-docker-example/blob/feature/type_errors/src/Stack.hh#L10
This is an object of type Traversable
9: 10: public function __construct(Traversable $items = []) ^^^^^^^^^^^ 11: {
https://github.com/hhpack/hackunit-docker-example/blob/feature/type_errors/src/Stack.hh#L10
It is incompatible with an empty array
9: 10: public function __construct(Traversable $items = []) ^ 11: {
https://github.com/hhpack/hackunit-docker-example/blob/feature/type_errors/src/Stack.hh#L10
-
src/Stack.hh
Invalid argument
11: { 12: $this->items = Set::fromItems($items); ^^^^^^ 13: }
https://github.com/hhpack/hackunit-docker-example/blob/feature/type_errors/src/Stack.hh#L12
This type has 1 arguments
607: */ 608: public static function fromItems<Tv2>(?Traversable<Tv2> $items): Set<Tv2>; ^^^^^^^^^^^ 609:
This one has 0
9: 10: public function __construct(Traversable $items = []) ^^^^^^^^^^^ 11: {
https://github.com/hhpack/hackunit-docker-example/blob/feature/type_errors/src/Stack.hh#L10
-
src/Stack.hh
Was expecting a type hint
14: 15: public function add($item): void ^^^^^ 16: {
https://github.com/hhpack/hackunit-docker-example/blob/feature/type_errors/src/Stack.hh#L15
src/Stack.hh
Outdated
@@ -12,7 +12,7 @@ final class Stack<T> | |||
$this->items = Set::fromItems($items); | |||
} | |||
|
|||
public function add($item): void | |||
public function add(T $item): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
No description provided.