Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbbca719

Browse files
committed
changes to the signature of c.introduceTopLevel
1 parent7631fcb commitbbca719

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎overviews/macros/typemacros.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ The full source code of the `H2Db` type macro is provided [at Github](https://gi
3333
def impl(c: Context)(url: c.Expr[String]): c.Tree = {
3434
val name = c.freshName(c.enclosingImpl.name).toTypeName
3535
val clazz = ClassDef(..., Template(..., generateCode()))
36-
c.introduceTopLevel(clazz)
37-
Apply(Ident(name), List(Literal(Constant(c.eval(url)))))
36+
c.introduceTopLevel(c.enclosingPackage.pid.toString, clazz)
37+
val classRef = Select(c.enclosingPackage.pid, name)
38+
Apply(classRef, List(Literal(Constant(c.eval(url)))))
3839
}
3940

4041
object Db extends H2Db("coffees")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp