From 1f84b23f2af077231bf07f3023d7baaf077d1f9a Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Fri, 6 Nov 2020 17:53:39 -0500 Subject: [PATCH] Add @weirdan's fix --- docs/annotating_code/templated_annotations.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/annotating_code/templated_annotations.md b/docs/annotating_code/templated_annotations.md index f0b152480..2cb89f93b 100644 --- a/docs/annotating_code/templated_annotations.md +++ b/docs/annotating_code/templated_annotations.md @@ -120,7 +120,7 @@ Psalm also allows you to parameterize class types ```php $class * @return T */ @@ -128,9 +128,10 @@ function instantiator(string $class) { return new $class(); } +/** @psalm-consistent-constructor */ class Foo {} -$a = instantiator(Foo::class); // Psalm knows the result is an object of type Foo +$_a = instantiator(Foo::class); // Psalm knows the result is an object of type Foo ``` ## Template inheritance