Skip to content

Fix ConsoleInterface binding things properly.#314

Merged
dwijnand merged 1 commit intosbt:1.0from
dwijnand:bind-with-type
Jun 13, 2017
Merged

Fix ConsoleInterface binding things properly.#314
dwijnand merged 1 commit intosbt:1.0from
dwijnand:bind-with-type

Conversation

@dwijnand
Copy link
Member

@dwijnand dwijnand commented Jun 9, 2017

In reference to sbt/sbt#2884 I'm seeing the
console helpers (cpHelpers) being statically 'Object', and therefore not
being that helpful:

scala> cpHelpers
res0: Object = sbt.internal.ConsoleProject$Imports@610be000

scala> cpHelpers.taskKeyEvaluate
<console>:37: error: value taskKeyEvaluate is not a member of Object
       cpHelpers.taskKeyEvaluate
                 ^

scala> cpHelpers.asInstanceOf[sbt.internal.ConsoleProject.Imports].taskKeyEvaluate _
res3: sbt.TaskKey[Nothing] => sbt.internal.ConsoleProject.Evaluate[Nothing] = $$Lambda$4294/1575143649@5a54d62c

This is because I misinterpreted the Scala 2.8 compatibility layer I
tore out in 1abf6ca.

In reference to sbt/sbt#2884 I'm seeing the
console helpers (cpHelpers) being statically 'Object', and therefore not
being that helpful:

    scala> cpHelpers
    res0: Object = sbt.internal.ConsoleProject$Imports@610be000

    scala> cpHelpers.taskKeyEvaluate
    <console>:37: error: value taskKeyEvaluate is not a member of Object
           cpHelpers.taskKeyEvaluate
                     ^

    scala> cpHelpers.asInstanceOf[sbt.internal.ConsoleProject.Imports].taskKeyEvaluate _
    res3: sbt.TaskKey[Nothing] => sbt.internal.ConsoleProject.Evaluate[Nothing] = $$Lambda$4294/1575143649@5a54d62c

This is because I misinterpreted the Scala 2.8 compatibility layer I
tore out in 1abf6ca.
@dwijnand
Copy link
Member Author

dwijnand commented Jun 9, 2017

I've a feeling this might actually fix sbt/sbt#2884:

scala> val cpHelpers2 = cpHelpers.asInstanceOf[sbt.internal.ConsoleProject.Imports]
cpHelpers2: sbt.internal.ConsoleProject.Imports = sbt.internal.ConsoleProject$Imports@61cf462

scala> import cpHelpers2._
import cpHelpers2._

scala> compileInputs in compile in Compile eval
warning: there was one feature warning; for details, enable `:setting -feature' or `:replay -feature'
res0: xsbti.compile.Inputs = Inputs(compilers: Compilers(scalac: Analyzing compiler (Scala 2.12.2), javaTools: sbt.internal.inc.javac.JavaTools$$anon$1@4ad9abe), options: CompileOptions(classpath: [Ljava.io.File;@3b26b97b, sources: [Ljava.io.File;@57fffab1, classesDirectory: /s/t-2017-06-09.1403/target/scala-2.12/classes, scalacOptions: [Ljava.lang.String;@507e27c7, javacOptions: [Ljava.lang.String;@38ee2f1c, maxErrors: 100, sourcePositionMapper: sbt.util.InterfaceUtil$ConcreteF1@360da41b, order: Mixed), setup: Setup(perClasspathEntryLookup: sbt.Defaults$$anon$2@1e0ffa19, skip: false, cacheFile: /s/t-2017-06-09.1403/target/streams/compile/incCompileSetup/$global/streams/inc_compile_2.12.zip, cache: sbt.internal.inc.FreshCompilerCache@436fc703, incrementalCompil...

Copy link
Member

@jvican jvican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Should we give this a try?
/cc @eed3si9n

@eed3si9n
Copy link
Member

@dwijnand There's a label "in-progress." Does that mean it's a work in progress?

@dwijnand
Copy link
Member Author

Nope, that was automatic. This is good to go.

@dwijnand dwijnand merged commit f425583 into sbt:1.0 Jun 13, 2017
@dwijnand dwijnand deleted the bind-with-type branch June 13, 2017 17:47
dwijnand added a commit to dwijnand/zinc that referenced this pull request Jul 31, 2017
Follow-up on sbt#314 - I _still_ misinterpreted..

Turns out the ".asInstanceOf[AnyRef].getClass.getName" implementation
was the _original_ implementation. Then Mark switched to using bindValue
in sbt/sbt@4b8f0f3.

Since Scala 2.11.0 (scala/scala#1648 in particular) bindValue was
removed. So we'll use NamedParam and quietBind, both which exist since
Scala 2.9.0.

Fixes sbt/sbt#2884, tested with local releases.
dwijnand added a commit to dwijnand/zinc that referenced this pull request Aug 14, 2017
Follow-up on sbt#314 - I _still_ misinterpreted..

Turns out the ".asInstanceOf[AnyRef].getClass.getName" implementation
was the _original_ implementation. Then Mark switched to using bindValue
in sbt/sbt@4b8f0f3.

Since Scala 2.11.0 (scala/scala#1648 in particular) bindValue was
removed. So we'll use NamedParam and quietBind, both which exist since
Scala 2.9.0.

Fixes sbt/sbt#2884, tested with local releases.
dwijnand added a commit to dwijnand/zinc that referenced this pull request Sep 5, 2017
Follow-up on sbt#314 - I _still_ misinterpreted..

Turns out the ".asInstanceOf[AnyRef].getClass.getName" implementation
was the _original_ implementation. Then Mark switched to using bindValue
in sbt/sbt@4b8f0f3.

Since Scala 2.11.0 (scala/scala#1648 in particular) bindValue was
removed. So we'll use NamedParam and quietBind, both which exist since
Scala 2.9.0.

Fixes sbt/sbt#2884, tested with local releases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants