Skip to content

Commit 07e35fb

Browse files
author
Dean Wampler
committed
Minor tweaks to examples.
1 parent 708bd6c commit 07e35fb

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/script/scala/progscala3/typesystem/abstracttypes/AbstractTypesEx.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ object Example extends ExampleTrait:
3030
val v1 = new T1 { val name1 = "T1" }
3131
val v2 = new T2 { val name1 = "T1"; val name2 = "T2" }
3232
val v3 = C("1", "2")
33-
val v4 = Vector(C("3", "4"))
33+
val v4 = Vector(v1)
3434

3535
override def toString(): String =
3636
val v1str = s"v1: name1 = ${v1.name1}"
3737
val v2str = s"v2: name1 = ${v2.name1}, name2 = ${v2.name2}"
3838
s"Example: v1 = $v1str, v2 = $v2str, v3 = $v3, v4 = $v4"
3939

40-
assert(Example.toString ==
41-
"Example: v1 = v1: name1 = T1, v2 = v2: name1 = T1, " +
42-
"name2 = T2, v3 = C(1,2), v4 = Vector(C(3,4))")
40+
println(Example.toString)
4341
// end::Example[]

src/script/scala/progscala3/typesystem/bounds/ViewToContextBounds.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ assert(RemoteConnection.write(100) == "-- 100 --")
2222
assert(RemoteConnection.write(3.14f) == "-- 3.14 --")
2323
assert(RemoteConnection.write("hello!") == "-- hello! --")
2424
// The following fails: "no implicit view from (Int, Int) => ...
25-
RemoteConnection.write((1, 2))
25+
RemoteConnection.write((1, 2)) // Error!

0 commit comments

Comments
 (0)