Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
ToolBoxes and running multiple trees
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Hodapp  
View profile  
 More options May 7 2012, 4:46 pm
From: Chris Hodapp <clhoda...@gmail.com>
Date: Mon, 7 May 2012 13:46:21 -0700 (PDT)
Local: Mon, May 7 2012 4:46 pm
Subject: ToolBoxes and running multiple trees

First, I feel like ToolBox's "runExpr" is misleadingly-named. Shouldn't it
be "runTree"?

Second, I seem to be having a repeatable problem. The first tree I run
works fine. The second tree I try to run will *always* fail with the same
error (see below). All subsequent trees will fail until I run
<ToolBoxInstance>.frontEnd.reset(). After that, I seem to be able to run as
many trees as I want.

code:
"""
import reflect.mirror._
var i = 0
val action = reify { i += 1; println(i) }.tree

val tb1 = newToolBox()
tb1.runExpr(action) // works
tb1.runExpr(action) // error
tb1.runExpr(action) // error
tb1.frontEnd.reset()
tb1.runExpr(action) // works
tb1.runExpr(action) // works

val tb2 = new ToolBox()
tb2.runExpr(action) // works
tb2.frontEnd.reset()
tb2.runExpr(action) // error
tb2.frontEnd(action) // error
tb2.frontEnd.reset()
tb2.runExpr(action)  // works
tb2.runExpr(action) // works
"""
The error is always:

"""
scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxError: reflective
compilation has failed:

name clash between inherited members:
method ==:(x$1: AnyRef)Boolean in class Object and
method ==:(x$1: Any)Boolean in class Any
have same type after erasure: (x$1: Object)Boolean
name clash between inherited members:
method !=:(x$1: AnyRef)Boolean in class Object and
method !=:(x$1: Any)Boolean in class Any
have same type after erasure: (x$1: Object)Boolean
        at
scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxGlobal.throwIfErrors(ToolBox es.scala:252)
        at
scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxGlobal.compileExpr(ToolBoxes .scala:200)
        at
scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxGlobal.runExpr(ToolBoxes.sca la:227)
        at
scala.reflect.runtime.ToolBoxes$ToolBox.runExpr(ToolBoxes.scala:344)
        at .<init>(<console>:17)
        at .<clinit>(<console>)
        at .<init>(<console>:7)
        at .<clinit>(<console>)
        at $print(<console>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:5 7)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp l.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at
scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:775)
        at
scala.tools.nsc.interpreter.IMain$Request$$anonfun$18.apply(IMain.scala:103 7)
        at
scala.tools.nsc.interpreter.Line.scala$tools$nsc$interpreter$Line$$runAndSe tState(Line.scala:41)
        at
scala.tools.nsc.interpreter.Line$$anonfun$2.apply$mcV$sp(Line.scala:47)
        at scala.tools.nsc.io.package$$anon$2.run(package.scala:22)
        at java.lang.Thread.run(Thread.java:679)
"""


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eugene Burmako  
View profile  
 More options May 7 2012, 5:01 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Mon, 7 May 2012 23:01:14 +0200
Local: Mon, May 7 2012 5:01 pm
Subject: Re: [scala-internals] ToolBoxes and running multiple trees

Thanks for the detailed issue description! I will look into it.

On 7 May 2012 22:46, Chris Hodapp <clhoda...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Hodapp  
View profile  
 More options May 16 2012, 11:37 am
From: Chris Hodapp <clhoda...@gmail.com>
Date: Wed, 16 May 2012 08:37:25 -0700 (PDT)
Local: Wed, May 16 2012 11:37 am
Subject: Re: [scala-internals] ToolBoxes and running multiple trees

Any progress, Eugene?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eugene Burmako  
View profile  
 More options May 16 2012, 11:47 am
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Wed, 16 May 2012 18:47:10 +0300
Local: Wed, May 16 2012 11:47 am
Subject: Re: [scala-internals] ToolBoxes and running multiple trees

Well... Martin and I are totally swamped with this reflection refactoring.

Is this bug a blocker for you? If yes, I could take a look tomorrow.

On 16 May 2012 18:37, Chris Hodapp <clhoda...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Hodapp  
View profile  
 More options May 16 2012, 12:03 pm
From: Chris Hodapp <clhoda...@gmail.com>
Date: Wed, 16 May 2012 09:03:36 -0700 (PDT)
Local: Wed, May 16 2012 12:03 pm
Subject: Re: [scala-internals] ToolBoxes and running multiple trees

That is totally understandable.

I care about this because I want to reuse the ToolBox in DynamicProxy in
order to improve performance (unscientifically, it makes method calls on
the proxy take about half as long to resolve and execute). I can work
around the issue by just catching the exception and resetting the FrontEnd.
However, it really doesn't seem like ToolBoxes should have this limitation
when there  is a performance cost to making a new one. You make the call.
If you don't have time, I'll just catch the exception.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »