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

Update to Dotty v0.23 #69

Merged
merged 2 commits into from
Mar 20, 2020
Merged

Update to Dotty v0.23 #69

merged 2 commits into from
Mar 20, 2020

Conversation

gzoller
Copy link
Contributor

@gzoller gzoller commented Mar 19, 2020

Update build to support Dotty 0.23.0-RC1

@gzoller
Copy link
Contributor Author

gzoller commented Mar 19, 2020

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] = {
Copy link
Contributor

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)

@gzoller
Copy link
Contributor Author

gzoller commented Mar 20, 2020 via email

@gzoller
Copy link
Contributor Author

gzoller commented Mar 20, 2020

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.

@gabro
Copy link
Member

gabro commented Mar 20, 2020

@gzoller yarn.lock is the dependecies lockfile of yarn, the javascript package manager. It's used for the website, and it's correct that is included in version control (see https://classic.yarnpkg.com/en/docs/yarn-lock/)

Copy link
Member

@gabro gabro left a 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 _}
Copy link
Member

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

Suggested change
import qctx.tasty.{_, given _}
import qctx.tasty._

Copy link
Member

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

Copy link
Member

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 _}
Copy link
Member

Choose a reason for hiding this comment

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

same as above

Suggested change
import qctx.tasty.{_, given _}
import qctx.tasty._

@@ -13,6 +13,8 @@ project/boot/
project/plugins/project/
.bloop

_site/
Copy link
Member

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

@olafurpg olafurpg changed the title fixes for dotty 0.23 Update to Dotty v0.23 Mar 20, 2020
Copy link
Member

@olafurpg olafurpg left a 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

@olafurpg
Copy link
Member

Thank you @gzoller !

@olafurpg olafurpg merged commit b457502 into scalameta:master Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants