Skip to content

Commit

Permalink
fix: Overload issue in ByteStringBuilder #32272 (#32274)
Browse files Browse the repository at this point in the history
  • Loading branch information
johanandren authored Jan 2, 2024
1 parent dd86442 commit df01bd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1407,5 +1407,12 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers {
}
}
}

// overloading issue #32272
"support adding arbitrary sequences of bytes" in {
val builder = new ByteStringBuilder()
builder ++= Seq[Byte](1, 2, 3)
builder.result() shouldEqual ByteString(1, 2, 3)
}
}
}
2 changes: 1 addition & 1 deletion akka-actor/src/main/scala-2.13/akka/util/ByteString.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
_length += seq.length
}
case _ =>
super.++=(xs)
super.addAll(xs)
}
this
}
Expand Down
2 changes: 1 addition & 1 deletion akka-actor/src/main/scala-3/akka/util/ByteString.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
_length += seq.length
}
case _ =>
super.++=(xs)
super.addAll(xs)
}
this
}
Expand Down

0 comments on commit df01bd4

Please sign in to comment.