-
-
Notifications
You must be signed in to change notification settings - Fork 7
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 #10 from Sizmek/switch-to-scala-2.13.0-M4-and-chan…
…ge-artifact-name Switch to scala 2.13.0 m4 and change artifact name
- Loading branch information
Showing
16 changed files
with
63 additions
and
15 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,23 @@ | ||
package example | ||
|
||
import scala.annotation.compileTimeOnly | ||
import scala.language.experimental.macros | ||
import scala.reflect.macros.blackbox | ||
|
||
class BugTest { | ||
def example(message: => String): LogRecord = macro BugTest.example | ||
} | ||
|
||
@compileTimeOnly("Enable macros to expand") | ||
object BugTest { | ||
def example(c: blackbox.Context)(message: c.Tree): c.Tree = { | ||
import c.universe._ | ||
val f = c.typecheck(q"() => $message") | ||
c.internal.changeOwner(message, c.internal.enclosingOwner, f.symbol) | ||
q"example.LogRecord($f)" | ||
} | ||
} | ||
|
||
case class LogRecord(messageFunction: () => String) { | ||
lazy val message: String = messageFunction() | ||
} |
File renamed without changes.
File renamed without changes.
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 @@ | ||
package example | ||
|
||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
val bt = new BugTest | ||
val d = 12.3456 | ||
val record = bt.example(f"Value: $d") | ||
println(s"Record: ${record.message}") | ||
} | ||
} |
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,14 @@ | ||
package specs | ||
|
||
import com.sizmek.fsi._ | ||
import org.scalatest.{Matchers, WordSpec} | ||
import scribe.Logging | ||
|
||
class Issue8Spec extends WordSpec with Matchers with Logging { | ||
"java.util.NoSuchElementException: value d (Issue 8)" should { | ||
"be reproduced" in { | ||
val d = 12.3456 | ||
logger.info(fs"Value: $d") | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1 +1 @@ | ||
version in ThisBuild := "0.2.1-SNAPSHOT" | ||
version in ThisBuild := "0.3.0-SNAPSHOT" |