-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14523 from dotty-staging/optimize-mapblock
Thread context through block in transforms correctly and efficiently
- Loading branch information
Showing
9 changed files
with
141 additions
and
36 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
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
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
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
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
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
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 java.nio.file.FileSystems | ||
import java.util.ArrayList | ||
|
||
def directorySeparator: String = | ||
import scala.language.unsafeNulls | ||
FileSystems.getDefault().getSeparator() | ||
|
||
def getFirstOfFirst(xs: ArrayList[ArrayList[ArrayList[String]]]): String = | ||
import scala.language.unsafeNulls | ||
xs.get(0).get(0).get(0) |
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,30 @@ | ||
// An example extracted from akka that demonstrated a spurious | ||
// "forward reference not allowed from self constructor invocation" error. | ||
class Resizer | ||
class SupervisorStrategy | ||
class Pool | ||
object Pool: | ||
def defaultSupervisorStrategy: SupervisorStrategy = ??? | ||
object Dispatchers: | ||
def DefaultDispatcherId = ??? | ||
object Resizer: | ||
def fromConfig(config: Config): Option[Resizer] = ??? | ||
|
||
class Config: | ||
def getInt(str: String): Int = ??? | ||
def hasPath(str: String): Boolean = ??? | ||
|
||
final case class BroadcastPool( | ||
nrOfInstances: Int, | ||
val resizer: Option[Resizer] = None, | ||
val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, | ||
val routerDispatcher: String = Dispatchers.DefaultDispatcherId, | ||
val usePoolDispatcher: Boolean = false) | ||
extends Pool: | ||
|
||
def this(config: Config) = | ||
this( | ||
nrOfInstances = config.getInt("nr-of-instances"), | ||
resizer = resiz, // error: forward reference not allowed from self constructor invocation | ||
usePoolDispatcher = config.hasPath("pool-dispatcher")) | ||
def resiz = Resizer.fromConfig(config) |
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,29 @@ | ||
// An example extracted from akka that demonstrated a spurious | ||
// "forward reference not allowed from self constructor invocation" error. | ||
class Resizer | ||
class SupervisorStrategy | ||
class Pool | ||
object Pool: | ||
def defaultSupervisorStrategy: SupervisorStrategy = ??? | ||
object Dispatchers: | ||
def DefaultDispatcherId = ??? | ||
object Resizer: | ||
def fromConfig(config: Config): Option[Resizer] = ??? | ||
|
||
class Config: | ||
def getInt(str: String): Int = ??? | ||
def hasPath(str: String): Boolean = ??? | ||
|
||
final case class BroadcastPool( | ||
nrOfInstances: Int, | ||
val resizer: Option[Resizer] = None, | ||
val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, | ||
val routerDispatcher: String = Dispatchers.DefaultDispatcherId, | ||
val usePoolDispatcher: Boolean = false) | ||
extends Pool: | ||
|
||
def this(config: Config) = | ||
this( | ||
nrOfInstances = config.getInt("nr-of-instances"), | ||
resizer = Resizer.fromConfig(config), | ||
usePoolDispatcher = config.hasPath("pool-dispatcher")) |