aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackkoenig2016-09-06 14:39:59 -0700
committerDonggyu Kim2016-09-12 12:48:52 -0700
commit3847e88e0863aaa6db188b3e8792a35cb86dde22 (patch)
treed2dc7cc0df880e5d398c69d5b6dd60b1c19a9f2a /src
parent4702bf9f257f954e19d1441b21e737f951ccfbcc (diff)
Change Mappers to Value Classes
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/firrtl/Mappers.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/scala/firrtl/Mappers.scala b/src/main/scala/firrtl/Mappers.scala
index 4eac68a5..c443ac37 100644
--- a/src/main/scala/firrtl/Mappers.scala
+++ b/src/main/scala/firrtl/Mappers.scala
@@ -50,7 +50,7 @@ object Mappers {
override def map(stmt: Statement): Statement = stmt mapString f
}
}
- implicit class StmtMap(stmt: Statement) {
+ implicit class StmtMap(val stmt: Statement) extends AnyVal {
// Using implicit types to allow overloading of function type to map, see StmtMagnet above
def map[T](f: T => T)(implicit magnet: (T => T) => StmtMagnet): Statement = magnet(f).map(stmt)
}
@@ -70,7 +70,7 @@ object Mappers {
override def map(expr: Expression): Expression = expr mapWidth f
}
}
- implicit class ExprMap(expr: Expression) {
+ implicit class ExprMap(val expr: Expression) extends AnyVal {
def map[T](f: T => T)(implicit magnet: (T => T) => ExprMagnet): Expression = magnet(f).map(expr)
}
@@ -86,7 +86,7 @@ object Mappers {
override def map(tpe: Type): Type = tpe mapWidth f
}
}
- implicit class TypeMap(tpe: Type) {
+ implicit class TypeMap(val tpe: Type) extends AnyVal {
def map[T](f: T => T)(implicit magnet: (T => T) => TypeMagnet): Type = magnet(f).map(tpe)
}
@@ -102,7 +102,7 @@ object Mappers {
}
}
}
- implicit class WidthMap(width: Width) {
+ implicit class WidthMap(val width: Width) extends AnyVal {
def map[T](f: T => T)(implicit magnet: (T => T) => WidthMagnet): Width = magnet(f).map(width)
}
@@ -121,7 +121,7 @@ object Mappers {
override def map(module: DefModule): DefModule = module mapString f
}
}
- implicit class ModuleMap(module: DefModule) {
+ implicit class ModuleMap(val module: DefModule) extends AnyVal {
def map[T](f: T => T)(implicit magnet: (T => T) => ModuleMagnet): DefModule = magnet(f).map(module)
}