From 7258af570c4d6f0c121df26d5920d12ee0932093 Mon Sep 17 00:00:00 2001 From: Angie Wang Date: Sun, 6 Mar 2016 15:03:37 -0800 Subject: [PATCH] Changed Vec cloneType Each element's type is properly cloned --- src/main/scala/Vec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/Vec.scala b/src/main/scala/Vec.scala index 5e1147d7..ddeb10b0 100644 --- a/src/main/scala/Vec.scala +++ b/src/main/scala/Vec.scala @@ -210,7 +210,7 @@ class Vec[T <: Data](val gen: (Int) => T, elts: Iterable[T]) extends Aggregate w } } - override def cloneType: this.type = Vec.tabulate(size)(gen).asInstanceOf[this.type] //Vec(this: Seq[T]).asInstanceOf[this.type] + override def cloneType: this.type = Vec(elts.map(_.cloneType)).asInstanceOf[this.type] override def asDirectionless: this.type = { self.foreach(_.asDirectionless) ; this } override def asOutput: this.type = { self.foreach(_.asOutput) ; this } override def asInput: this.type = { self.foreach(_.asInput) ; this }