Skip to content

Commit c2f1673

Browse files
author
Oron Port
committed
range filter can be bit or bool
1 parent 01d1a8d commit c2f1673

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/src/main/scala/dfhdl/core/DFRange.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ final class DFRange[P](val irValue: ir.DFRange | DFError) extends AnyVal with DF
1111
throw new IllegalArgumentException(
1212
"foreach is not meant to be run directly, the DFHDL compiler plugin should have replaced its call."
1313
)
14-
def withFilter(f: DFValOf[DFInt32] => DFValOf[DFBool]): DFRange[P] = ???
14+
def withFilter(f: DFValOf[DFInt32] => DFValOf[DFBoolOrBit]): DFRange[P] =
15+
throw new IllegalArgumentException(
16+
"withFilter is not meant to be run directly, the DFHDL compiler plugin should have replaced its call."
17+
)
1518
def by[SP](step: DFValTP[DFInt32, SP])(using dfc: DFC): DFRange[P | SP] =
1619
import dfc.getSet
1720
this.asIR.stepRef.get.replaceMemberWith(step.asIR)
1821
this.asInstanceOf[DFRange[P | SP]]
22+
end DFRange
1923
object DFRange:
2024
extension (range: ir.DFRange) def asFE[P]: DFRange[P] = new DFRange[P](range)
2125
extension (range: DFRange[?]) def asFE[P]: DFRange[P] = range.asInstanceOf[DFRange[P]]

0 commit comments

Comments
 (0)