Sometimes, when running Organize Imports, it added anonymous imports to the imports list. I see references to val names from definition blocks in the class. I also see imports for PlayFramework endpoint mappings.
i.e.
import List[com.$anonfun.$anonfun.items
import javax.inject.{ Inject, Singleton }
import play.api.data.FormError
import play.api.mvc.Action
import play.api.mvc.Results.{ InternalServerError, Ok }
import play.getSearch.$anonfun.err
import play.mvc.Controller
The below code is very similar to what caused the bug to manifest (it is where the "List" and "items" references come from). However, this example does not cause the problem. But, when the problem is triggered in the IDE, it happens repeatably. (
i.e.
import List[com.$anonfun.$anonfun.items
import javax.inject.{ Inject, Singleton }
import play.api.data.FormError
import play.api.mvc.Action
import play.api.mvc.Results.{ InternalServerError, Ok }
import play.getSearch.$anonfun.err
import play.mvc.Controller
The below code is very similar to what caused the bug to manifest (it is where the "List" and "items" references come from). However, this example does not cause the problem. But, when the problem is triggered in the IDE, it happens repeatably. (
package com.mc10inc.controllers
import play.mvc.Controller
case class SampleResult(size : Int)
class BugReportExample extends Controller {
def getSearch() : List[SampleResult] = {
val stuff = List(List(Some(1L), Some(2L), None), List(Some(5L)))
val stuffStuff = List(stuff, stuff)
stuffStuff flatMap {
identity[List[List[Option[Long]]]]
} map {
list ⇒
{ // pack
val items = list.flatten[Long]
SampleResult(items.size)
}
}
}
}
Leave a comment
on 2015-08-13 05:39 *
By Simon Schäfer
Milestone changed from Lithium 4.2 to Lithium
Status changed from New to Accepted
All the stuff that contains a $ sign should be filtered out. Or we should check if it is synthetic because users can define symbols that contain $ signs.
I think that I fixed something similar in July (https://www.assembla.com/spaces/scala-ide/tickets/1002506#/activity/ticket:). Can you check if you still have this issue with Scala-IDE-4.2.0?
The example does not help to reproduce the problem. Please open a new ticket with an actual reproducible example if the problem should appear again.
on 2015-10-25 08:08 *
By lifeoflust355581
Thanks, I'll try to isolate an example, though this happens across 4 separate machines/installs of Linux/Eclipse, on all of our Scala projects.
No file chosen
You have an empty file field. Please select or remove it.
Name | Size |
---|