summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Izraelevitz2020-07-30 14:57:18 -0700
committerGitHub2020-07-30 21:57:18 +0000
commit3b206b5054bc36706f295b3f48f170da8775031f (patch)
treee16bb1f94eba3da446a134aec72382e7dc1a8d7f /src
parentfca89f6c8544a1e0b42e1cec34207f74bf238e8a (diff)
Broken auto-clonetype on Scala 2.11.12 (#1480)
* Added broken auto-clonetype test * Added bugfix for 2.11 * Add descriptive comment for 2.11 special case * Update src/test/scala/chiselTests/AutoClonetypeSpec.scala * Update src/test/scala/chiselTests/AutoClonetypeSpec.scala Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/AutoClonetypeSpec.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/AutoClonetypeSpec.scala b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
index 88f6378b..d5607dc1 100644
--- a/src/test/scala/chiselTests/AutoClonetypeSpec.scala
+++ b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
@@ -196,4 +196,26 @@ class AutoClonetypeSpec extends ChiselFlatSpec with Utils {
} }
}
}
+
+ "Wrapped IO construction without parent reference" should "not fail for autoclonetype" in {
+ class TestModule extends MultiIOModule {
+ def thunk[T](f: => T): T = f
+ val works = thunk(IO(new Bundle {
+ val x = Output(UInt(3.W))
+ }))
+ }
+ ChiselStage.elaborate { new TestModule }
+ }
+
+ "Wrapped IO construction with parent references" should "not fail for autoclonetype" in {
+ class TestModule(blah: Int) extends MultiIOModule {
+ // Note that this currently fails only if f: =>T on Scala 2.11.12
+ // This works successfully with 2.12.11
+ def thunk[T](f: => T): T = f
+ val broken = thunk(IO(new Bundle {
+ val x = Output(UInt(blah.W))
+ }))
+ }
+ ChiselStage.elaborate { new TestModule(3) }
+ }
}