8000 Adapt to Scala 2.12 trait encoding (removal of impl classes) · Issue #2285 · scala-js/scala-js · GitHub
[go: up one dir, main page]

Skip to content

Adapt to Scala 2.12 trait encoding (removal of impl classes) #2285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
retronym opened this issue Mar 10, 2016 · 4 comments
Closed

Adapt to Scala 2.12 trait encoding (removal of impl classes) #2285

retronym opened this issue Mar 10, 2016 · 4 comments
Assignees
Labels
upstream This issue derives from a bug or a change in one of our upstream dependencies.
Milestone

Comments

@retronym
Copy link

We've just run a community build against my pull request, scala/scala#5003, that changes the Scala 2.12 trait encoding.

I was pleasantly surprised to find that everything worked... well everything other than Scala JS.

Here are the compile failure, related to methods I've removed about impl classes.

[scala-js] [error] /home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.5/project-builds/scala-js-07830e1e11ee5f72b4b2d29aed7bb635b8f67ae2/compiler/src/main/scala/org/scalajs/core/compiler/GenJSCode.scala:240: value IMPL_CLASS_SUFFIX is not a member of object GenJSCode.this.global.nme
[scala-js] [error]                 sym.owner.info.decl(sym.name.dropRight(nme.IMPL_CLASS_SUFFIX.length)).tpe)
[scala-js] [error]                                                            ^
[scala-js] [error] /home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.5/project-builds/scala-js-07830e1e11ee5f72b4b2d29aed7bb635b8f67ae2/compiler/src/main/scala/org/scalajs/core/compiler/GenJSCode.scala:240: value IMPL_CLASS_SUFFIX is not a member of object GenJSCode.this.global.nme
[scala-js] [error]                 sym.owner.info.decl(sym.name.dropRight(nme.IMPL_CLASS_SUFFIX.length)).tpe)
[scala-js] [error]                                                            ^
[scala-js] [error] /home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.5/project-builds/scala-js-07830e1e11ee5f72b4b2d29aed7bb635b8f67ae2/compiler/src/main/scala/org/scalajs/core/compiler/GenJSCode.scala:1056: value implClass is not a member of GenJSCode.this.global.Symbol
[scala-js] [error]             val implClassSym = sym.owner.implClass
[scala-js] [error]                                          ^
[scala-js] [error] /home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.5/project-builds/scala-js-07830e1e11ee5f72b4b2d29aed7bb635b8f67ae2/compiler/src/main/scala/org/scalajs/core/compiler/GenJSCode.scala:1056: value implClass is not a member of GenJSCode.this.global.Symbol
[scala-js] [error]             val implClassSym = sym.owner.implClass
[scala-js] [error]                                          ^
[scala-js] [error] /home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.5/project-builds/scala-js-07830e1e11ee5f72b4b2d29aed7bb635b8f67ae2/compiler/src/main/scala/org/scalajs/core/compiler/JSEncoding.scala:189: value isImplClassName is not a member of object JSEncoding.this.global.nme
[scala-js] [error]     sym.isModuleClass && nme.isImplClassName(sym.name)
[scala-js] [error]                              ^
[scala-js] [error] /home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.5/project-builds/scala-js-07830e1e11ee5f72b4b2d29aed7bb635b8f67ae2/compiler/src/main/scala/org/scalajs/core/compiler/JSEncoding.scala:189: value isImplClassName is not a member of object JSEncoding.this.global.nme
[scala-js] [error]     sym.isModuleClass && nme.isImplClassName(sym.name)
[scala-js] [error]                              ^
[scala-js] [error] /home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.5/project-builds/scala-js-07830e1e11ee5f72b4b2d29aed7bb635b8f67ae2/compiler/src/main/scala/org/scalajs/core/compiler/TypeKinds.scala:238: value interfaceName is not a member of object TypeKinds.this.global.tpnme
[scala-js] [error]         val traitSym = sym.owner.info.decl(tpnme.interfaceName(sym.name))
[scala-js] [error]                                                  ^
[scala-js] [error] /home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.5/project-builds/scala-js-07830e1e11ee5f72b4b2d29aed7bb635b8f67ae2/compiler/src/main/scala/org/scalajs/core/compiler/TypeKinds.scala:238: value interfaceName is not a member of object TypeKinds.this.global.tpnme
[scala-js] [error]         val traitSym = sym.owner.info.decl(tpnme.interfaceName(sym.name))
[scala-js] [error]                                                  ^

You can experiment with this build with 2.12.0-03cc6f9-SNAPSHOT from "pr-scala snapshots" at "https://scala-ci.typesafe.com/artifactory/scala-pr-validation-snapshots/"

Would you be willing to adapt to these changes on a 2.12.x branch of ScalaJS?

@sjrd
Copy link
Member
sjrd commented Mar 10, 2016

Sure, I'll work on this today. We already have default methods in the IR and the linker, so it's only the compiler plugin that needs some work.

@sjrd sjrd added the upstream This issue derives from a bug or a change in one of our upstream dependencies. label Mar 10, 2016
@sjrd sjrd added this to the v0.6.8 milestone Mar 10, 2016
@sjrd sjrd self-assigned this Mar 10, 2016
@sjrd
Copy link
Member
sjrd commented Mar 10, 2016

@retronym I get this when I add the resolver you mentioned and switch to 2.12.0-03cc6f9-SNAPSHOT:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scala-lang.modules#scala-xml_2.12.0-3ecc141-nightly;1.0.5: not found
[warn]  :: org.scala-lang.modules#scala-parser-combinators_2.12.0-3ecc141-nightly;1.0.4: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]          org.scala-lang.modules:scala-xml_2.12.0-3ecc141-nightly:1.0.5
[warn]            +- org.scala-lang:scala-compiler:2.12.0-03cc6f9-SNAPSHOT (/localhome/doeraene/projects/scalajs/project/Build.scala#L477)
[warn]            +- org.scala-js:scalajs-compiler_2.12.0-03cc6f9-SNAPSHOT:0.6.8-SNAPSHOT ()
[warn]          org.scala-lang.modules:scala-parser-combinators_2.12.0-3ecc141-nightly:1.0.4
[warn]            +- org.scala-lang:scala-compiler:2.12.0-03cc6f9-SNAPSHOT (/localhome/doeraene/projects/scalajs/project/Build.scala#L477)
[warn]            +- org.scala-js:scalajs-compiler_2.12.0-03cc6f9-SNAPSHOT:0.6.8-SNAPSHOT ()

Is there another resolver somewhere for the nightlies of scala-xml and scala-parser-combinators that I can use?

@retronym
Copy link
Author

@sjrd
Copy link
Member
sjrd commented Mar 10, 2016

OK thanks now I can resolve everything. Working on it.

sjrd added a commit to sjrd/scala-js that referenced this issue Mar 10, 2016
…ses).

The main changes are actually related to keeping source
compatibility with older versions, through more compat hacks.

Also:
* Use isTraitOrInterface instead of isInterface to identify
  something that should be an interface at the IR level.
* A method is abstract iff its body is EmptyTree.
sjrd added a commit to sjrd/scala-js that referenced this issue Mar 10, 2016
…ses).

The main changes are actually related to keeping source
compatibility with older versions, through more compat hacks.

Also:
* Use isTraitOrInterface instead of isInterface to identify
  something that should be an interface at the IR level.
* A method is abstract iff its body is EmptyTree.
@sjrd sjrd closed this as completed in eefb2cb Mar 11, 2016
sjrd added a commit that referenced this issue Mar 11, 2016
Fix #2285: Adapt to 2.12 trait encoding (removal of impl classes).
@sjrd sjrd removed the has-pr label Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream This issue derives from a bug or a change in one of our upstream dependencies.
Projects
None yet
Development

No branches or pull requests

2 participants
0