Skip to content

Commit cf0a5c4

Browse files
authored
Improve error message when assigning from Seq to Vec (#1239) (#1248)
(cherry picked from commit d4f64fa)
1 parent e1b9999 commit cf0a5c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chiselFrontend/src/main/scala/chisel3/Aggregate.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ sealed class Vec[T <: Data] private[chisel3] (gen: => T, val length: Int)
204204
* @note the length of this Vec must match the length of the input Seq
205205
*/
206206
def := (that: Seq[T])(implicit sourceInfo: SourceInfo, moduleCompileOptions: CompileOptions): Unit = {
207-
require(this.length == that.length)
207+
require(this.length == that.length, s"Cannot assign to a Vec of length ${this.length} from a Seq of different length ${that.length}")
208208
for ((a, b) <- this zip that)
209209
a := b
210210
}

0 commit comments

Comments
 (0)