diff options
| author | chick | 2016-09-23 16:31:31 -0700 |
|---|---|---|
| committer | Donggyu Kim | 2016-09-25 14:39:44 -0700 |
| commit | 16286528ad957a7d62a9c1b18bd6335a3102ea5b (patch) | |
| tree | ea0305940b650ac343a618bea53e3dea0e5b4a35 /src | |
| parent | a0708dca42a7106b3985aca964b3a5f42b3e6409 (diff) | |
implicit functions should specify return type
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/firrtl/Mappers.scala | 26 | ||||
| -rw-r--r-- | src/main/scala/firrtl/Utils.scala | 2 | ||||
| -rw-r--r-- | src/main/scala/firrtl/passes/InferReadWrite.scala | 2 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/main/scala/firrtl/Mappers.scala b/src/main/scala/firrtl/Mappers.scala index c443ac37..ee1b5d0d 100644 --- a/src/main/scala/firrtl/Mappers.scala +++ b/src/main/scala/firrtl/Mappers.scala @@ -37,16 +37,16 @@ object Mappers { def map(stmt: Statement): Statement } private object StmtMagnet { - implicit def forStmt(f: Statement => Statement) = new StmtMagnet { + implicit def forStmt(f: Statement => Statement): StmtMagnet = new StmtMagnet { override def map(stmt: Statement): Statement = stmt mapStmt f } - implicit def forExp(f: Expression => Expression) = new StmtMagnet { + implicit def forExp(f: Expression => Expression): StmtMagnet = new StmtMagnet { override def map(stmt: Statement): Statement = stmt mapExpr f } - implicit def forType(f: Type => Type) = new StmtMagnet { + implicit def forType(f: Type => Type): StmtMagnet = new StmtMagnet { override def map(stmt: Statement) : Statement = stmt mapType f } - implicit def forString(f: String => String) = new StmtMagnet { + implicit def forString(f: String => String): StmtMagnet = new StmtMagnet { override def map(stmt: Statement): Statement = stmt mapString f } } @@ -60,13 +60,13 @@ object Mappers { def map(expr: Expression): Expression } private object ExprMagnet { - implicit def forExpr(f: Expression => Expression) = new ExprMagnet { + implicit def forExpr(f: Expression => Expression): ExprMagnet = new ExprMagnet { override def map(expr: Expression): Expression = expr mapExpr f } - implicit def forType(f: Type => Type) = new ExprMagnet { + implicit def forType(f: Type => Type): ExprMagnet = new ExprMagnet { override def map(expr: Expression): Expression = expr mapType f } - implicit def forWidth(f: Width => Width) = new ExprMagnet { + implicit def forWidth(f: Width => Width): ExprMagnet = new ExprMagnet { override def map(expr: Expression): Expression = expr mapWidth f } } @@ -79,10 +79,10 @@ object Mappers { def map(tpe: Type): Type } private object TypeMagnet { - implicit def forType(f: Type => Type) = new TypeMagnet { + implicit def forType(f: Type => Type): TypeMagnet = new TypeMagnet { override def map(tpe: Type): Type = tpe mapType f } - implicit def forWidth(f: Width => Width) = new TypeMagnet { + implicit def forWidth(f: Width => Width): TypeMagnet = new TypeMagnet { override def map(tpe: Type): Type = tpe mapWidth f } } @@ -95,7 +95,7 @@ object Mappers { def map(width: Width): Width } private object WidthMagnet { - implicit def forWidth(f: Width => Width) = new WidthMagnet { + implicit def forWidth(f: Width => Width): WidthMagnet = new WidthMagnet { override def map(width: Width): Width = width match { case mapable: HasMapWidth => mapable mapWidth f // WIR case other => other // Standard IR nodes @@ -111,13 +111,13 @@ object Mappers { def map(module: DefModule): DefModule } private object ModuleMagnet { - implicit def forStmt(f: Statement => Statement) = new ModuleMagnet { + implicit def forStmt(f: Statement => Statement): ModuleMagnet = new ModuleMagnet { override def map(module: DefModule): DefModule = module mapStmt f } - implicit def forPorts(f: Port => Port) = new ModuleMagnet { + implicit def forPorts(f: Port => Port): ModuleMagnet = new ModuleMagnet { override def map(module: DefModule): DefModule = module mapPort f } - implicit def forString(f: String => String) = new ModuleMagnet { + implicit def forString(f: String => String): ModuleMagnet = new ModuleMagnet { override def map(module: DefModule): DefModule = module mapString f } } diff --git a/src/main/scala/firrtl/Utils.scala b/src/main/scala/firrtl/Utils.scala index cb4a4409..685e0a9e 100644 --- a/src/main/scala/firrtl/Utils.scala +++ b/src/main/scala/firrtl/Utils.scala @@ -80,7 +80,7 @@ object Utils extends LazyLogging { if (bi < BigInt(0)) "\"h" + bi.toString(16).substring(1) + "\"" else "\"h" + bi.toString(16) + "\"" - implicit def toWrappedExpression (x:Expression) = new WrappedExpression(x) + implicit def toWrappedExpression (x:Expression): WrappedExpression = new WrappedExpression(x) def ceilLog2(x: BigInt): Int = (x-1).bitLength def max(a: BigInt, b: BigInt): BigInt = if (a >= b) a else b def min(a: BigInt, b: BigInt): BigInt = if (a >= b) b else a diff --git a/src/main/scala/firrtl/passes/InferReadWrite.scala b/src/main/scala/firrtl/passes/InferReadWrite.scala index 74800cf5..98777311 100644 --- a/src/main/scala/firrtl/passes/InferReadWrite.scala +++ b/src/main/scala/firrtl/passes/InferReadWrite.scala @@ -55,7 +55,7 @@ object InferReadWritePass extends Pass { type Statements = collection.mutable.ArrayBuffer[Statement] type PortSet = collection.mutable.HashSet[String] - private implicit def toString(e: Expression) = e.serialize + private implicit def toString(e: Expression): String = e.serialize def getProductTerms(connects: Connects)(e: Expression): Seq[Expression] = e match { // No ConstProp yet... |
