pme123
June 16, 2021, 5:44pm
1
I asked this question on Stackoverflow and got no answer. Here it is:
I am playing with the Scala 3 feature Export Clauses .
Everything works, except of opaque types .
I could not find any restrictions on them. My Opaque Type:
opaque type BpmnPath = String
object BpmnPath:
def apply(path: String): BpmnPath = path
My exports:
package camundala
export model.BpmnPath
Usage:
package camundala
package dsl
trait DSL :
def path(pathStr: String): BpmnPath =
BpmnPath(pathStr)
This gives me the following exception:
Found: camundala.model.exports$package.BpmnPath
Required: camundala.BpmnPath²
where: BpmnPath is a type in package object exports$package
BpmnPath² is a type in package object exports$package which is an alias of camundala.model.BpmnPath
Original Question on Stackoverflow
pme123
June 16, 2021, 8:05pm
3
Thanks @bishabosha , 3.0.1-RC1
solves that problem - but I have now a new compilation problem:
export org.camunda.bpm.model.bpmn.{instance as cBpmnInstance}
Gives me:
no eligible member instance at org.camunda.bpm.model.bpmn
export org.camunda.bpm.model.bpmn.{instance as cBpmnInstance}
I get this for any package.
would you be able to open an issue at GitHub - lampepfl/dotty: The Scala 3 compiler, also known as Dotty. with all the minimum code required to reproduce the error?
pme123
June 17, 2021, 4:39pm
5
Looks like for renaming there is a restriction:
Restrictions:
…
3. Simple renaming exports like
export status as stat
are not supported yet. They would run afoul of the restriction that the exported a
cannot be already a member of the object containing the export. This restriction might be lifted in the future.
Interesting that this works with 3.0.0.
Or is this another case?