Skip to content

Commit 2fb7cbd

Browse files
committed
update readme
1 parent 5a3fb20 commit 2fb7cbd

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,16 @@ println("sayHello")
7373
```
7474

7575
Without having an instance of the type for nested case classes:
76-
```scala
77-
import com.github.dwickern.macros.NameOf._
78-
79-
case class Pet(age: Int)
80-
case class Person(name: String, pet : Pet)
81-
82-
println(qualifiedNameOf[Person](_.pet.age))
76+
```scala mdoc:nest
77+
case class Pet(age: Int)
78+
case class Person(name: String, pet: Pet)
8379

84-
// compiles to:
80+
println(qualifiedNameOf[Person](_.pet.age))
81+
```
82+
```scala mdoc:nest
83+
// compiles to:
8584

86-
println("pet.age")
85+
println("pet.age")
8786
```
8887

8988
You can also use `nameOfType` to get the unqualified name of a type:

0 commit comments

Comments
 (0)