-
Notifications
You must be signed in to change notification settings - Fork 94
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
Update to Dotty v0.23 #69
Conversation
fixes #67 |
@@ -10,8 +10,8 @@ object MacroCompat { | |||
inline implicit def generate: Location = ${ locationImpl() } | |||
} | |||
|
|||
def locationImpl()(given qctx: QuoteContext): Expr[Location] = { | |||
import qctx.tasty.{_, given} | |||
def locationImpl()(implicit qctx: QuoteContext): Expr[Location] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using
is the Scala 3 way now, I think (here and on line 24 too)
Actually for reasons I don’t know, they went back to implicit in some cases. Try putting it back to using and see what happens. It didn’t work for me and I recall reading about it.
…Sent from my iPhone
On Mar 19, 2020, at 8:40 PM, Seth Tisue ***@***.***> wrote:
@SethTisue commented on this pull request.
In munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala:
> @@ -10,8 +10,8 @@ object MacroCompat {
inline implicit def generate: Location = ${ locationImpl() }
}
- def locationImpl()(given qctx: QuoteContext): Expr[Location] = {
- import qctx.tasty.{_, given}
+ def locationImpl()(implicit qctx: QuoteContext): Expr[Location] = {
using is the Scala 3 way now, I think (here and on line 24 too)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Reverted to using. I also noticed there's a yarn.lock file in the repo. I wasn't sure if it was needed. Presumably not--but I left it for now because it was there before. |
@gzoller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gzoller, left a few comments!
def locationImpl()(given qctx: QuoteContext): Expr[Location] = { | ||
import qctx.tasty.{_, given} | ||
def locationImpl()(using qctx: QuoteContext): Expr[Location] = { | ||
import qctx.tasty.{_, given _} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken (by reading the release notes), this can just be
import qctx.tasty.{_, given _} | |
import qctx.tasty._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried applying this change and it did not compile
.
[error] -- [E008] Member Not Found Error: /Users/lgeirsson/dev/munit/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala:15:28
[error] 15 | val path = rootPosition.sourceFile.jpath.toString
[error] | ^^^^^^^^^^^^^^^^^^^^^^^
[error] | value sourceFile is not a member of qctx.tasty.Position
[error] -- [E008] Member Not Found Error: /Users/lgeirsson/dev/munit/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala:16:33
[error] 16 | val startLine = rootPosition.startLine + 1
[error] | ^^^^^^^^^^^^^^^^^^^^^^
[error] |value startLine is not a member of qctx.tasty.Position, but could be made available as an extension method.
[error] |
[error] |The following import might fix the problem:
[error] |
[error] | import qctx.tasty.positionOps
[error] |
[error] -- Error: /Users/lgeirsson/dev/munit/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala:17:32
[error] 17 | '{ new Location(${Expr(path)}, ${Expr(startLine)}) }
[error] | ^
[error] |ambiguous implicit arguments: both method DoubleIsLiftable in object Liftable and method LongIsLiftable in object Liftable match type quoted.Liftable[String] of an implicit parameter of method apply in object Expr
[error] -- Error: /Users/lgeirsson/dev/munit/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala:17:52
[error] 17 | '{ new Location(${Expr(path)}, ${Expr(startLine)}) }
[error] | ^
[error] |ambiguous implicit arguments: both method DoubleIsLiftable in object Liftable and method LongIsLiftable in object Liftable match type quoted.Liftable[Int] of an implicit parameter of method apply in object Expr
[error] -- [E008] Member Not Found Error: /Users/lgeirsson/dev/munit/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala:26:23
[error] 26 | val source = value.unseal.pos.sourceCode
[error] | ^^^^^^^^^^^^
[error] |value unseal is not a member of quoted.Expr[T], but could be made available as an extension method.
[error] |
[error] |The following import might fix the problem:
[error] |
[error] | import qctx.tasty.QuotedExprOps.unseal
[error] |
[error] -- Error: /Users/lgeirsson/dev/munit/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala:28:30
[error] 28 | '{ new Clue(${Expr(source)}, $value, ${Expr(valueType)}) }
[error] | ^
[error] |ambiguous implicit arguments: both method DoubleIsLiftable in object Liftable and method LongIsLiftable in object Liftable match type quoted.Liftable[String] of an implicit parameter of method apply in object Expr
[error] 6 errors found
[error] (munitJVM / Compile / compileIncremen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thanks for trying!
def clueImpl[T:Type](value: Expr[T])(given qctx: QuoteContext): Expr[Clue[T]] = { | ||
import qctx.tasty.{_, given} | ||
def clueImpl[T:Type](value: Expr[T])(using qctx: QuoteContext): Expr[Clue[T]] = { | ||
import qctx.tasty.{_, given _} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
import qctx.tasty.{_, given _} | |
import qctx.tasty._ |
@@ -13,6 +13,8 @@ project/boot/ | |||
project/plugins/project/ | |||
.bloop | |||
|
|||
_site/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, where does this come from? I mean, how was _site
generated? I've never seen it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 We can merge once we've addressed the comments by @gabro
Thank you @gzoller ! |
Update build to support Dotty 0.23.0-RC1