Requesting an implicit parameter using a type projection does not work in an implicit macro. The following macro cannot be resolved implicitly at the call site:
Replacing "macro AutoMappedJdbcType.applyMacroImpl[ E ]" with "???", thus turning it into a regular implicit method, makes the call site compile.
-Xshow-implicits gives the following details:
[info] /Users/szeiger/code/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/MapperTest.scala:344: materializing requested scala.reflect.type.ClassTag[ID] using `package`.this.materializeClassTag[ID]()
[info] def id = column[ID]("id", O.PrimaryKey)
[info] ^
[info] /Users/szeiger/code/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/MapperTest.scala:344: jdbc.this.AutoMappedJdbcType.jdbcType is not a valid implicit value for scala.slick.ast.TypedType[ID] because:
[info] exception during macro expansion:
[info] java.lang.IllegalArgumentException: wrong number of arguments
[info] def id = column[ID]("id", O.PrimaryKey)
[info] ^
[error] /Users/szeiger/code/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/MapperTest.scala:344: could not find implicit value for parameter tm: scala.slick.ast.TypedType[ID]
[error] def id = column[ID]("id", O.PrimaryKey)
[error] ^
[error] one error found
Trying to pass the type projection as a separate type argument to the macro, fails as well:
In this case, the error shown by -Xshow-implicits is:
[info] /Users/szeiger/code/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/MapperTest.scala:319: materializing requested scala.reflect.type.ClassTag[ID] using `package`.this.materializeClassTag[ID]()
[info] def id = column[ID]("id", O.PrimaryKey)
[info] ^
[info] /Users/szeiger/code/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/MapperTest.scala:319: jdbc.this.AutoMappedJdbcType.jdbcType is not a valid implicit value for scala.slick.ast.TypedType[ID] because:
[info] hasMatchingSymbol reported error: type mismatch;
[info] found : AutoMappedJdbcTypeBase.this.Underlying
[info] required: Int
[info] def id = column[ID]("id", O.PrimaryKey)
[info] ^
[error] /Users/szeiger/code/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/MapperTest.scala:319: could not find implicit value for parameter tm: scala.slick.ast.TypedType[ID]
[error] def id = column[ID]("id", O.PrimaryKey)
[error] ^
[error] one error found
Requesting an implicit parameter using a type projection does not work in an implicit macro. The following macro cannot be resolved implicitly at the call site:
Replacing "macro AutoMappedJdbcType.applyMacroImpl[ E ]" with "???", thus turning it into a regular implicit method, makes the call site compile.
-Xshow-implicits gives the following details:
Trying to pass the type projection as a separate type argument to the macro, fails as well:
In this case, the error shown by -Xshow-implicits is: