Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 333 Bytes

MoreSpecificReturnType.md

File metadata and controls

14 lines (11 loc) · 333 Bytes

MoreSpecificReturnType

Emitted when the declared return type for a method is more specific than the inferred one (emitted in the same methods that LessSpecificReturnStatement is)

<?php

class A {}
class B extends A {}
function foo() : B {
    /** @psalm-suppress LessSpecificReturnStatement */
    return new A();
}