Skip to content
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

Add support for 2.12.9 #1893

Merged
merged 3 commits into from Aug 15, 2019

Conversation

@gabro
Copy link
Member

commented Aug 7, 2019

No description provided.

gabro added 2 commits Aug 7, 2019
@olafurpg
Copy link
Member

left a comment

LGTM. I recommend we publish for 2.12.9 using the same version as the latest Scalameta release

@olafurpg

This comment has been minimized.

Copy link
Member

commented Aug 7, 2019

I can look into it next week. We’ll also need a couple changes in Metals to support 2.12.9

@gabro

This comment has been minimized.

Copy link
Member Author

commented Aug 7, 2019

@olafurpg I wish it would be that simple :D Tests don't pass due to

java.lang.RuntimeException: unsupported value class scala.tools.scalap.scalax.rules.scalasig.Externa
lSymbol java.nio.file.LinkOption.NOFOLLOW_LINKS
        at scala.sys.package$.error(package.scala:30)
        at scala.meta.internal.semanticdb.package$XtensionSemanticdbConstantCompanion.apply(package.
scala:128)

in a few places

@gabro

This comment has been minimized.

Copy link
Member Author

commented Aug 7, 2019

The root cause seems to be this change scala/scala@0b28d2f

@gabro

This comment has been minimized.

Copy link
Member Author

commented Aug 7, 2019

Ok, more in details: scalap now correctly handles ConstantTypes whose underlying symbol is ExternalSymbol or Type.

Scalacp already handles the latter case in

case ConstantType(underlying: Type) =>
loop(underlying) match {
case s.NoType => s.NoType
case sarg =>
val ssym = "java/lang/Class#"
val sargs = sarg :: Nil
s.TypeRef(s.NoType, ssym, sargs)
}

but it doesn't handle the ExternalSymbol case (which happens, for example, in case the constant is a Java enum) here:

def value: Option[Any] = {
const match {
case NoConstant => None
case UnitConstant() => Some(())
case BooleanConstant(value) => Some(value)
case ByteConstant(value) => Some(value.toByte)
case ShortConstant(value) => Some(value.toShort)
case CharConstant(value) => Some(value.toChar)
case IntConstant(value) => Some(value)
case LongConstant(value) => Some(value)
case FloatConstant(value) => Some(value)
case DoubleConstant(value) => Some(value)
case StringConstant(value) => Some(value)
case NullConstant() => Some(null)
}
}
}

I'm not sure of what's the correct fix fo this.

Correctly handle signature references to Java enums in scalacp.
Previously, scalacp didn't emit signatures that references Java enums.
Now, thanks to a recent fix in Scala 2.12.9
(scala/scala@0b28d2f)
we can read these signatures from the classpath.

This commit additionally adds an `sbt` launcher because I've started
using the coursier sbt launcher on my computer by default, which works
great in all the sbt 1.x builds that I've tried it but not in the 0.13
Scalameta build.

@olafurpg olafurpg merged commit d1db1e5 into scalameta:master Aug 15, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.