Skip to content

Commit e0e18ed

Browse files
committed
fixed hang on using weakTypeOf in runtime reflection on scala 2.11.8
1 parent e8599fb commit e0e18ed

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/scala/gopher/util/ReflectUtil.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object ReflectUtil
1111
{
1212
val r1 = ownerType.members.filter(_.isTerm).map(_.asTerm).filter(x => x.isVal)
1313
val signatures = r1.map(_.typeSignature)
14-
val ut = u.weakTypeOf[T]
14+
val ut = u.typeOf[T]
1515
val checkResults = signatures.map( _ <:< u.typeOf[T])
1616
val retval = ownerType.members.filter(_.isTerm).map(_.asTerm).filter{ x =>
1717
if (x.isVal) {

src/test/scala/gopher/transputers/TransputerRestartSuite.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ trait BingoWithRecover extends SelectTransputer with TransputerLogging
4040
loop {
4141
case x: inX.read =>
4242
val y = inY.read
43-
//log.info(s"Bingo checker, received ${x}, ${y} ")
43+
//Console.println(s"Bingo checker, received ${x}, ${y} ")
4444
out.write(x==y)
4545
if (x==2) {
4646
throw new MyException()
@@ -60,12 +60,12 @@ trait Acceptor1 extends SelectTransputer
6060

6161
val inA = InPort[Boolean]()
6262

63-
@volatile var nBingos = 0
64-
@volatile var nPairs = 0
63+
var nBingos = 0
64+
var nPairs = 0
6565

6666
loop {
6767
case x: inA.read =>
68-
// Console.println(s"acceptor: ${nPairs} ${nBingos} ${x}")
68+
//Console.println(s"acceptor: ${nPairs} ${nBingos} ${x}")
6969
if (x) {
7070
nBingos += 1
7171
}
@@ -77,7 +77,7 @@ trait Acceptor1 extends SelectTransputer
7777
class TransputerRestartSuite extends FunSuite
7878
{
7979

80-
test("bingo restore with the same connectons") {
80+
test("bingo restore with the same connectons", Now) {
8181
val inX = gopherApi.iterableInput(1 to 100)
8282
val inY = gopherApi.iterableInput(1 to 100)
8383
val bingo = gopherApi.makeTransputer[BingoWithRecover]

0 commit comments

Comments
 (0)