forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
8 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import scala.reflect.mirror._ | ||
|
||
object Foo { val bar = 2 } | ||
|
||
object Test extends App { | ||
val tpe = getType(Foo) | ||
val bar = tpe.nonPrivateMember(newTermName("bar")) | ||
val value = getValue(Foo, bar) | ||
println(value) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import scala.reflect.mirror._ | ||
|
||
class Foo { val bar = 2 } | ||
|
||
object Test extends App { | ||
val foo = new Foo | ||
val tpe = getType(foo) | ||
val bar = tpe.nonPrivateMember(newTermName("bar")) | ||
val value = getValue(foo, bar) | ||
println(value) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
no public member |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import scala.reflect.mirror._ | ||
|
||
class Foo(bar: Int) | ||
|
||
object Test extends App { | ||
val foo = new Foo(2) | ||
val tpe = getType(foo) | ||
val bar = tpe.nonPrivateMember(newTermName("bar")) | ||
bar match { | ||
case NoSymbol => println("no public member") | ||
case _ => println("i'm screwed") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import scala.reflect.mirror._ | ||
|
||
class Foo(val bar: Int) | ||
|
||
object Test extends App { | ||
val foo = new Foo(2) | ||
val tpe = getType(foo) | ||
val bar = tpe.nonPrivateMember(newTermName("bar")) | ||
val value = getValue(foo, bar) | ||
println(value) | ||
} |