Skip to content

Commit

Permalink
Improve error message when assigning from Seq to Vec (#1239)
Browse files Browse the repository at this point in the history
  • Loading branch information
aswaterman authored Nov 18, 2019
1 parent 9406e2b commit d4f64fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chiselFrontend/src/main/scala/chisel3/Aggregate.scala
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ sealed class Vec[T <: Data] private[chisel3] (gen: => T, val length: Int)
* @note the length of this Vec must match the length of the input Seq
*/
def := (that: Seq[T])(implicit sourceInfo: SourceInfo, moduleCompileOptions: CompileOptions): Unit = {
require(this.length == that.length)
require(this.length == that.length, s"Cannot assign to a Vec of length ${this.length} from a Seq of different length ${that.length}")
for ((a, b) <- this zip that)
a := b
}
Expand Down

0 comments on commit d4f64fa

Please sign in to comment.