From 945416c628656498be7a98dcd4899f2b9e830c00 Mon Sep 17 00:00:00 2001 From: mergify[bot] Date: Tue, 2 Aug 2022 16:28:23 +0000 Subject: Fix example in Chisel Type vs Scala Type article (#2655) (#2657) (cherry picked from commit 0b2c211beefeefb72c86ea69a0b2a0101b2f2c20) Co-authored-by: Megan Wachs --- docs/src/explanations/chisel-type-vs-scala-type.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/src/explanations/chisel-type-vs-scala-type.md b/docs/src/explanations/chisel-type-vs-scala-type.md index 6c311a21..ead509d3 100644 --- a/docs/src/explanations/chisel-type-vs-scala-type.md +++ b/docs/src/explanations/chisel-type-vs-scala-type.md @@ -245,13 +245,13 @@ that you have more information than it can infer to convert Scala types: ```scala mdoc:silent class ScalaCastingModule(gen: () => Bundle) extends Module { - val io = gen().asInstanceOf[MyBundle] + val io = IO(Output(gen().asInstanceOf[MyBundle])) io.foo := 0.U } ``` This works if we do indeed have more information than the compiler: -``` scala mdoc:silent +```scala mdoc:silent ChiselStage.elaborate(new ScalaCastingModule( () => new MyBundle(3))) ``` -- cgit v1.2.3