From f80ac3596172a12c99301e047281f53d62121de8 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Fri, 7 Sep 2018 16:21:57 -0700 Subject: [PATCH] Update upper-type-bounds.md Char with for html container is smaller than line length, can't see comment on website https://docs.scala-lang.org/tour/upper-type-bounds.html --- _tour/upper-type-bounds.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_tour/upper-type-bounds.md b/_tour/upper-type-bounds.md index 5ab82eca74..3fa9cab548 100644 --- a/_tour/upper-type-bounds.md +++ b/_tour/upper-type-bounds.md @@ -44,7 +44,8 @@ val catContainer = new PetContainer[Cat](new Cat) ``` ```tut:fail -val lionContainer = new PetContainer[Lion](new Lion) // this would not compile +// this would not compile +val lionContainer = new PetContainer[Lion](new Lion) ``` The `class PetContainer` take a type parameter `P` which must be a subtype of `Pet`. `Dog` and `Cat` are subtypes of `Pet` so we can create a new `PetContainer[Dog]` and `PetContainer[Cat]`. However, if we tried to create a `PetContainer[Lion]`, we would get the following Error: