Code Monkey home page Code Monkey logo

Comments (9)

smarter avatar smarter commented on May 29, 2024 3

If I build Play with 3.3.2 will it be necessary to make people also upgrade to Scala 3.3.2 in their projects?

No, that should not be necessary. I'll investigate your issue.

from playframework.

mkurz avatar mkurz commented on May 29, 2024 3

I can confirm Scala 3.3.3 fixes the problem. Thanks!

from playframework.

mkurz avatar mkurz commented on May 29, 2024

What I ask myself is: If I build Play with 3.3.2 will it be necessary to make people also upgrade to Scala 3.3.2 in their projects? I thought this would not be necessary (but please correct me if I am wrong).
Thanks for your help!

from playframework.

smarter avatar smarter commented on May 29, 2024

Running with -Ydebug gives more info:

java.util.NoSuchElementException: contextual$
        at dotty.tools.dotc.util.ReadOnlyMap.apply(ReadOnlyMap.scala:29)
        at dotty.tools.dotc.core.tasty.TastyUnpickler.readNameContents(TastyUnpickler.scala:72)
        at dotty.tools.dotc.core.tasty.TastyUnpickler.$init$$$anonfun$1(TastyUnpickler.scala:94)
        at dotty.tools.tasty.TastyReader.until(TastyReader.scala:125)
        at dotty.tools.dotc.core.tasty.TastyUnpickler.<init>(TastyUnpickler.scala:94)
        at dotty.tools.dotc.core.tasty.TastyUnpickler.<init>(TastyUnpickler.scala:34)
        at dotty.tools.dotc.core.tasty.DottyUnpickler.<init>(DottyUnpickler.scala:48)

/cc @bishabosha

from playframework.

mkurz avatar mkurz commented on May 29, 2024

I have my doubts right now that Scala 3.3.1 can handle the Tasty files Scala 3.3.2 generates just by looking (grep'ing) at the source code:

./dotty ((3.3.1))$ grep -ir 'contextual\$'
./dotty ((3.3.2))$
# No results

./dotty ((3.3.1))$ grep -ir 'ContextFunctionParamName'
./dotty ((3.3.1))$ 
# No results
./dotty ((3.3.2))$ grep -ir 'contextual\$'
tests/neg/i11350.check:  |                                       Could not infer type for parameter contextual$1 of anonymous function
tests/neg/i11350.check:  |                                       Could not infer type for parameter contextual$2 of anonymous function
tests/run-staging/quote-nested-5.check:  ((q2: scala.quoted.Quotes) ?=> ((contextual$2: scala.quoted.Quotes) ?=> a).apply(using q2))
tests/run-staging/quote-nested-2.check:  ((contextual$2: scala.quoted.Quotes) ?=> a).apply(using q)
tests/run-staging/multi-staging.check:  scala.quoted.runtime.Expr.quote[scala.Int](1.+(scala.quoted.runtime.Expr.splice[scala.Int](((contextual$5: scala.quoted.Quotes) ?=> scala.quoted.Expr.apply[scala.Int](x1)(scala.quoted.ToExpr.IntToExpr[scala.Int])(contextual$5))))).apply(using q1)
compiler/src/dotty/tools/dotc/core/NameKinds.scala:   *      val x: A ?=> B = (contextual$1: A) ?=> b
compiler/src/dotty/tools/dotc/core/NameKinds.scala:  val ContextFunctionParamName: UniqueNameKind = new UniqueNameKind("contextual$")
./dotty ((3.3.2))$

./dotty ((3.3.2))$ grep -ir 'ContextFunctionParamName'
compiler/src/dotty/tools/dotc/semanticdb/Scala3.scala:        && !name.is(NameKinds.ContextFunctionParamName)
compiler/src/dotty/tools/dotc/ast/Desugar.scala:import NameKinds.{UniqueName, ContextBoundParamName, ContextFunctionParamName, DefaultGetterName, WildcardParamName}
compiler/src/dotty/tools/dotc/ast/Desugar.scala:    val params = makeImplicitParameters(formals, mods, mkParamName = () => ContextFunctionParamName.fresh())
compiler/src/dotty/tools/dotc/core/NameKinds.scala:  val ContextFunctionParamName: UniqueNameKind = new UniqueNameKind("contextual$")
./dotty ((3.3.2))$

But maybe I am wrong and there are other mechanism I am not aware of which might make things work.

from playframework.

mkurz avatar mkurz commented on May 29, 2024

A workaround might be to make PathBindableMacros.scala emit evidence$ again instead of contextual$ somehow even when build with Scala 3.3.2.

from playframework.

bishabosha avatar bishabosha commented on May 29, 2024

So while these name prefixes such as contextual$ are not special in TASTy format, it seems that the compiler's own implementation of name reading is inflexible in receiving prefixes it doesn't know about, basically baking them into compatibility by proxy

from playframework.

dwijnand avatar dwijnand commented on May 29, 2024
  @sharable private val simpleNameKinds = util.HashMap[Int, ClassifiedNameKind]()
  @sharable private val qualifiedNameKinds = util.HashMap[Int, QualifiedNameKind]()
  @sharable private val numberedNameKinds = util.HashMap[Int, NumberedNameKind]()
  @sharable private val uniqueNameKinds = util.HashMap[String, UniqueNameKind]()

unique names is the outlier, in using any user-defined string as the key, rather than tag int defined in TastyFormat.NameTags.

from playframework.

mkurz avatar mkurz commented on May 29, 2024

from playframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.