diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index f986c96363b3..c08f215ff6ff 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -800,10 +800,12 @@ object desugar { Nil } } + val classMods = if mods.is(Given) then mods &~ Given | Synthetic else mods cpy.TypeDef(cdef: TypeDef)( name = className, rhs = cpy.Template(impl)(constr, parents1, clsDerived, self1, - tparamAccessors ::: vparamAccessors ::: normalizedBody ::: caseClassMeths)): TypeDef + tparamAccessors ::: vparamAccessors ::: normalizedBody ::: caseClassMeths) + ).withMods(classMods) } // install the watch on classTycon diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index fe6c8b7ba9dd..baaf125c4f82 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -913,7 +913,7 @@ object Parsers { lookahead.nextToken() skipParams() skipParams() - lookahead.isIdent(nme.as) + lookahead.token == COLON || lookahead.isIdent(nme.as) def followingIsExtension() = val next = in.lookahead.token @@ -1281,11 +1281,11 @@ object Parsers { def possibleTemplateStart(isNew: Boolean = false): Unit = in.observeColonEOL() - if in.token == COLONEOL then + if in.token == COLONEOL || in.token == WITHEOL then if in.lookahead.isIdent(nme.end) then in.token = NEWLINE else in.nextToken() - if in.token != INDENT then + if in.token != INDENT && in.token != LBRACE then syntaxErrorOrIncomplete(i"indented definitions expected, ${in}") else newLineOptWhenFollowedBy(LBRACE) @@ -3516,9 +3516,8 @@ object Parsers { syntaxError(i"extension clause can only define methods", stat.span) } - /** GivenDef ::= [GivenSig] Type ‘=’ Expr - * | [GivenSig] ConstrApps [TemplateBody] - * GivenSig ::= [id] [DefTypeParamClause] {UsingParamClauses} ‘as’ + /** GivenDef ::= [GivenSig] (Type [‘=’ Expr] | StructuralInstance) + * GivenSig ::= [id] [DefTypeParamClause] {UsingParamClauses} ‘:’ */ def givenDef(start: Offset, mods: Modifiers, givenMod: Mod) = atSpan(start, nameStart) { var mods1 = addMod(mods, givenMod) @@ -3535,10 +3534,13 @@ object Parsers { else Nil newLinesOpt() val noParams = tparams.isEmpty && vparamss.isEmpty + val newSyntax = in.token == COLON if !(name.isEmpty && noParams) then - accept(nme.as) - val parents = constrApps(commaOK = true) - if in.token == EQUALS && parents.length == 1 && parents.head.isType then + if isIdent(nme.as) then in.nextToken() + else accept(COLON) + val parents = constrApp() :: withConstrApps() + val parentsIsType = parents.length == 1 && parents.head.isType + if in.token == EQUALS && parentsIsType then accept(EQUALS) mods1 |= Final if noParams && !mods.is(Inline) then @@ -3546,12 +3548,21 @@ object Parsers { ValDef(name, parents.head, subExpr()) else DefDef(name, tparams, vparamss, parents.head, subExpr()) + else if newSyntax && in.token != WITH && in.token != WITHEOL && parentsIsType then + if name.isEmpty then + syntaxError(em"anonymous given cannot be abstract") + DefDef(name, tparams, vparamss, parents.head, EmptyTree) else - possibleTemplateStart() val tparams1 = tparams.map(tparam => tparam.withMods(tparam.mods | PrivateLocal)) val vparamss1 = vparamss.map(_.map(vparam => vparam.withMods(vparam.mods &~ Param | ParamAccessor | Protected))) - val templ = templateBodyOpt(makeConstructor(tparams1, vparamss1), parents, Nil) + val constr = makeConstructor(tparams1, vparamss1) + val templ = + if newSyntax || in.token == WITHEOL || in.token == WITH then + withTemplate(constr, parents) + else + possibleTemplateStart() + templateBodyOpt(makeConstructor(tparams1, vparamss1), parents, Nil) if tparams.isEmpty && vparamss.isEmpty then ModuleDef(name, templ) else TypeDef(name.toTypeName, templ) end gdef @@ -3626,6 +3637,18 @@ object Parsers { else Nil t :: ts + + /** `{`with` ConstrApp} but no EOL allowed after `with`. + */ + def withConstrApps(): List[Tree] = + if in.token == WITH then + in.observeWithEOL() // converts token to WITHEOL if at end of line + if in.token == WITH && in.lookahead.token != LBRACE then + in.nextToken() + constrApp() :: withConstrApps() + else Nil + else Nil + /** Template ::= InheritClauses [TemplateBody] * InheritClauses ::= [‘extends’ ConstrApps] [‘derives’ QualId {‘,’ QualId}] */ @@ -3691,6 +3714,14 @@ object Parsers { template(emptyConstructor) r + /** with Template, with EOL interpreted */ + def withTemplate(constr: DefDef, parents: List[Tree]): Template = + if in.token != WITHEOL then accept(WITH) + possibleTemplateStart() // consumes a WITHEOL token + val (self, stats) = templateBody() + Template(constr, parents, Nil, self, stats) + .withSpan(Span(constr.span.orElse(parents.head.span).start, in.lastOffset)) + /* -------- STATSEQS ------------------------------------------- */ /** Create a tree representing a packaging */ diff --git a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala index 97878c199af4..144707e7442d 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala @@ -150,6 +150,7 @@ object Scanners { private[Scanners] var allowLeadingInfixOperators = true var debugTokenStream = false + val showLookAheadOnDebug = false val rewrite = ctx.settings.rewrite.value.isDefined val oldSyntax = ctx.settings.oldSyntax.value @@ -315,7 +316,8 @@ object Scanners { } final def printState() = - if debugTokenStream then print("[" + show + "]") + if debugTokenStream && (showLookAheadOnDebug || !isInstanceOf[LookaheadScanner]) then + print(s"[$show${if isInstanceOf[LookaheadScanner] then "(LA)" else ""}]") /** Insert `token` at assumed `offset` in front of current one. */ def insert(token: Token, offset: Int) = { @@ -505,12 +507,15 @@ object Scanners { |Previous indent : $lastWidth |Latest indent : $nextWidth""" - def observeColonEOL(): Unit = - if token == COLON then + private def switchAtEOL(testToken: Token, eolToken: Token): Unit = + if token == testToken then lookAhead() val atEOL = isAfterLineEnd || token == EOF reset() - if atEOL then token = COLONEOL + if atEOL then token = eolToken + + def observeColonEOL(): Unit = switchAtEOL(COLON, COLONEOL) + def observeWithEOL(): Unit = switchAtEOL(WITH, WITHEOL) def observeIndented(): Unit = if indentSyntax && isNewLine then diff --git a/compiler/src/dotty/tools/dotc/parsing/Tokens.scala b/compiler/src/dotty/tools/dotc/parsing/Tokens.scala index 2e9a03ad771f..897fa0bf2957 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Tokens.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Tokens.scala @@ -121,14 +121,14 @@ abstract class TokensCommon { def isKeyword(token: Token): Boolean = keywords contains token /** parentheses */ - final val LPAREN = 90; enter(LPAREN, "'('") - final val RPAREN = 91; enter(RPAREN, "')'") - final val LBRACKET = 92; enter(LBRACKET, "'['") - final val RBRACKET = 93; enter(RBRACKET, "']'") - final val LBRACE = 94; enter(LBRACE, "'{'") - final val RBRACE = 95; enter(RBRACE, "'}'") - final val INDENT = 96; enter(INDENT, "indent") - final val OUTDENT = 97; enter(OUTDENT, "unindent") + final val LPAREN = 91; enter(LPAREN, "'('") + final val RPAREN = 92; enter(RPAREN, "')'") + final val LBRACKET = 93; enter(LBRACKET, "'['") + final val RBRACKET = 94; enter(RBRACKET, "']'") + final val LBRACE = 95; enter(LBRACE, "'{'") + final val RBRACE = 96; enter(RBRACE, "'}'") + final val INDENT = 97; enter(INDENT, "indent") + final val OUTDENT = 98; enter(OUTDENT, "unindent") final val firstParen = LPAREN final val lastParen = OUTDENT @@ -204,10 +204,11 @@ object Tokens extends TokensCommon { final val QUOTE = 87; enter(QUOTE, "'") final val COLONEOL = 88; enter(COLONEOL, ":", ": at eol") - final val SELFARROW = 89; enter(SELFARROW, "=>") // reclassified ARROW following self-type + final val WITHEOL = 89; enter(WITHEOL, "with", "with at eol") + final val SELFARROW = 90; enter(SELFARROW, "=>") // reclassified ARROW following self-type /** XML mode */ - final val XMLSTART = 98; enter(XMLSTART, "$XMLSTART$<") // TODO: deprecate + final val XMLSTART = 99; enter(XMLSTART, "$XMLSTART$<") // TODO: deprecate final val alphaKeywords: TokenSet = tokenRange(IF, MACRO) final val symbolicKeywords: TokenSet = tokenRange(USCORE, CTXARROW) @@ -276,7 +277,7 @@ object Tokens extends TokensCommon { final val closingRegionTokens = BitSet(RBRACE, RPAREN, RBRACKET, CASE) | statCtdTokens final val canStartIndentTokens: BitSet = - statCtdTokens | BitSet(COLONEOL, EQUALS, ARROW, LARROW, WHILE, TRY, FOR, IF) + statCtdTokens | BitSet(COLONEOL, WITHEOL, EQUALS, ARROW, LARROW, WHILE, TRY, FOR, IF) // `if` is excluded because it often comes after `else` which makes for awkward indentation rules TODO: try to do without the exception /** Faced with the choice between a type and a formal parameter, the following diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index dd8044624b8b..90d007074c83 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -443,7 +443,7 @@ object Checking { fail(ParamsNoInline(sym.owner)) if sym.isInlineMethod && !sym.is(Deferred) && sym.allOverriddenSymbols.nonEmpty then checkInlineOverrideParameters(sym) - if (sym.isOneOf(GivenOrImplicit)) { + if (sym.is(Implicit)) { if (sym.owner.is(Package)) fail(TopLevelCantBeImplicit(sym)) if (sym.isType) diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index ac6ad8ac4694..9297ab24c442 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -241,7 +241,7 @@ class Namer { typer: Typer => tree match { case tree: TypeDef if tree.isClassDef => - val flags = checkFlags(tree.mods.flags &~ GivenOrImplicit) + val flags = checkFlags(tree.mods.flags &~ Implicit) val name = checkNoConflict(tree.name, flags.is(Private), tree.span).asTypeName val cls = createOrRefine[ClassSymbol](tree, name, flags, ctx.owner, diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala index 5590554dcf50..3016cbaa18a8 100644 --- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala @@ -503,7 +503,9 @@ object RefChecks { def prelude = ( if (clazz.isAnonymousClass || clazz.is(Module)) "object creation impossible" else if (mustBeMixin) s"$clazz needs to be a mixin" - else s"$clazz needs to be abstract") + ", since" + else if clazz.is(Synthetic) then "instance cannot be created" + else s"$clazz needs to be abstract" + ) + ", since" if (abstractErrors.isEmpty) abstractErrors ++= List(prelude, msg) else abstractErrors += msg diff --git a/docs/docs/internals/syntax.md b/docs/docs/internals/syntax.md index 7d2f3d18ef4e..6999e87ad774 100644 --- a/docs/docs/internals/syntax.md +++ b/docs/docs/internals/syntax.md @@ -205,9 +205,11 @@ Expr1 ::= [‘inline’] ‘if’ ‘(’ Expr ‘)’ {nl} Expr [[ | [SimpleExpr ‘.’] id ‘=’ Expr Assign(expr, expr) | SimpleExpr1 ArgumentExprs ‘=’ Expr Assign(expr, expr) | PostfixExpr [Ascription] + | StructuralInstance | ‘inline’ InfixExpr MatchClause Ascription ::= ‘:’ InfixType Typed(expr, tp) | ‘:’ Annotation {Annotation} Typed(expr, Annotated(EmptyTree, annot)*) +StructuralInstance ::= ConstrApp {‘with’ ConstrApp} ‘with’ TemplateBody New templ Catches ::= ‘catch’ (Expr | ExprCaseClause) PostfixExpr ::= InfixExpr [id] PostfixOp(expr, op) InfixExpr ::= PrefixExpr @@ -396,9 +398,8 @@ ClassConstr ::= [ClsTypeParamClause] [ConstrMods] ClsParamClauses ConstrMods ::= {Annotation} [AccessModifier] ObjectDef ::= id [Template] ModuleDef(mods, name, template) // no constructor EnumDef ::= id ClassConstr InheritClauses EnumBody EnumDef(mods, name, tparams, template) -GivenDef ::= [GivenSig] Type ‘=’ Expr - | [GivenSig] ConstrApps [TemplateBody] -GivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘as’ -- one of `id`, `DefParamClause`, `UsingParamClause` must appear +GivenDef ::= [GivenSig] (Type [‘=’ Expr] | StructuralInstance) +GivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefParamClause`, `UsingParamClause` must be present Extension ::= ‘extension’ [DefTypeParamClause] ‘(’ DefParam ‘)’ {UsingParamClause}] ExtMethods ExtMethods ::= ExtMethod | [nl] ‘{’ ExtMethod {semi ExtMethod ‘}’ diff --git a/docs/docs/reference/changed-features/implicit-resolution.md b/docs/docs/reference/changed-features/implicit-resolution.md index 174baa089f83..41523c30507c 100644 --- a/docs/docs/reference/changed-features/implicit-resolution.md +++ b/docs/docs/reference/changed-features/implicit-resolution.md @@ -41,10 +41,10 @@ no longer applies. **3.** Package prefixes no longer contribute to the implicit search scope of a type. Example: ```scala package p - given a as A + given a: A = A() object o { - given b as B + given b: B = B() type C } ``` diff --git a/docs/docs/reference/changed-features/numeric-literals.md b/docs/docs/reference/changed-features/numeric-literals.md index 29a903f8390e..0888f5a5f24a 100644 --- a/docs/docs/reference/changed-features/numeric-literals.md +++ b/docs/docs/reference/changed-features/numeric-literals.md @@ -133,38 +133,32 @@ should produce the `BigFloat` number `BigFloat(-123, 997)`: The companion object of `BigFloat` defines an `apply` constructor method to construct a `BigFloat` from a `digits` string. Here is a possible implementation: ```scala -object BigFloat { +object BigFloat: import scala.util.FromDigits - def apply(digits: String): BigFloat = { - val (mantissaDigits, givenExponent) = digits.toUpperCase.split('E') match { + def apply(digits: String): BigFloat = + val (mantissaDigits, givenExponent) = digits.toUpperCase.split('E') match case Array(mantissaDigits, edigits) => val expo = try FromDigits.intFromDigits(edigits) - catch { - case ex: FromDigits.NumberTooLarge => - throw FromDigits.NumberTooLarge(s"exponent too large: $edigits") - } + catch case ex: FromDigits.NumberTooLarge => + throw FromDigits.NumberTooLarge(s"exponent too large: $edigits") (mantissaDigits, expo) case Array(mantissaDigits) => (mantissaDigits, 0) - } - val (intPart, exponent) = mantissaDigits.split('.') match { + val (intPart, exponent) = mantissaDigits.split('.') match case Array(intPart, decimalPart) => (intPart ++ decimalPart, givenExponent - decimalPart.length) case Array(intPart) => (intPart, givenExponent) - } BigFloat(BigInt(intPart), exponent) - } ``` To accept `BigFloat` literals, all that's needed in addition is a `given` instance of type `FromDigits.Floating[BigFloat]`: ```scala - given FromDigits as FromDigits.Floating[BigFloat] { + given FromDigits: FromDigits.Floating[BigFloat] with def fromDigits(digits: String) = apply(digits) - } -} // end BigFloat +end BigFloat ``` Note that the `apply` method does not check the format of the `digits` argument. It is assumed that only valid arguments are passed. For calls coming from the compiler diff --git a/docs/docs/reference/contextual/by-name-context-parameters.md b/docs/docs/reference/contextual/by-name-context-parameters.md index a259cea88ae5..d644536ab616 100644 --- a/docs/docs/reference/contextual/by-name-context-parameters.md +++ b/docs/docs/reference/contextual/by-name-context-parameters.md @@ -10,14 +10,12 @@ trait Codec[T] { def write(x: T): Unit } -given intCodec as Codec[Int] = ??? +given intCodec: Codec[Int] = ??? -given optionCodec[T](using ev: => Codec[T]) as Codec[Option[T]] { - def write(xo: Option[T]) = xo match { +given optionCodec[T](using ev: => Codec[T]): Codec[Option[T]] with + def write(xo: Option[T]) = xo match case Some(x) => ev.write(x) case None => - } -} val s = summon[Codec[Option[Int]]] @@ -36,7 +34,7 @@ The precise steps for synthesizing an argument for a by-name context parameter o 1. Create a new given of type `T`: ```scala - given lv as T = ??? + given lv: T = ??? ``` where `lv` is an arbitrary fresh name. @@ -46,7 +44,7 @@ The precise steps for synthesizing an argument for a by-name context parameter o ```scala - { given lv as T = E; lv } + { given lv: T = E; lv } ``` Otherwise, return `E` unchanged. diff --git a/docs/docs/reference/contextual/context-functions.md b/docs/docs/reference/contextual/context-functions.md index 279d2ad13356..130c0d1333c1 100644 --- a/docs/docs/reference/contextual/context-functions.md +++ b/docs/docs/reference/contextual/context-functions.md @@ -13,7 +13,7 @@ Context functions are written using `?=>` as the "arrow" sign. They are applied to synthesized arguments, in the same way methods with context parameters are applied. For instance: ```scala - given ec as ExecutionContext = ... + given ec: ExecutionContext = ... def f(x: Int): ExecutionContext ?=> Int = ... @@ -86,13 +86,13 @@ with context function types as parameters to avoid the plumbing boilerplate that would otherwise be necessary. ```scala def table(init: Table ?=> Unit) = { - given t as Table // note the use of a creator application; same as: given t as Table = new Table + given t: Table = Table() init t } def row(init: Row ?=> Unit)(using t: Table) = { - given r as Row + given r: Row = Row() init t.add(r) } diff --git a/docs/docs/reference/contextual/conversions.md b/docs/docs/reference/contextual/conversions.md index 7faeb3aac0d5..234a6cae7f87 100644 --- a/docs/docs/reference/contextual/conversions.md +++ b/docs/docs/reference/contextual/conversions.md @@ -37,7 +37,7 @@ If such an instance `C` is found, the expression `e` is replaced by `C.apply(e)` primitive number types to subclasses of `java.lang.Number`. For instance, the conversion from `Int` to `java.lang.Integer` can be defined as follows: ```scala -given int2Integer as Conversion[Int, java.lang.Integer] = +given int2Integer: Conversion[Int, java.lang.Integer] = java.lang.Integer.valueOf(_) ``` @@ -59,9 +59,9 @@ object Completions { // // CompletionArg.fromStatusCode(statusCode) - given fromString as Conversion[String, CompletionArg] = Error(_) - given fromFuture as Conversion[Future[HttpResponse], CompletionArg] = Response(_) - given fromStatusCode as Conversion[Future[StatusCode], CompletionArg] = Status(_) + given fromString : Conversion[String, CompletionArg] = Error(_) + given fromFuture : Conversion[Future[HttpResponse], CompletionArg] = Response(_) + given fromStatusCode : Conversion[Future[StatusCode], CompletionArg] = Status(_) } import CompletionArg._ diff --git a/docs/docs/reference/contextual/derivation-macro.md b/docs/docs/reference/contextual/derivation-macro.md index 82b01e001f18..810332ddbf22 100644 --- a/docs/docs/reference/contextual/derivation-macro.md +++ b/docs/docs/reference/contextual/derivation-macro.md @@ -25,13 +25,13 @@ we need to implement a method `Eq.derived` on the companion object of `Eq` that produces a quoted instance for `Eq[T]`. Here is a possible signature, ```scala -given derived[T: Type](using Quotes) as Expr[Eq[T]] +given derived[T: Type](using Quotes): Expr[Eq[T]] ``` and for comparison reasons we give the same signature we had with `inline`: ```scala -inline given derived[T] as (m: Mirror.Of[T]) => Eq[T] = ??? +inline given derived[T]: (m: Mirror.Of[T]) => Eq[T] = ??? ``` Note, that since a type is used in a subsequent stage it will need to be lifted @@ -41,7 +41,7 @@ from the signature. The body of the `derived` method is shown below: ```scala -given derived[T: Type](using Quotes) as Expr[Eq[T]] = { +given derived[T: Type](using Quotes): Expr[Eq[T]] = { import quotes.reflect._ val ev: Expr[Mirror.Of[T]] = Expr.summon[Mirror.Of[T]].get @@ -176,7 +176,7 @@ object Eq { case '[EmptyTuple] => Nil } - given derived[T: Type](using q: Quotes) as Expr[Eq[T]] = { + given derived[T: Type](using q: Quotes): Expr[Eq[T]] = { import quotes.reflect._ val ev: Expr[Mirror.Of[T]] = Expr.summon[Mirror.Of[T]].get diff --git a/docs/docs/reference/contextual/derivation.md b/docs/docs/reference/contextual/derivation.md index 53d8cb16acac..0913d3bbe28b 100644 --- a/docs/docs/reference/contextual/derivation.md +++ b/docs/docs/reference/contextual/derivation.md @@ -19,9 +19,9 @@ The `derives` clause generates the following given instances for the `Eq`, `Orde companion object of `Tree`, ```scala -given [T: Eq] as Eq[Tree[T]] = Eq.derived -given [T: Ordering] as Ordering[Tree] = Ordering.derived -given [T: Show] as Show[Tree] = Show.derived +given [T: Eq] : Eq[Tree[T]] = Eq.derived +given [T: Ordering] : Ordering[Tree] = Ordering.derived +given [T: Show] : Show[Tree] = Show.derived ``` We say that `Tree` is the _deriving type_ and that the `Eq`, `Ordering` and `Show` instances are _derived instances_. @@ -179,7 +179,7 @@ we need to implement a method `Eq.derived` on the companion object of `Eq` that a `Mirror[T]`. Here is a possible implementation, ```scala -inline given derived[T](using m: Mirror.Of[T]) as Eq[T] = { +inline given derived[T](using m: Mirror.Of[T]): Eq[T] = { val elemInstances = summonAll[m.MirroredElemTypes] // (1) inline m match { // (2) case s: Mirror.SumOf[T] => eqSum(s, elemInstances) @@ -278,7 +278,7 @@ object Eq { } } - inline given derived[T](using m: Mirror.Of[T]) as Eq[T] = { + inline given derived[T](using m: Mirror.Of[T]): Eq[T] = { lazy val elemInstances = summonAll[m.MirroredElemTypes] inline m match { case s: Mirror.SumOf[T] => eqSum(s, elemInstances) @@ -309,7 +309,7 @@ In this case the code that is generated by the inline expansion for the derived following, after a little polishing, ```scala -given derived$Eq[T](using eqT: Eq[T]) as Eq[Opt[T]] = +given derived$Eq[T](using eqT: Eq[T]): Eq[Opt[T]] = eqSum(summon[Mirror[Opt[T]]], List( eqProduct(summon[Mirror[Sm[T]]], List(summon[Eq[T]])) @@ -326,13 +326,13 @@ As a third example, using a higher level library such as shapeless the type clas `derived` method as, ```scala -given eqSum[A](using inst: => K0.CoproductInstances[Eq, A]) as Eq[A] { +given eqSum[A](using inst: => K0.CoproductInstances[Eq, A]): Eq[A] { def eqv(x: A, y: A): Boolean = inst.fold2(x, y)(false)( [t] => (eqt: Eq[t], t0: t, t1: t) => eqt.eqv(t0, t1) ) } -given eqProduct[A](using inst: K0.ProductInstances[Eq, A]) as Eq[A] { +given eqProduct[A](using inst: K0.ProductInstances[Eq, A]): Eq[A] { def eqv(x: A, y: A): Boolean = inst.foldLeft2(x, y)(true: Boolean)( [t] => (acc: Boolean, eqt: Eq[t], t0: t, t1: t) => Complete(!eqt.eqv(t0, t1))(false)(true) ) @@ -354,7 +354,7 @@ change the code of the ADT itself. To do this, simply define an instance using as right-hand side. E.g, to implement `Ordering` for `Option` define, ```scala -given [T: Ordering] as Ordering[Option[T]] = Ordering.derived +given [T: Ordering]: Ordering[Option[T]] = Ordering.derived ``` Assuming the `Ordering.derived` method has a context parameter of type `Mirror[T]` it will be satisfied by the diff --git a/docs/docs/reference/contextual/extension-methods.md b/docs/docs/reference/contextual/extension-methods.md index 7c467b859463..798b42645c16 100644 --- a/docs/docs/reference/contextual/extension-methods.md +++ b/docs/docs/reference/contextual/extension-methods.md @@ -52,7 +52,7 @@ The three definitions above translate to ```scala def < (x: String)(y: String): Boolean = ... def +: (xs: Seq[Elem])(x: Elem): Seq[Elem] = ... -infix def min(x: Number)(y: Number): Number = ... + infix def min(x: Number)(y: Number): Number = ... ``` Note the swap of the two parameters `x` and `xs` when translating @@ -195,7 +195,7 @@ trait SafeDiv: By the second rule, an extension method can be made available by defining a given instance containing it, like this: ```scala -given ops1 as IntOps // brings safeMod into scope +given ops1: IntOps with {} // brings safeMod into scope 1.safeMod(2) ``` @@ -210,7 +210,7 @@ object List: extension [T](xs: List[List[T]]) def flatten: List[T] = xs.foldLeft(Nil: List[T])(_ ++ _) - given [T: Ordering] as Ordering[List[T]]: + given [T: Ordering]: Ordering[List[T]] with extension (xs: List[T]) def < (ys: List[T]): Boolean = ... end List diff --git a/docs/docs/reference/contextual/given-imports.md b/docs/docs/reference/contextual/given-imports.md index c2e3a8e48f2a..911641ce9988 100644 --- a/docs/docs/reference/contextual/given-imports.md +++ b/docs/docs/reference/contextual/given-imports.md @@ -8,7 +8,7 @@ A special form of import wildcard selector is used to import given instances. Ex ```scala object A { class TC - given tc as TC + given tc: TC = ??? def f(using TC) = ??? } @@ -60,10 +60,10 @@ For instance, assuming the object ```scala object Instances { - given intOrd as Ordering[Int] - given listOrd[T: Ordering] as Ordering[List[T]] - given ec as ExecutionContext = ... - given im as Monoid[Int] + given intOrd: Ordering[Int] = ... + given listOrd[T: Ordering]: Ordering[List[T]] = ... + given ec: ExecutionContext = ... + given im: Monoid[Int] = ... } ``` diff --git a/docs/docs/reference/contextual/givens.md b/docs/docs/reference/contextual/givens.md index 98f2f4504c18..d5db2108db5e 100644 --- a/docs/docs/reference/contextual/givens.md +++ b/docs/docs/reference/contextual/givens.md @@ -13,12 +13,11 @@ trait Ord[T] { extension (x: T) def > (y: T) = compare(x, y) > 0 } -given intOrd as Ord[Int] { +given intOrd: Ord[Int] with def compare(x: Int, y: Int) = if (x < y) -1 else if (x > y) +1 else 0 -} -given listOrd[T](using ord: Ord[T]) as Ord[List[T]] { +given listOrd[T](using ord: Ord[T]): Ord[List[T]] with def compare(xs: List[T], ys: List[T]): Int = (xs, ys) match case (Nil, Nil) => 0 @@ -27,7 +26,7 @@ given listOrd[T](using ord: Ord[T]) as Ord[List[T]] { case (x :: xs1, y :: ys1) => val fst = ord.compare(x, y) if (fst != 0) fst else compare(xs1, ys1) -} + ``` This code defines a trait `Ord` with two given instances. `intOrd` defines a given for the type `Ord[Int]` whereas `listOrd[T]` defines givens @@ -42,8 +41,10 @@ parameters](./using-clauses.html). The name of a given can be left out. So the definitions of the last section can also be expressed like this: ```scala -given Ord[Int] { ... } -given [T](using Ord[T]) as Ord[List[T]] { ... } +given Ord[Int] with + ... +given [T](using Ord[T]): Ord[List[T]] with + ... ``` If the name of a given is missing, the compiler will synthesize a name from the implemented type(s). @@ -63,17 +64,17 @@ use named instances. An alias can be used to define a given instance that is equal to some expression. E.g.: ```scala -given global as ExecutionContext = new ForkJoinPool() +given global: ExecutionContext = ForkJoinPool() ``` This creates a given `global` of type `ExecutionContext` that resolves to the right -hand side `new ForkJoinPool()`. +hand side `ForkJoinPool()`. The first time `global` is accessed, a new `ForkJoinPool` is created, which is then returned for this and all subsequent accesses to `global`. This operation is thread-safe. Alias givens can be anonymous as well, e.g. ```scala given Position = enclosingTree.position -given (using config: Config) as Factory = MemoizingFactory(config) +given (using config: Config): Factory = MemoizingFactory(config) ``` An alias given can have type parameters and context parameters just like any other given, @@ -84,7 +85,7 @@ but it can only implement a single type. Given aliases can have the `inline` and `transparent` modifiers. Example: ```scala -transparent inline given mkAnnotations[A, T] as Annotations[A, T] = ${ +transparent inline given mkAnnotations[A, T]: Annotations[A, T] = ${ // code producing a value of a subtype of Annotations } ``` @@ -113,12 +114,23 @@ is created for each reference. ## Syntax -Here is the new syntax for given instances, seen as a delta from the [standard context free syntax of Scala 3](../../internals/syntax.md). +Here is the syntax for given instances: ``` -TmplDef ::= ... - | ‘given’ GivenDef -GivenDef ::= [GivenSig] Type ‘=’ Expr - | [GivenSig] ConstrApps [TemplateBody] -GivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘as’ +TmplDef ::= ... + | ‘given’ GivenDef +GivenDef ::= [GivenSig] StructuralInstance + | [GivenSig] Type ‘=’ Expr + | [GivenSig] Type +GivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ +StructuralInstance ::= ConstrApp {‘with’ ConstrApp} ‘with’ TemplateBody ``` + +A given instance starts with the reserved word `given` and an optional _signature_. The signature +defines a name and/or parameters for the instance. It is followed by `:`. There are three kinds +of given instances: + + - A _structural instance_ contains one or more types or constructor applications, followed by `with` and a template body +that contains member definitions of the instance. + - An _alias instance_ contains a type, followed by `=` and a right hand side expression. + - An _abstract instance_ contains just the type, which is not followed by anything. diff --git a/docs/docs/reference/contextual/multiversal-equality.md b/docs/docs/reference/contextual/multiversal-equality.md index c420884eda8d..53743b4d3428 100644 --- a/docs/docs/reference/contextual/multiversal-equality.md +++ b/docs/docs/reference/contextual/multiversal-equality.md @@ -97,7 +97,7 @@ class Box[T](x: T) derives CanEqual By the usual rules of [type class derivation](./derivation.md), this generates the following `CanEqual` instance in the companion object of `Box`: ```scala -given [T, U](using CanEqual[T, U]) as CanEqual[Box[T], Box[U]] = CanEqual.derived +given [T, U](using CanEqual[T, U]): CanEqual[Box[T], Box[U]] = CanEqual.derived ``` That is, two boxes are comparable with `==` or `!=` if their elements are. Examples: ```scala diff --git a/docs/docs/reference/contextual/relationship-implicits.md b/docs/docs/reference/contextual/relationship-implicits.md index 53e28165a10f..a671418b9299 100644 --- a/docs/docs/reference/contextual/relationship-implicits.md +++ b/docs/docs/reference/contextual/relationship-implicits.md @@ -14,26 +14,26 @@ Given instances can be mapped to combinations of implicit objects, classes and i 1. Given instances without parameters are mapped to implicit objects. E.g., ```scala - given intOrd as Ord[Int] { ... } + given intOrd: Ord[Int] with { ... } ``` maps to ```scala - implicit object IntOrd extends Ord[Int] { ... } + implicit object intOrd extends Ord[Int] { ... } ``` 2. Parameterized givens are mapped to combinations of classes and implicit methods. E.g., ```scala - given listOrd[T](using ord: Ord[T]) as Ord[List[T]] { ... } + given listOrd[T](using ord: Ord[T]): Ord[List[T]] with { ... } ``` maps to ```scala - class ListOrd[T](implicit ord: Ord[T]) extends Ord[List[T]] { ... } - final implicit def ListOrd[T](implicit ord: Ord[T]): ListOrd[T] = new ListOrd[T] + class listOrd[T](implicit ord: Ord[T]) extends Ord[List[T]] { ... } + final implicit def listOrd[T](implicit ord: Ord[T]): listOrd[T] = new listOrd[T] ``` 3. Alias givens map to implicit methods or implicit lazy vals. If an alias has neither type nor context parameters, @@ -43,7 +43,7 @@ Given instances can be mapped to combinations of implicit objects, classes and i Examples: ```scala -given global as ExecutionContext = new ForkJoinContext() +given global: ExecutionContext = new ForkJoinContext() val ctx: Context given Context = ctx @@ -61,8 +61,8 @@ final implicit def given_Context = ctx Anonymous given instances get compiler synthesized names, which are generated in a reproducible way from the implemented type(s). For example, if the names of the `IntOrd` and `ListOrd` givens above were left out, the following names would be synthesized instead: ```scala -given given_Ord_Int as Ord[Int] { ... } -given given_Ord_List_T[T](using ord: Ord[T]) as Ord[List[T]] { ... } +given given_Ord_Int: Ord[Int] with { ... } +given given_Ord_List_T[T](using ord: Ord[T]): Ord[List[T]] with { ... } ``` The synthesized type names are formed from @@ -150,15 +150,14 @@ implicit def stringToToken(str: String): Token = new Keyword(str) one can write ```scala -given stringToToken as Conversion[String, Token] { +given stringToToken: Conversion[String, Token] with def apply(str: String): Token = KeyWord(str) -} ``` or ```scala -given stringToToken as Conversion[String, Token] = KeyWord(_) +given stringToToken: Conversion[String, Token] = KeyWord(_) ``` ### Implicit Classes diff --git a/docs/docs/reference/contextual/type-classes.md b/docs/docs/reference/contextual/type-classes.md index 412ef7834103..05bc5deff3c5 100644 --- a/docs/docs/reference/contextual/type-classes.md +++ b/docs/docs/reference/contextual/type-classes.md @@ -158,7 +158,7 @@ end Monad A `List` can be turned into a monad via this `given` instance: ```scala -given listMonad as Monad[List]: +given listMonad: Monad[List] with def pure[A](x: A): List[A] = List(x) extension [A, B](xs: List[A]) @@ -175,7 +175,7 @@ it explicitly. `Option` is an other type having the same kind of behaviour: ```scala -given optionMonad as Monad[Option]: +given optionMonad: Monad[Option] with def pure[A](x: A): Option[A] = Option(x) extension [A, B](xo: Option[A]) @@ -222,7 +222,7 @@ type ConfigDependent[Result] = Config => Result The monad instance will look like this: ```scala -given configDependentMonad as Monad[ConfigDependent]: +given configDependentMonad: Monad[ConfigDependent] with def pure[A](x: A): ConfigDependent[A] = config => x @@ -243,7 +243,7 @@ type ConfigDependent = [Result] =>> Config => Result Using this syntax would turn the previous `configDependentMonad` into: ```scala -given configDependentMonad as Monad[[Result] =>> Config => Result] +given configDependentMonad: Monad[[Result] =>> Config => Result] with def pure[A](x: A): Config => A = config => x @@ -258,7 +258,7 @@ end configDependentMonad It is likely that we would like to use this pattern with other kinds of environments than our `Config` trait. The Reader monad allows us to abstract away `Config` as a type _parameter_, named `Ctx` in the following definition: ```scala -given readerMonad[Ctx] as Monad[[X] =>> Ctx => X]: +given readerMonad[Ctx]: Monad[[X] =>> Ctx => X] with def pure[A](x: A): Ctx => A = ctx => x diff --git a/docs/docs/reference/contextual/using-clauses.md b/docs/docs/reference/contextual/using-clauses.md index 7f494f7b5845..63423e283bd8 100644 --- a/docs/docs/reference/contextual/using-clauses.md +++ b/docs/docs/reference/contextual/using-clauses.md @@ -69,9 +69,9 @@ def f(u: Universe)(using ctx: u.Context)(using s: ctx.Symbol, k: ctx.Kind) = ... Multiple using clauses are matched left-to-right in applications. Example: ```scala object global extends Universe { type Context = ... } -given ctx as global.Context { type Symbol = ...; type Kind = ... } -given sym as ctx.Symbol -given kind as ctx.Kind +given ctx : global.Context with { type Symbol = ...; type Kind = ... } +given sym : ctx.Symbol +given kind : ctx.Kind ``` Then the following calls are all valid (and normalize to the last one) ```scala diff --git a/docs/docs/reference/metaprogramming/inline.md b/docs/docs/reference/metaprogramming/inline.md index 9c8252affa71..b4df434e3750 100644 --- a/docs/docs/reference/metaprogramming/inline.md +++ b/docs/docs/reference/metaprogramming/inline.md @@ -499,8 +499,7 @@ val multiplication: 3 * 5 = 15 ``` Many of these singleton operation types are meant to be used infix (as in [SLS § -3.2.8](https://www.scala-lang.org/files/archive/spec/2.12/03-types.html#infix-types)), -and are annotated accordingly with [`infix`] modifiers. +3.2.8](https://www.scala-lang.org/files/archive/spec/2.12/03-types.html#infix-types)). Since type aliases have the same precedence rules as their term-level equivalents, the operations compose with the expected precedence rules: @@ -519,7 +518,9 @@ match type can dispatch to the correct implementation: ```scala import scala.compiletime.ops._ -infix type +[X <: Int | String, Y <: Int | String] = (X, Y) match { +import scala.annotation.infix + +type +[X <: Int | String, Y <: Int | String] = (X, Y) match { case (Int, Int) => int.+[X, Y] case (String, String) => string.+[X, Y] } diff --git a/docs/docs/reference/metaprogramming/macros-spec.md b/docs/docs/reference/metaprogramming/macros-spec.md index b902840e3d1c..9e10c15c95cf 100644 --- a/docs/docs/reference/metaprogramming/macros-spec.md +++ b/docs/docs/reference/metaprogramming/macros-spec.md @@ -191,13 +191,12 @@ With the right extractors, the "AsFunction" conversion that maps expressions over functions to functions over expressions can be implemented in user code: ```scala -given AsFunction1[T, U] as Conversion[Expr[T => U], Expr[T] => Expr[U]] { +given AsFunction1[T, U]: Conversion[Expr[T => U], Expr[T] => Expr[U]] with def apply(f: Expr[T => U]): Expr[T] => Expr[U] = (x: Expr[T]) => f match { case Lambda(g) => g(x) case _ => '{ ($f)($x) } } -} ``` This assumes an extractor ```scala diff --git a/docs/docs/reference/metaprogramming/macros.md b/docs/docs/reference/metaprogramming/macros.md index 059a43f60e44..0171865b4bcb 100644 --- a/docs/docs/reference/metaprogramming/macros.md +++ b/docs/docs/reference/metaprogramming/macros.md @@ -310,12 +310,11 @@ given Liftable[Int] { Since `Liftable` is a type class, its instances can be conditional. For example, a `List` is liftable if its element type is: ```scala -given [T: Liftable : Type] as Liftable[List[T]] { +given [T: Liftable : Type]: Liftable[List[T]] with def toExpr(xs: List[T]) = xs match { case head :: tail => '{ ${ Expr(head) } :: ${ toExpr(tail) } } case Nil => '{ Nil: List[T] } } -} ``` In the end, `Liftable` resembles very much a serialization framework. Like the latter it can be derived systematically for all diff --git a/docs/docs/reference/other-new-features/indentation.md b/docs/docs/reference/other-new-features/indentation.md index 18f00b5407d8..5cba5b6c7824 100644 --- a/docs/docs/reference/other-new-features/indentation.md +++ b/docs/docs/reference/other-new-features/indentation.md @@ -131,7 +131,7 @@ enum Color: type T = A: def f: Int -given [T](using Ord[T]) as Ord[List[T]]: +given [T](using Ord[T]): Ord[List[T]] with def compare(x: List[T], y: List[T]) = ??? extension (xs: List[Int]) diff --git a/scala3doc-testcases/src/tests/FilterTest.scala b/scala3doc-testcases/src/tests/FilterTest.scala index 2183a66a90cf..d0c45c0bada9 100644 --- a/scala3doc-testcases/src/tests/FilterTest.scala +++ b/scala3doc-testcases/src/tests/FilterTest.scala @@ -65,9 +65,9 @@ class FilterTestBase: given Map[String, Double] = Map.empty /** doc */ - protected given namedSet as Set[String | Int] = Set(1, "ala") + protected given namedSet: Set[String | Int] = Set(1, "ala") /** doc */ - given namedMap as Map[String, Double] = Map.empty + given namedMap: Map[String, Double] = Map.empty class FilterTest extends FilterTestBase with FilterTestBaseTrait: /** doc */ @@ -116,9 +116,9 @@ class FilterTest extends FilterTestBase with FilterTestBaseTrait: given List[String] = "ula" :: Nil /** doc */ - given namedList as List[String] = "ula" :: Nil + given namedList: List[String] = "ula" :: Nil /** doc */ - protected given namedSeq as Seq[String | Int | Double] = List(1) + protected given namedSeq: Seq[String | Int | Double] = List(1) extension (e: FilterTest): def extensionMethod(name: FilterTest): FilterTest = ??? diff --git a/scala3doc-testcases/src/tests/givenDRI.scala b/scala3doc-testcases/src/tests/givenDRI.scala index 2fb16fa49f42..8ae70668d869 100644 --- a/scala3doc-testcases/src/tests/givenDRI.scala +++ b/scala3doc-testcases/src/tests/givenDRI.scala @@ -10,25 +10,25 @@ given A[String] given A[Seq[String]] -given [T: A] as A[Option[T]] +given [T: A]: A[Option[T]] with {} -given [T: B] as A[T] +given [T: B]: A[T] with {} -given [C] as A[C] +given [C]: A[C] with {} given A[C] -given [S <: C] as A[S] +given [S <: C]: A[S] with {} class R: def a = 1 -given R as A[Int]: +given R: A[Int] with def a = 2 class S: class R: def a = 3 - given R as A[Int]: + given R: A[Int] with def a = 5 \ No newline at end of file diff --git a/scala3doc-testcases/src/tests/givenSignatures.scala b/scala3doc-testcases/src/tests/givenSignatures.scala index 4364a7e4c0a8..4b0d815cc86b 100644 --- a/scala3doc-testcases/src/tests/givenSignatures.scala +++ b/scala3doc-testcases/src/tests/givenSignatures.scala @@ -15,16 +15,16 @@ class GivenClass { extension (x: T) def < (y: T) = compare(x, y) < 0 extension (x: T) def > (y: T) = compare(x, y) > 0 } - given intOrd as Ord[Int] { + given intOrd: Ord[Int] with { def compare(x: Int, y: Int) = if (x < y) -1 else if (x > y) +1 else 0 } - given asd(using int: Int) as B + given asd(using int: Int): B with {} - given asd2[T] as C[T] + given asd2[T]: C[T] with {} - given listOrd[T](using ord: Ord[T]) as Ord[List[T]] { + given listOrd[T](using ord: Ord[T]): Ord[List[T]] with { def compare(xs: List[T], ys: List[T]): Int = (xs, ys) match case (Nil, Nil) => 0 @@ -35,7 +35,7 @@ class GivenClass { if (fst != 0) fst else compare(xs1, ys1) } - given IntOps as Int.type = Int + given IntOps: Int.type = Int given GivenType = GivenType() diff --git a/scala3doc-testcases/src/tests/implicitConversions.scala b/scala3doc-testcases/src/tests/implicitConversions.scala index 899fab330e79..720eab1ccb1a 100644 --- a/scala3doc-testcases/src/tests/implicitConversions.scala +++ b/scala3doc-testcases/src/tests/implicitConversions.scala @@ -2,7 +2,7 @@ package tests package implicitConversions -given Conversion[A, B] { +given Conversion[A, B] with { def apply(a: A): B = ??? } diff --git a/scala3doc-testcases/src/tests/implicitConversions2.scala b/scala3doc-testcases/src/tests/implicitConversions2.scala index 018164b0e5c0..a10c5b86b43e 100644 --- a/scala3doc-testcases/src/tests/implicitConversions2.scala +++ b/scala3doc-testcases/src/tests/implicitConversions2.scala @@ -29,7 +29,7 @@ class OuterClass //unexpected = ??? } - given conversionFromVal as Conversion[ClassWithConversionFromVal, Methods] //unexpected + given conversionFromVal: Conversion[ClassWithConversionFromVal, Methods] with //unexpected { def apply(a: ClassWithConversionFromVal): Methods //unexpected = ??? diff --git a/scala3doc-testcases/src/tests/shadowingDRI.scala b/scala3doc-testcases/src/tests/shadowingDRI.scala index 295515091ae1..0cdc2b2ce719 100644 --- a/scala3doc-testcases/src/tests/shadowingDRI.scala +++ b/scala3doc-testcases/src/tests/shadowingDRI.scala @@ -7,4 +7,4 @@ class S: class R: def findThisDeclaration = 1 - given R as A[B] \ No newline at end of file + given R: A[B] with {} \ No newline at end of file diff --git a/tests/disabled/pos-macros/i7853/JsonEncoder_1.scala b/tests/disabled/pos-macros/i7853/JsonEncoder_1.scala index d37c84b861ad..09e504118ca1 100644 --- a/tests/disabled/pos-macros/i7853/JsonEncoder_1.scala +++ b/tests/disabled/pos-macros/i7853/JsonEncoder_1.scala @@ -35,15 +35,15 @@ object JsonEncoder { } } - given listEncoder[T](using encoder: JsonEncoder[T]) as JsonEncoder[List[T]] { + given listEncoder[T](using encoder: JsonEncoder[T]): JsonEncoder[List[T]] with { def encode(list: List[T]) = s"[${ list.map(v => encoder.encode(v)).mkString(", ") }]" } - given intEncoder as JsonEncoder[Int] { + given intEncoder: JsonEncoder[Int] with { def encode(value: Int) = value + "" } - given stringEncoder as JsonEncoder[String] { + given stringEncoder: JsonEncoder[String] with { def encode(value: String) = value } } diff --git a/tests/disabled/pos/i7851.scala b/tests/disabled/pos/i7851.scala index 095de26cf0eb..2098a04f068a 100644 --- a/tests/disabled/pos/i7851.scala +++ b/tests/disabled/pos/i7851.scala @@ -1,14 +1,14 @@ trait Wrappable[T] { } -given Wrappable[Float] { } +given Wrappable[Float] with { } case class Wrapped[T: Wrappable](value: T) trait Wrapper[T] { type WrappedT } object Wrapper { type Aux[T <: Tuple, WrappedT0 <: Tuple] = Wrapper[T] { type WrappedT = WrappedT0 } } -given Wrapper[EmptyTuple] { type WrappedT = EmptyTuple } +given Wrapper[EmptyTuple] with { type WrappedT = EmptyTuple } -given [T: Wrappable] as Wrapper[T] { type WrappedT = Wrapped[T] } +given [T: Wrappable]: Wrapper[T] with with { type WrappedT = Wrapped[T] } given [H: Wrappable, T <: Tuple, WrappedT0 <: Tuple] (using Wrapper.Aux[T, WrappedT0]) diff --git a/tests/disabled/pos/i8311.scala b/tests/disabled/pos/i8311.scala index 93649a06154d..eeecd97a7e7e 100644 --- a/tests/disabled/pos/i8311.scala +++ b/tests/disabled/pos/i8311.scala @@ -8,8 +8,8 @@ class Foo object test: - given box[A](using Show[A]) as Show[Box[A]] = _.toString - given foo as Show[Foo] = _.toString + given box[A](using Show[A]): Show[Box[A]] = _.toString + given foo: Show[Foo] = _.toString def run(s: Box[Box[Foo]]): Unit = val x = summon[Show[Box[Box[Foo]]]] diff --git a/tests/init/crash/i6914.scala b/tests/init/crash/i6914.scala index aa2cd26def6d..723b2ef94e0b 100644 --- a/tests/init/crash/i6914.scala +++ b/tests/init/crash/i6914.scala @@ -5,7 +5,7 @@ object test1 { class ToExpr[T](using Liftable[T]) extends Conversion[T, Expr[T]] { def apply(x: T): Expr[T] = ??? } - given toExprFun[T](using Liftable[T]) as ToExpr[T] + given toExprFun[T](using Liftable[T]): ToExpr[T] with {} given Liftable[Int] = ??? given Liftable[String] = ??? @@ -18,7 +18,7 @@ object test1 { object test2 { - given autoToExpr[T](using Liftable[T]) as Conversion[T, Expr[T]] { + given autoToExpr[T](using Liftable[T]): Conversion[T, Expr[T]] with { def apply(x: T): Expr[T] = ??? } diff --git a/tests/init/crash/i7821.scala b/tests/init/crash/i7821.scala index 523fa1e7306c..1574801826bc 100644 --- a/tests/init/crash/i7821.scala +++ b/tests/init/crash/i7821.scala @@ -3,7 +3,7 @@ object XObject { def anX: X = 5 - given ops as Object { + given ops: Object with { extension (x: X) def + (y: X): X = x + y } } @@ -13,7 +13,7 @@ object MyXObject { def anX: MyX = XObject.anX - given ops as Object { + given ops: Object with { extension (x: MyX) def + (y: MyX): MyX = x + y // error: warring: Infinite recursive call } } diff --git a/tests/neg-custom-args/fatal-warnings/i7821.scala b/tests/neg-custom-args/fatal-warnings/i7821.scala index 523fa1e7306c..1574801826bc 100644 --- a/tests/neg-custom-args/fatal-warnings/i7821.scala +++ b/tests/neg-custom-args/fatal-warnings/i7821.scala @@ -3,7 +3,7 @@ object XObject { def anX: X = 5 - given ops as Object { + given ops: Object with { extension (x: X) def + (y: X): X = x + y } } @@ -13,7 +13,7 @@ object MyXObject { def anX: MyX = XObject.anX - given ops as Object { + given ops: Object with { extension (x: MyX) def + (y: MyX): MyX = x + y // error: warring: Infinite recursive call } } diff --git a/tests/neg-custom-args/impl-conv/A.scala b/tests/neg-custom-args/impl-conv/A.scala index 4598172fd18a..31eccf4fa4f7 100644 --- a/tests/neg-custom-args/impl-conv/A.scala +++ b/tests/neg-custom-args/impl-conv/A.scala @@ -3,7 +3,7 @@ package implConv object A { implicit def s2i(x: String): Int = Integer.parseInt(x) // error: feature - given i2s as Conversion[Int, String] = _.toString // ok + given i2s: Conversion[Int, String] = _.toString // ok implicit class Foo(x: String) { def foo = x.length diff --git a/tests/neg-custom-args/implicit-conversions.scala b/tests/neg-custom-args/implicit-conversions.scala index fd75ca6c9e2d..2cf1a85d7540 100644 --- a/tests/neg-custom-args/implicit-conversions.scala +++ b/tests/neg-custom-args/implicit-conversions.scala @@ -3,11 +3,11 @@ class B object A { - given Conversion[A, B] { + given Conversion[A, B] with { def apply(x: A): B = ??? } - given Conversion[B, A] { + given Conversion[B, A] with { def apply(x: B): A = ??? } } @@ -15,7 +15,7 @@ object A { class C object D { - given Conversion[A, C] { + given Conversion[A, C] with { def apply(x: A): C = ??? } } diff --git a/tests/neg-custom-args/infix.scala b/tests/neg-custom-args/infix.scala index 02c3be4e30ef..dc015215bdde 100644 --- a/tests/neg-custom-args/infix.scala +++ b/tests/neg-custom-args/infix.scala @@ -6,7 +6,7 @@ class C: def +(x: Int): Int = ??? object C: - given AnyRef: + given AnyRef with extension (x: C) infix def iop (y: Int) = ??? def mop (y: Int) = ??? diff --git a/tests/neg-macros/BigFloat/BigFloat_1.scala b/tests/neg-macros/BigFloat/BigFloat_1.scala index 296d14e0ee50..54ff41a6e61a 100644 --- a/tests/neg-macros/BigFloat/BigFloat_1.scala +++ b/tests/neg-macros/BigFloat/BigFloat_1.scala @@ -35,7 +35,7 @@ object BigFloat extends App { def fromDigits(digits: String) = apply(digits) } - given BigFloatFromDigits { + given BigFloatFromDigits with { override inline def fromDigits(digits: String) = ${ BigFloatFromDigitsImpl('digits) } @@ -43,7 +43,7 @@ object BigFloat extends App { // Should be in StdLib: - given Liftable[BigInt] { + given Liftable[BigInt] with { def toExpr(x: BigInt) = '{BigInt(${Expr(x.toString)})} } diff --git a/tests/neg-macros/GenericNumLits/Even_1.scala b/tests/neg-macros/GenericNumLits/Even_1.scala index be618d1cd741..6dc1117f25b6 100644 --- a/tests/neg-macros/GenericNumLits/Even_1.scala +++ b/tests/neg-macros/GenericNumLits/Even_1.scala @@ -16,7 +16,7 @@ object Even { def fromDigits(digits: String) = evenFromDigits(digits) } - given EvenFromDigits { + given EvenFromDigits with { override inline def fromDigits(digits: String) = ${ EvenFromDigitsImpl('digits) } diff --git a/tests/neg-macros/i4044b.scala b/tests/neg-macros/i4044b.scala index f8ebf884bbe2..a692b59b1be8 100644 --- a/tests/neg-macros/i4044b.scala +++ b/tests/neg-macros/i4044b.scala @@ -4,13 +4,13 @@ def test(using Quotes) = { '{ val qctx: Quotes = ??? - given x1 as qctx.type = qctx + given x1: qctx.type = qctx val b = '{3} '{ val qctx: Quotes = ??? - given x2 as qctx.type = qctx + given x2: qctx.type = qctx b // error ${b} diff --git a/tests/neg-macros/i7919.scala b/tests/neg-macros/i7919.scala index 3225d8dffbb8..9920eb0461dd 100644 --- a/tests/neg-macros/i7919.scala +++ b/tests/neg-macros/i7919.scala @@ -3,7 +3,7 @@ import scala.quoted._ object Test { def staged[T](using Quotes) = { import quotes.reflect._ - given typeT as Type[T] // error + given typeT as Type[T] with {} // error val tt = TypeRepr.of[T] '{ "in staged" } } diff --git a/tests/neg-with-compiler/GenericNumLits/Even_1.scala b/tests/neg-with-compiler/GenericNumLits/Even_1.scala index be618d1cd741..6dc1117f25b6 100644 --- a/tests/neg-with-compiler/GenericNumLits/Even_1.scala +++ b/tests/neg-with-compiler/GenericNumLits/Even_1.scala @@ -16,7 +16,7 @@ object Even { def fromDigits(digits: String) = evenFromDigits(digits) } - given EvenFromDigits { + given EvenFromDigits with { override inline def fromDigits(digits: String) = ${ EvenFromDigitsImpl('digits) } diff --git a/tests/neg/abstract-givens.check b/tests/neg/abstract-givens.check new file mode 100644 index 000000000000..88ed38f47ce0 --- /dev/null +++ b/tests/neg/abstract-givens.check @@ -0,0 +1,14 @@ +-- Error: tests/neg/abstract-givens.scala:11:8 ------------------------------------------------------------------------- +11 | given s[T](using T): Seq[T] with // error + | ^ + | instance cannot be created, since def iterator: => Iterator[A] is not defined +-- Error: tests/neg/abstract-givens.scala:8:8 -------------------------------------------------------------------------- +8 | given y(using Int): String = summon[Int].toString * 22 // error + | ^ + | error overriding method y in trait T of type (using x$1: Int): String; + | method y of type (using x$1: Int): String cannot override final member method y in trait T +-- Error: tests/neg/abstract-givens.scala:9:8 -------------------------------------------------------------------------- +9 | given z[T](using T): Seq[T] = List(summon[T]) // error + | ^ + | error overriding method z in trait T of type [T](using x$1: T): List[T]; + | method z of type [T](using x$1: T): Seq[T] has incompatible type diff --git a/tests/neg/abstract-givens.scala b/tests/neg/abstract-givens.scala new file mode 100644 index 000000000000..5aa5bdee88e3 --- /dev/null +++ b/tests/neg/abstract-givens.scala @@ -0,0 +1,16 @@ +trait T: + given x: Int + given y(using Int): String = summon[Int].toString + given z[T](using T): List[T] + +object Test extends T: + given x: Int = 22 + given y(using Int): String = summon[Int].toString * 22 // error + given z[T](using T): Seq[T] = List(summon[T]) // error + + given s[T](using T): Seq[T] with // error + def apply(x: Int) = ??? + override def length = ??? + +end Test + diff --git a/tests/neg/eql.scala b/tests/neg/eql.scala index 78e7434160c9..58378800bbc5 100644 --- a/tests/neg/eql.scala +++ b/tests/neg/eql.scala @@ -1,7 +1,7 @@ object lst: opaque type Lst[+T] = Any object Lst: - given lstCanEqual[T, U] as CanEqual[Lst[T], Lst[U]] = CanEqual.derived + given lstCanEqual[T, U]: CanEqual[Lst[T], Lst[U]] = CanEqual.derived val Empty: Lst[Nothing] = ??? end lst diff --git a/tests/neg/exports.scala b/tests/neg/exports.scala index 1972158bf58e..e0d834e39403 100644 --- a/tests/neg/exports.scala +++ b/tests/neg/exports.scala @@ -5,7 +5,7 @@ type PrinterType def print(bits: BitMap): Unit = ??? def status: List[String] = ??? - given bitmap as BitMap + given bitmap: BitMap with {} } class Scanner { diff --git a/tests/neg/extmethod-overload.scala b/tests/neg/extmethod-overload.scala index c680acda9144..8fa7c05222a1 100644 --- a/tests/neg/extmethod-overload.scala +++ b/tests/neg/extmethod-overload.scala @@ -1,9 +1,9 @@ object Test { - given a as AnyRef: + given a: AnyRef with extension (x: Int) { def |+| (y: Int) = x + y } - given b as AnyRef: + given b: AnyRef with extension (x: Int) { def |+| (y: String) = x + y.length } diff --git a/tests/neg/gadt-approximation-interaction.scala b/tests/neg/gadt-approximation-interaction.scala index bd8e691b6da9..832c0da354c2 100644 --- a/tests/neg/gadt-approximation-interaction.scala +++ b/tests/neg/gadt-approximation-interaction.scala @@ -28,7 +28,7 @@ object GivenLookup { class Tag[T] - given ti as Tag[Int] + given ti: Tag[Int] with {} def foo[T](t: T, ev: T SUB Int) = ev match { case SUB.Refl() => diff --git a/tests/neg/genericNumbers.scala b/tests/neg/genericNumbers.scala index 62481ddcecc1..0c5769f7ba12 100644 --- a/tests/neg/genericNumbers.scala +++ b/tests/neg/genericNumbers.scala @@ -7,7 +7,7 @@ object Test extends App { case class Even(n: Int) - given FromDigits[Even] { + given FromDigits[Even] with { def fromDigits(digits: String): Even = { val intValue = digits.toInt if (intValue % 2 == 0) Even(intValue) diff --git a/tests/neg/i10074.scala b/tests/neg/i10074.scala index 54a6701b44cb..132e09ffac1f 100644 --- a/tests/neg/i10074.scala +++ b/tests/neg/i10074.scala @@ -1,3 +1,3 @@ class Context given Context = ??? // ok -given as Context = ??? // error // error // error +given: Context = ??? // error diff --git a/tests/neg/i5978.scala b/tests/neg/i5978.scala index 47dee9c9fdd3..fddc83df44d4 100644 --- a/tests/neg/i5978.scala +++ b/tests/neg/i5978.scala @@ -5,7 +5,7 @@ opaque type Position[Buffer] = Int trait TokenParser[Token, R] object TextParser { - given TP as TokenParser[Char, Position[CharSequence]] {} + given TP: TokenParser[Char, Position[CharSequence]] with {} given FromCharToken(using T: TokenParser[Char, Position[CharSequence]]) as Conversion[Char, Position[CharSequence]] = ??? @@ -21,7 +21,7 @@ object Testcase { val co_x : Position[CharSequence] = 'x' // error { - given XXX as Conversion[Char, Position[CharSequence]] = co_i + given XXX: Conversion[Char, Position[CharSequence]] = co_i val co_y : Position[CharSequence] = 'x' } } diff --git a/tests/neg/i7078.scala b/tests/neg/i7078.scala index 387faafc745d..bf6a66f9f08c 100644 --- a/tests/neg/i7078.scala +++ b/tests/neg/i7078.scala @@ -1,7 +1,7 @@ trait A class B extends A -transparent given g1 as A = B() // error: `transparent` can only be used in conjunction with `inline` +transparent given g1: A = B() // error: `transparent` can only be used in conjunction with `inline` -inline given g2 as _ <: A: // error: `=' expected +inline given g2: _ <: A: // error: `=' expected // error def foo = 2 diff --git a/tests/neg/i7248.scala b/tests/neg/i7248.scala index e3d8f3115333..775ed32143c5 100644 --- a/tests/neg/i7248.scala +++ b/tests/neg/i7248.scala @@ -1,4 +1,4 @@ object Test extends App { - given f[H](using h: H) as H = h + given f[H](using h: H): H = h summon[Int] // error } \ No newline at end of file diff --git a/tests/neg/i7249.scala b/tests/neg/i7249.scala index 472918278354..1f1fc3c9a829 100644 --- a/tests/neg/i7249.scala +++ b/tests/neg/i7249.scala @@ -4,6 +4,6 @@ trait F[H, T] object Test extends App { - given f[H, T](using h: H, t: T) as F[H, T] = ??? + given f[H, T](using h: H, t: T): F[H, T] = ??? summon[F[Int, Unit]] // error } \ No newline at end of file diff --git a/tests/neg/i7294-a.scala b/tests/neg/i7294-a.scala index f5fc2588fb0d..13981fa4d375 100644 --- a/tests/neg/i7294-a.scala +++ b/tests/neg/i7294-a.scala @@ -2,7 +2,7 @@ package foo trait Foo { def g(x: Int): Any } -inline given f[T <: Foo] as T = ??? match { +inline given f[T <: Foo]: T = ??? match { case x: T => x.g(10) // error } diff --git a/tests/neg/i7294-b.scala b/tests/neg/i7294-b.scala index 027a3c154fbc..423d5037db96 100644 --- a/tests/neg/i7294-b.scala +++ b/tests/neg/i7294-b.scala @@ -2,7 +2,7 @@ package foo trait Foo { def g(x: Any): Any } -inline given f[T <: Foo] as T = ??? match { +inline given f[T <: Foo]: T = ??? match { case x: T => x.g(10) // error } diff --git a/tests/neg/i7459.scala b/tests/neg/i7459.scala index 09b8156ca442..0635c7b1dcc0 100644 --- a/tests/neg/i7459.scala +++ b/tests/neg/i7459.scala @@ -22,7 +22,7 @@ trait Eq[T] { } object Eq { - given Eq[Int] { + given Eq[Int] with { def eqv(x: Int, y: Int) = x == y } @@ -47,7 +47,7 @@ object Eq { } } - inline given derived[T](using m: Mirror.Of[T]) as Eq[T] = { + inline given derived[T](using m: Mirror.Of[T]): Eq[T] = { val elemInstances = summonAll[m.MirroredElemTypes] inline m match { case s: Mirror.SumOf[T] => eqSum(s, elemInstances) diff --git a/tests/neg/i7526.scala b/tests/neg/i7526.scala index e85fc552d3a4..ed37df14aa73 100644 --- a/tests/neg/i7526.scala +++ b/tests/neg/i7526.scala @@ -13,6 +13,6 @@ def compQ(name: => String) object net extends NetDB with NetHelper import net._ -given n as NetApi = net +given n: NetApi = net val q: Tr[Nothing, Comp, Comp] = compQ("???") // error Found: Tr[Nothing, ?1.Comp, ?1.Comp] Required: Tr[Nothing, net.Comp, net.Comp] \ No newline at end of file diff --git a/tests/neg/i7980.scala b/tests/neg/i7980.scala index 73c17b0fd687..b2f769056dcb 100644 --- a/tests/neg/i7980.scala +++ b/tests/neg/i7980.scala @@ -3,5 +3,5 @@ trait Evidence[X] trait Trait[X : Evidence]: def method(x : X) : X -given ev as Evidence[Int] = new Evidence[Int]{} +given ev: Evidence[Int] = new Evidence[Int]{} val crash : Trait[Int] = (x: Int) => x // error diff --git a/tests/neg/i8623.scala b/tests/neg/i8623.scala index 1cd01e598e93..f402a6ceeedd 100644 --- a/tests/neg/i8623.scala +++ b/tests/neg/i8623.scala @@ -6,7 +6,7 @@ trait QC: def pos: Tree = ??? def test = - given [T] as QC = ??? + given [T]: QC = ??? def unseal(using qctx: QC): qctx.tasty.Tree = ??? unseal.pos // error diff --git a/tests/neg/i8623a.scala b/tests/neg/i8623a.scala index 909dce706015..8dbc7a533365 100644 --- a/tests/neg/i8623a.scala +++ b/tests/neg/i8623a.scala @@ -7,7 +7,7 @@ object Test { } def foo: A & B = o - given o as (A & B) = foo + given o: (A & B) = foo def xToString(x: o.X): String = x // error diff --git a/tests/neg/i8896-a.scala b/tests/neg/i8896-a.scala index 595a46b7a0f2..ae2cd6e88f6c 100644 --- a/tests/neg/i8896-a.scala +++ b/tests/neg/i8896-a.scala @@ -4,7 +4,7 @@ trait Foo[A] object Example { - given Foo[Int] { + given Foo[Int] with { } def foo0[A: Foo]: A => A = identity diff --git a/tests/neg/i8896-b.scala b/tests/neg/i8896-b.scala index 58430fde191a..d86255e811ec 100644 --- a/tests/neg/i8896-b.scala +++ b/tests/neg/i8896-b.scala @@ -4,7 +4,7 @@ trait Foo[A] object Example { - given Foo[Int] { + given Foo[Int] with { } def foo0[A: Foo]: A => A = identity diff --git a/tests/neg/i9160.scala b/tests/neg/i9160.scala index 7a00c89a8f80..bbf6d8a368bd 100644 --- a/tests/neg/i9160.scala +++ b/tests/neg/i9160.scala @@ -28,104 +28,104 @@ trait Implicits { type F[T] type G[T] - given g1 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g2 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g3 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g4 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g5 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g6 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g7 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g8 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g9 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g10 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g11 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g12 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g13 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g14 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g15 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g16 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g17 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g18 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g19 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g20 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g21 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g22 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g23 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g24 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g25 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g26 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g27 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g28 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g29 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g30 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g31 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g32 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g33 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g34 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g35 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g36 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g37 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g38 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g39 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g40 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g41 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g42 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g43 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g44 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g45 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g46 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g47 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g48 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g49 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g50 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g51 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g52 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g53 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g54 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g55 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g56 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g57 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g58 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g59 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g60 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g61 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g62 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g63 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g64 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g65 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g66 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g67 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g68 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g69 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g70 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g71 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g72 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g73 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g74 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g75 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g76 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g77 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g78 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g79 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g80 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g81 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g82 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g83 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g84 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g85 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g86 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g87 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g88 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g89 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g90 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g91 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g92 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g93 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g94 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g95 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g96 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g97 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g98 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g99 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? - given g100 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F] as G[Int] = ??? + given g1 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g2 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g3 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g4 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g5 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g6 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g7 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g8 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g9 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g10 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g11 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g12 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g13 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g14 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g15 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g16 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g17 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g18 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g19 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g20 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g21 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g22 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g23 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g24 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g25 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g26 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g27 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g28 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g29 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g30 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g31 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g32 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g33 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g34 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g35 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g36 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g37 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g38 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g39 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g40 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g41 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g42 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g43 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g44 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g45 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g46 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g47 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g48 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g49 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g50 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g51 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g52 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g53 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g54 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g55 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g56 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g57 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g58 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g59 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g60 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g61 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g62 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g63 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g64 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g65 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g66 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g67 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g68 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g69 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g70 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g71 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g72 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g73 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g74 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g75 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g76 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g77 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g78 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g79 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g80 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g81 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g82 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g83 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g84 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g85 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g86 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g87 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g88 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g89 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g90 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g91 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g92 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g93 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g94 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g95 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g96 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g97 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g98 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g99 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? + given g100 [T1: F, T2: F, T3: F, T4: F, T5: F, T6: F, T7: F, T8: F, T9: F, T10: F, T11: F, T12: F, T13: F, T14: F, T15: F, T16: F, T17: F, T18: F, T19: F, T20: F, T21: F, T22: F]: G[Int] = ??? } \ No newline at end of file diff --git a/tests/neg/i9185.scala b/tests/neg/i9185.scala index d4558e28bbbd..34727eff1c46 100644 --- a/tests/neg/i9185.scala +++ b/tests/neg/i9185.scala @@ -1,8 +1,8 @@ trait M[F[_]] { def pure[A](x: A): F[A] } object M { extension [A, F[A]](x: A) def pure(using m: M[F]): F[A] = m.pure(x) - given listMonad as M[List] { def pure[A](x: A): List[A] = List(x) } - given optionMonad as M[Option] { def pure[A](x: A): Option[A] = Some(x) } + given listMonad: M[List] with { def pure[A](x: A): List[A] = List(x) } + given optionMonad: M[Option] with { def pure[A](x: A): Option[A] = Some(x) } val value1: List[String] = "ola".pure val value2 = "ola".pure // error val value3 = M.pure("ola") // error diff --git a/tests/neg/i9928.scala b/tests/neg/i9928.scala index cfe9cf663a85..a1034b1f20e9 100644 --- a/tests/neg/i9928.scala +++ b/tests/neg/i9928.scala @@ -2,7 +2,7 @@ trait Magic[F]: extension (x: Int) def read: F object Magic: - given Magic[String]: + given Magic[String] with extension(x: Int) def read: String = println("In string") s"$x" @@ -12,7 +12,7 @@ object Foo: import Magic.given def apply(s: String): Foo = s - given Magic[Foo]: + given Magic[Foo] with extension (x: Int) def read: Foo = println("In foo") Foo(s"$x") diff --git a/tests/neg/implicit-package-object.scala b/tests/neg/implicit-package-object.scala index deb276c94c05..1af3b413e04a 100644 --- a/tests/neg/implicit-package-object.scala +++ b/tests/neg/implicit-package-object.scala @@ -10,7 +10,7 @@ package A { given ToString[AB] = ab => println(ab) opaque type AC = String - given ToString[AC] { + given ToString[AC] with { def print(ac: AC): Unit = println(ac) } } @@ -28,7 +28,7 @@ package B { opaque type BC = String object BC { - given ToString[BC] { + given ToString[BC] with { def print(bc: BC): Unit = println(bc) } } diff --git a/tests/neg/implicit-params.scala b/tests/neg/implicit-params.scala index 1d41ef966ce9..0282f34e098f 100644 --- a/tests/neg/implicit-params.scala +++ b/tests/neg/implicit-params.scala @@ -11,8 +11,8 @@ object Test { def h(x: Int) given () = x // error: missing return type - given C as C(11) - given D as D(11) + given C: C(11) with {} + given D: D(11) with {} f(1) f(1)(using C) diff --git a/tests/neg/implied-for.scala b/tests/neg/implied-for.scala index b06b248e90be..8e9e44b2e413 100644 --- a/tests/neg/implied-for.scala +++ b/tests/neg/implied-for.scala @@ -3,8 +3,8 @@ class B extends T class C extends T object A { - given b as B - given c as C + given b: B with {} + given c: C with {} } object Test extends App { diff --git a/tests/neg/import-given.scala b/tests/neg/import-given.scala index 9aebd770ea31..ddc3da2fa5cb 100644 --- a/tests/neg/import-given.scala +++ b/tests/neg/import-given.scala @@ -1,6 +1,6 @@ class TC object A { - given tc as TC + given tc: TC with {} def foo(using TC) = () } object B { diff --git a/tests/neg/machine-state-encoding-with-implicit-match.scala b/tests/neg/machine-state-encoding-with-implicit-match.scala index f7e0a6ff536b..f46d7592508a 100644 --- a/tests/neg/machine-state-encoding-with-implicit-match.scala +++ b/tests/neg/machine-state-encoding-with-implicit-match.scala @@ -8,13 +8,13 @@ final class Off extends State @implicitNotFound("State must be Off") class IsOff[S <: State] object IsOff { - given isOff as IsOff[Off] = new IsOff[Off] + given isOff: IsOff[Off] = new IsOff[Off] } @implicitNotFound("State must be On") class IsOn[S <: State] object IsOn { - given isOn as IsOn[On] = new IsOn[On] + given isOn: IsOn[On] = new IsOn[On] } class Machine[S <: State] { diff --git a/tests/neg/missing-implicit1.scala b/tests/neg/missing-implicit1.scala index c94d78099068..66c70f446d37 100644 --- a/tests/neg/missing-implicit1.scala +++ b/tests/neg/missing-implicit1.scala @@ -5,8 +5,8 @@ object testObjectInstance: } object instances { - given zipOption as Zip[Option] = ??? - given traverseList as Traverse[List] = ??? + given zipOption: Zip[Option] = ??? + given traverseList: Traverse[List] = ??? extension [T](xs: List[T]) def second: T = xs.tail.head extension [T](xs: List[T]) def first: T = xs.head diff --git a/tests/neg/missing-implicit2.scala b/tests/neg/missing-implicit2.scala index 7edcd1d37b0e..53e30eeb9ee1 100644 --- a/tests/neg/missing-implicit2.scala +++ b/tests/neg/missing-implicit2.scala @@ -3,15 +3,15 @@ trait Y object test: def f(using x: X) = ??? object instances { - given y as Y = ??? + given y: Y = ??? } locally { - given xFromY(using y: Y) as X = ??? + given xFromY(using y: Y): X = ??? f(using xFromY) // error } locally { object instances2 { - given xFromY(using Y) as X = ??? + given xFromY(using Y): X = ??? } f // error } diff --git a/tests/neg/missing-implicit3.scala b/tests/neg/missing-implicit3.scala index 7affe234bbab..3bbbf8548ff3 100644 --- a/tests/neg/missing-implicit3.scala +++ b/tests/neg/missing-implicit3.scala @@ -3,7 +3,7 @@ package ord trait Ord[A] object Ord { - given ordered[A](using A => java.lang.Comparable[? >: A]) as Ord[A] = ??? + given ordered[A](using A => java.lang.Comparable[? >: A]): Ord[A] = ??? } def sort[A: Ord](as: List[A]): List[A] = ??? diff --git a/tests/neg/missing-implicit4.scala b/tests/neg/missing-implicit4.scala index a02d543c12f8..317dc516c7c3 100644 --- a/tests/neg/missing-implicit4.scala +++ b/tests/neg/missing-implicit4.scala @@ -5,8 +5,8 @@ def testLocalInstance = } object instances { - given zipOption as Zip[Option] = ??? - given traverseList as Traverse[List] = ??? + given zipOption: Zip[Option] = ??? + given traverseList: Traverse[List] = ??? } def ff(using xs: Zip[Option]) = ??? diff --git a/tests/neg/missing-implicit5.scala b/tests/neg/missing-implicit5.scala index a2a0fd55315c..c294412da53b 100644 --- a/tests/neg/missing-implicit5.scala +++ b/tests/neg/missing-implicit5.scala @@ -5,8 +5,8 @@ object testObjectInstance: } object instances { - given zipOption as Zip[Option] = ??? - given traverseList as Traverse[List] = ??? + given zipOption: Zip[Option] = ??? + given traverseList: Traverse[List] = ??? extension [T](xs: List[T]) def second: T = xs.tail.head extension [T](xs: List[T]) def first: T = xs.head diff --git a/tests/neg/multi-param-derives.scala b/tests/neg/multi-param-derives.scala index 98b7a3272f1e..d428df806a9c 100644 --- a/tests/neg/multi-param-derives.scala +++ b/tests/neg/multi-param-derives.scala @@ -4,10 +4,10 @@ object Test extends App { { trait Show[T] object Show { - given Show[Int] {} - given [T](using st: Show[T]) as Show[Tuple1[T]] {} - given t2[T, U](using st: Show[T], su: Show[U]) as Show[(T, U)] {} - given t3[T, U, V](using st: Show[T], su: Show[U], sv: Show[V]) as Show[(T, U, V)] {} + given Show[Int] with {} + given [T](using st: Show[T]): Show[Tuple1[T]] with {} + given t2[T, U](using st: Show[T], su: Show[U]): Show[(T, U)] with {} + given t3[T, U, V](using st: Show[T], su: Show[U], sv: Show[V]): Show[(T, U, V)] with {} def derived[T](using m: Mirror.Of[T], r: Show[m.MirroredElemTypes]): Show[T] = new Show[T] {} } @@ -22,10 +22,10 @@ object Test extends App { { trait Functor[F[_]] object Functor { - given [C] as Functor[[T] =>> C] {} - given Functor[[T] =>> Tuple1[T]] {} - given t2 [T] as Functor[[U] =>> (T, U)] {} - given t3 [T, U] as Functor[[V] =>> (T, U, V)] {} + given [C]: Functor[[T] =>> C] with {} + given Functor[[T] =>> Tuple1[T]] with {} + given t2 [T]: Functor[[U] =>> (T, U)] with {} + given t3 [T, U]: Functor[[V] =>> (T, U, V)] with {} def derived[F[_]](using m: Mirror { type MirroredType[X] = F[X] ; type MirroredElemTypes[_] }, r: Functor[m.MirroredElemTypes]): Functor[F] = new Functor[F] {} } @@ -40,8 +40,8 @@ object Test extends App { { trait FunctorK[F[_[_]]] object FunctorK { - given [C] as FunctorK[[F[_]] =>> C] {} - given [T] as FunctorK[[F[_]] =>> Tuple1[F[T]]] + given [C]: FunctorK[[F[_]] =>> C] with {} + given [T]: FunctorK[[F[_]] =>> Tuple1[F[T]]] with {} def derived[F[_[_]]](using m: Mirror { type MirroredType[X[_]] = F[X] ; type MirroredElemTypes[_[_]] }, r: FunctorK[m.MirroredElemTypes]): FunctorK[F] = new FunctorK[F] {} } @@ -56,10 +56,10 @@ object Test extends App { { trait Bifunctor[F[_, _]] object Bifunctor { - given [C] as Bifunctor[[T, U] =>> C] {} - given Bifunctor[[T, U] =>> Tuple1[U]] {} - given t2 as Bifunctor[[T, U] =>> (T, U)] {} - given t3 [T] as Bifunctor[[U, V] =>> (T, U, V)] {} + given [C]: Bifunctor[[T, U] =>> C] with {} + given Bifunctor[[T, U] =>> Tuple1[U]] with {} + given t2: Bifunctor[[T, U] =>> (T, U)] with {} + given t3 [T]: Bifunctor[[U, V] =>> (T, U, V)] with {} def derived[F[_, _]](using m: Mirror { type MirroredType[X, Y] = F[X, Y] ; type MirroredElemTypes[_, _] }, r: Bifunctor[m.MirroredElemTypes]): Bifunctor[F] = ??? } diff --git a/tests/neg/overloading-specifity.scala b/tests/neg/overloading-specifity.scala index 89ed440bdaba..b6c10ef1e9bc 100644 --- a/tests/neg/overloading-specifity.scala +++ b/tests/neg/overloading-specifity.scala @@ -12,7 +12,7 @@ object Generic { object Test extends App { trait Context - //given ctx as Context + //given ctx: Context with {} object a { def foo[T](implicit gen: Generic): Show[T] = new Show[T](1) diff --git a/tests/neg/struct-given.scala b/tests/neg/struct-given.scala new file mode 100644 index 000000000000..9bcd1630d448 --- /dev/null +++ b/tests/neg/struct-given.scala @@ -0,0 +1,10 @@ +class C +given c[T]: C with + def foo = 1 + +given d[T]: C = new C { def foo = 1 } + +def test = + c.foo // OK + d.foo // error + diff --git a/tests/neg/type-qmark.check b/tests/neg/type-qmark.check index c85a114afc1b..ec3e8306af11 100644 --- a/tests/neg/type-qmark.check +++ b/tests/neg/type-qmark.check @@ -27,7 +27,7 @@ | ^ | `?` is not a valid type name -- Error: tests/neg/type-qmark.scala:31:8 ------------------------------------------------------------------------------ -31 | given ?[T] as Foo[T] {} // error +31 | given ?[T]: Foo[T] with {} // error | ^ | `?` is not a valid type name -- Error: tests/neg/type-qmark.scala:3:8 ------------------------------------------------------------------------------- diff --git a/tests/neg/type-qmark.scala b/tests/neg/type-qmark.scala index 03eebd69d60a..bb89f72d6b3d 100644 --- a/tests/neg/type-qmark.scala +++ b/tests/neg/type-qmark.scala @@ -28,5 +28,5 @@ object J { } object K { class Foo[T] - given ?[T] as Foo[T] {} // error + given ?[T]: Foo[T] with {} // error } diff --git a/tests/patmat/i6088.scala b/tests/patmat/i6088.scala index 9c532a608bb4..8d8f676c0101 100644 --- a/tests/patmat/i6088.scala +++ b/tests/patmat/i6088.scala @@ -17,7 +17,7 @@ enum ExprF[R[_],I] { /** Companion. */ object ExprF { - given hfunctor as HFunctor[ExprF] { + given hfunctor: HFunctor[ExprF] with { def hmap[A[_], B[_]](nt: A ~> B): ([x] =>> ExprF[A,x]) ~> ([x] =>> ExprF[B,x]) = { new ~>[[x] =>> ExprF[A,x], [x] =>> ExprF[B,x]] { def apply[I](fa: ExprF[A,I]): ExprF[B,I] = fa match { diff --git a/tests/pending/pos/i10161.scala b/tests/pending/pos/i10161.scala index 0bbc78b1b354..71aa9a7a1311 100644 --- a/tests/pending/pos/i10161.scala +++ b/tests/pending/pos/i10161.scala @@ -11,8 +11,8 @@ object Incompat3 { trait Context { type Out } object Context { - given foo(using ctx: Context) as Option[ctx.Out] = ??? + given foo(using ctx: Context): Option[ctx.Out] = ??? - given bar(using ctx: Context) as (Option[ctx.Out], String) = (foo, "foo") + given bar(using ctx: Context): (Option[ctx.Out], String) = (foo, "foo") } } \ No newline at end of file diff --git a/tests/pos-custom-args/erased/i7868.scala b/tests/pos-custom-args/erased/i7868.scala index 21d5f79ad93b..710598718acd 100644 --- a/tests/pos-custom-args/erased/i7868.scala +++ b/tests/pos-custom-args/erased/i7868.scala @@ -12,7 +12,7 @@ object Coproduct { object At { - given atHead[Head, Tail] as At[Head +: Tail, Head, 0] { + given atHead[Head, Tail]: At[Head +: Tail, Head, 0] with { def cast: Head <:< Head +: Tail = summon[Head <:< Head +: Tail] } @@ -21,7 +21,7 @@ object Coproduct { as At[Head +: Tail, Value, S[NextIndex]]: val cast: Value <:< Head +: Tail = atNext.cast - given [A](using A) as (() => A)= { () => summon[A]} + given [A](using A): (() => A) = { () => summon[A]} } def upCast[A, B](a: A)(using erased evidence: (A <:< B) ): B = a.asInstanceOf[B] diff --git a/tests/pos-custom-args/erased/i7878.scala b/tests/pos-custom-args/erased/i7878.scala index 4fea0c095561..d47bb32f1a65 100644 --- a/tests/pos-custom-args/erased/i7878.scala +++ b/tests/pos-custom-args/erased/i7878.scala @@ -2,14 +2,14 @@ object Boom { import scala.compiletime._ trait Fail[A <: Int, B <: Int] - erased inline given fail[X <: Int, Y <: Int] as Fail[X, Y] = { + erased inline given fail[X <: Int, Y <: Int]: Fail[X, Y] = { scala.compiletime.summonFrom { case t: Fail[X, y] if constValue[y] < constValue[Y] => ??? } } val a: Int = 1 - given ev1 as Fail[a.type, 2] = null + given ev1: Fail[a.type, 2] = null summon[Fail[a.type, 3]] } \ No newline at end of file diff --git a/tests/pos-macros/i6803b/Macro_1.scala b/tests/pos-macros/i6803b/Macro_1.scala index 17e0fede7597..f533e360b248 100644 --- a/tests/pos-macros/i6803b/Macro_1.scala +++ b/tests/pos-macros/i6803b/Macro_1.scala @@ -7,7 +7,7 @@ object AsObject { final class LineNo(val lineNo: Int) object LineNo { def unsafe(i: Int): LineNo = new LineNo(i) - inline given x as LineNo = ${impl} + inline given x: LineNo = ${impl} private def impl(using Quotes) : Expr[LineNo] = { import quotes.reflect._ '{unsafe(${Expr(Position.ofMacroExpansion.startLine)})} diff --git a/tests/pos-macros/macro-docs.scala b/tests/pos-macros/macro-docs.scala index b1f7d4933934..d31138f38b73 100644 --- a/tests/pos-macros/macro-docs.scala +++ b/tests/pos-macros/macro-docs.scala @@ -2,12 +2,12 @@ import scala.quoted._ object MacrosMD_Liftable { - given Liftable[Boolean] { + given Liftable[Boolean] with { def toExpr(b: Boolean) = if (b) '{ true } else '{ false } } - given Liftable[Int] { + given Liftable[Int] with { def toExpr(n: Int) = n match { case Int.MinValue => '{ Int.MinValue } case _ if n < 0 => '{ - ${ toExpr(-n) } } @@ -17,7 +17,7 @@ object MacrosMD_Liftable { } } - given [T: Liftable : Type] as Liftable[List[T]] { + given [T: Liftable : Type]: Liftable[List[T]] with { def toExpr(xs: List[T]) = xs match { case head :: tail => '{ ${ Expr(head) } :: ${ toExpr(tail) } } case Nil => '{ Nil: List[T] } diff --git a/tests/pos-macros/nil-liftable.scala b/tests/pos-macros/nil-liftable.scala index a8ac5bbd6240..40746dcf1e17 100644 --- a/tests/pos-macros/nil-liftable.scala +++ b/tests/pos-macros/nil-liftable.scala @@ -1,7 +1,7 @@ import scala.quoted._ class Test: - given NilIsLiftable as Liftable[Nil.type] = new Liftable[Nil.type] { + given NilIsLiftable: Liftable[Nil.type] = new Liftable[Nil.type] { def toExpr(xs: Nil.type): Quotes ?=> Expr[Nil.type] = '{ Nil } } diff --git a/tests/pos/X.scala b/tests/pos/X.scala index 119aef885cac..da85d901ec59 100644 --- a/tests/pos/X.scala +++ b/tests/pos/X.scala @@ -2,8 +2,8 @@ import scala.deriving._ trait FunctorK[F[_[_]]] object FunctorK { - given [C] as FunctorK[[F[_]] =>> C] {} - given [T] as FunctorK[[F[_]] =>> Tuple1[F[T]]] + given [C]: FunctorK[[F[_]] =>> C] with {} + given [T]: FunctorK[[F[_]] =>> Tuple1[F[T]]] with {} def derived[F[_[_]]](using m: Mirror { type MirroredType[X[_]] = F[X] ; type MirroredElemTypes[_[_]] }, r: FunctorK[m.MirroredElemTypes]): FunctorK[F] = new FunctorK[F] {} } diff --git a/tests/pos/combine.scala b/tests/pos/combine.scala index fd7715b2ac19..930e5237e249 100644 --- a/tests/pos/combine.scala +++ b/tests/pos/combine.scala @@ -2,7 +2,7 @@ trait Semigroup[A] { extension (x: A) def combine(y: A): A } given Semigroup[Int] = ??? -given [A, B](using Semigroup[A], Semigroup[B]) as Semigroup[(A, B)] = ??? +given [A, B](using Semigroup[A], Semigroup[B]): Semigroup[(A, B)] = ??? object Test extends App { ((1, 1)) combine ((2, 2)) // doesn't compile ((1, 1): (Int, Int)) combine (2, 2) // compiles diff --git a/tests/pos/end-given.scala b/tests/pos/end-given.scala index 0aacfb379c3c..359d7d1b6a6b 100644 --- a/tests/pos/end-given.scala +++ b/tests/pos/end-given.scala @@ -1,3 +1,3 @@ -given Conversion[Int, String]: +given Conversion[Int, String] with def apply(x: Int) = "" end given diff --git a/tests/pos/givenFallback.scala b/tests/pos/givenFallback.scala index 8581194291b5..760eb2b5aed2 100644 --- a/tests/pos/givenFallback.scala +++ b/tests/pos/givenFallback.scala @@ -1,10 +1,10 @@ trait TC[T] { def x: Int; def y: Int = 0 } -given [T] as TC[T] { +given [T]: TC[T] with { inline val x = 1 } -given TC[Int] { +given TC[Int] with { inline val x = 2 inline override val y = 3 } diff --git a/tests/pos/i5915.scala b/tests/pos/i5915.scala index 9822f4b93d76..acccbf64a684 100644 --- a/tests/pos/i5915.scala +++ b/tests/pos/i5915.scala @@ -2,8 +2,8 @@ trait RunDSL val rdsl = new RunDSL {} -given RunNNFExpr[B] as RunDSL = rdsl +given RunNNFExpr[B]: RunDSL = rdsl -given RunNNFImpl[B] as RunDSL { +given RunNNFImpl[B]: RunDSL with { //override def runDSL(b: NNF[B]): B = b.terminal } \ No newline at end of file diff --git a/tests/pos/i5966.scala b/tests/pos/i5966.scala index 88a0c9a9beb5..6ef3bda9c9c8 100644 --- a/tests/pos/i5966.scala +++ b/tests/pos/i5966.scala @@ -1,6 +1,6 @@ object Test { def foo = (v: Int) ?=> (x: Int) => v + x - given myInt as Int = 4 + given myInt: Int = 4 foo.apply(1) foo(using 2) diff --git a/tests/pos/i5978.scala b/tests/pos/i5978.scala index 75573f775312..74e5b5f632b4 100644 --- a/tests/pos/i5978.scala +++ b/tests/pos/i5978.scala @@ -7,7 +7,7 @@ trait TokenParser[Token, R] package p1 { object TextParser { - given TP as TokenParser[Char, Position[CharSequence]] {} + given TP: TokenParser[Char, Position[CharSequence]] with {} def f (using TokenParser[Char, Position[CharSequence]]) = ??? @@ -29,7 +29,7 @@ package p1 { val co_x : Position[CharSequence] = 'x' { - given XXX as Conversion[Char, Position[CharSequence]] = co_i + given XXX: Conversion[Char, Position[CharSequence]] = co_i val co_y : Position[CharSequence] = 'x' } } @@ -74,7 +74,7 @@ package p3 { val co_x : Position[CharSequence] = 'x' { - given XXX as Conversion[Char, Position[CharSequence]] = co_i + given XXX: Conversion[Char, Position[CharSequence]] = co_i val co_y : Position[CharSequence] = 'x' } } @@ -84,9 +84,9 @@ package p3 { package p4 { class TC - given A as TC + given A: TC with {} - given B[X[_], Y] as TC + given B[X[_], Y]: TC with {} - given C(using TC) as TC + given C(using TC): TC with {} } \ No newline at end of file diff --git a/tests/pos/i6373.scala b/tests/pos/i6373.scala index 3b30388798bf..356813e06916 100644 --- a/tests/pos/i6373.scala +++ b/tests/pos/i6373.scala @@ -6,7 +6,7 @@ object Test { inline def f(): Contextual[Boolean] = summon[Context].t - given ctx as Context = new Context(true) + given ctx: Context = new Context(true) f() } diff --git a/tests/pos/i6864.scala b/tests/pos/i6864.scala index 60ce1238f164..9d5f6b1c1c42 100644 --- a/tests/pos/i6864.scala +++ b/tests/pos/i6864.scala @@ -14,4 +14,4 @@ trait C trait Baz[A] given C -given [A] as Baz[A] \ No newline at end of file +given [A]: Baz[A] with {} \ No newline at end of file diff --git a/tests/pos/i6900.scala b/tests/pos/i6900.scala index 45313c21921e..55a55aa72a01 100644 --- a/tests/pos/i6900.scala +++ b/tests/pos/i6900.scala @@ -8,7 +8,7 @@ object Test1 { // But not with newstyle /* - given [A] as Conversion[A, Foo[A]]: + given [A]: Conversion[A, Foo[A]] with def apply(a: A) = new Foo[A]: def foo[C]: C => A = _ => a */ diff --git a/tests/pos/i6914.scala b/tests/pos/i6914.scala index 14ee61dc5c4a..2d8cf164f422 100644 --- a/tests/pos/i6914.scala +++ b/tests/pos/i6914.scala @@ -5,7 +5,7 @@ object test1 { class ToExpr[T](using Liftable[T]) extends Conversion[T, Expr[T]] { def apply(x: T): Expr[T] = ??? } - given toExpr[T](using Liftable[T]) as ToExpr[T] + given toExpr[T](using Liftable[T]): ToExpr[T] with {} given Liftable[Int] = ??? given Liftable[String] = ??? @@ -18,7 +18,7 @@ object test1 { object test2 { - given autoToExpr[T](using Liftable[T]) as Conversion[T, Expr[T]] { + given autoToExpr[T](using Liftable[T]): Conversion[T, Expr[T]] with { def apply(x: T): Expr[T] = ??? } diff --git a/tests/pos/i6938.scala b/tests/pos/i6938.scala index f4955e115ba3..e58ab2829cf9 100644 --- a/tests/pos/i6938.scala +++ b/tests/pos/i6938.scala @@ -1,5 +1,5 @@ trait Foo[T] object Foo: - given [T] as Foo[Tuple1[T]] - given [T, U] as Foo[(T, U)] - given [T, U, V] as Foo[(T, U, V)] \ No newline at end of file + given [T]: Foo[Tuple1[T]] with {} + given [T, U]: Foo[(T, U)] with {} + given [T, U, V]: Foo[(T, U, V)] with {} \ No newline at end of file diff --git a/tests/pos/i7078.scala b/tests/pos/i7078.scala index ab49673b3ca6..6fde7a4b0584 100644 --- a/tests/pos/i7078.scala +++ b/tests/pos/i7078.scala @@ -1,7 +1,7 @@ trait A class B extends A -transparent inline given tc as A = B() +transparent inline given tc: A = B() val x: B = summon[A] diff --git a/tests/pos/i7103.scala b/tests/pos/i7103.scala index edc0f5220ead..e791cc9eb7af 100644 --- a/tests/pos/i7103.scala +++ b/tests/pos/i7103.scala @@ -1,3 +1,3 @@ class X object X extends X -given `as` as X = X \ No newline at end of file +given `as`: X = X \ No newline at end of file diff --git a/tests/pos/i7413.scala b/tests/pos/i7413.scala index 1e90ca7e8d74..ebc0c5b2777a 100644 --- a/tests/pos/i7413.scala +++ b/tests/pos/i7413.scala @@ -11,7 +11,7 @@ trait Greeter: case class MyFixture(name: String, greeter: Greeter) object Test1: - given conv as Conversion[0, Greeter]: + given conv: Conversion[0, Greeter] with def apply(x: 0): Greeter = ??? val g: Greeter = 0 diff --git a/tests/pos/i8198.scala b/tests/pos/i8198.scala index 3946624acd83..5e4efa82924a 100644 --- a/tests/pos/i8198.scala +++ b/tests/pos/i8198.scala @@ -6,6 +6,6 @@ trait Eq[A] { case class Id[T](id: T) -given idEq[A](using eqA: Eq[A]) as Eq[Id[A]] = new { +given idEq[A](using eqA: Eq[A]): Eq[Id[A]] = new { extension (i1: Id[A]) def === (i2: Id[A]) = !(i1.id /== i2.id) } diff --git a/tests/pos/i8284.scala b/tests/pos/i8284.scala index 148ef81c67b6..a05b3af29241 100644 --- a/tests/pos/i8284.scala +++ b/tests/pos/i8284.scala @@ -1,5 +1,5 @@ type Foo -given myFoo1 as (Foo { type X = Int }) = ??? +given myFoo1: (Foo { type X = Int }) = ??? type Bar = Foo { type X = Int } -given myFoo2 as Bar = ??? \ No newline at end of file +given myFoo2: Bar = ??? \ No newline at end of file diff --git a/tests/pos/i8344-1.scala b/tests/pos/i8344-1.scala index 48aae05e38b2..deb546dfa663 100644 --- a/tests/pos/i8344-1.scala +++ b/tests/pos/i8344-1.scala @@ -5,7 +5,7 @@ enum Datatype[T] { } object Datatype { - given [H, T <: STuple](using ht: Datatype[H], tt: Datatype[T]) as Datatype[H *: T] = tt match { + given [H, T <: STuple](using ht: Datatype[H], tt: Datatype[T]): Datatype[H *: T] = tt match { case Datatype.Tuple(elems) => Datatype.Tuple(ht *: elems) } } diff --git a/tests/pos/i8397.scala b/tests/pos/i8397.scala index dd1a00c27fa1..b04c70153b40 100644 --- a/tests/pos/i8397.scala +++ b/tests/pos/i8397.scala @@ -1,4 +1,4 @@ -given foo(using x: Int) as AnyRef: +given foo(using x: Int): AnyRef with type T = x.type // #7859 @@ -6,13 +6,13 @@ given foo(using x: Int) as AnyRef: trait Lub2[A, B]: type Output -given [A <: C, B <: C, C] as Lub2[A, B]: +given [A <: C, B <: C, C]: Lub2[A, B] with type Output = C trait Lub[Union]: type Output -given [A] as Lub[A]: +given [A]: Lub[A] with type Output = A given [Left, Right]( diff --git a/tests/pos/i8825.scala b/tests/pos/i8825.scala index 49c85434ce98..d7115babfdc4 100644 --- a/tests/pos/i8825.scala +++ b/tests/pos/i8825.scala @@ -16,9 +16,9 @@ object Length { type Aux[L <: HList, Out0 <: Nat] = Length[L] { type Out = Out0 } def instance[L <: HList, Out0 <: Nat]: Aux[L, Out0] = new Length[L] { type Out = Out0 } - given hnilLength as Aux[HNil, Zero] = instance - given hconsLength[H, T <: HList] (using length: Length[T]) as Aux[HCons[H, T], Succ[length.Out]] = instance // (*) - //given hconsLength[H, T <: HList, N <: Nat] (using length: Aux[T, N]) as Aux[HCons[H, T], Succ[N]] = instance // (**) + given hnilLength: Aux[HNil, Zero] = instance + given hconsLength[H, T <: HList] (using length: Length[T]): Aux[HCons[H, T], Succ[length.Out]] = instance // (*) + //given hconsLength[H, T <: HList, N <: Nat] (using length: Aux[T, N]): Aux[HCons[H, T], Succ[N]] = instance // (**) } val test = summon[Length.Aux[HCons[Int, HNil], One]] \ No newline at end of file diff --git a/tests/pos/i8927.scala b/tests/pos/i8927.scala index 9734fe577c53..2dfb419abab3 100644 --- a/tests/pos/i8927.scala +++ b/tests/pos/i8927.scala @@ -17,7 +17,7 @@ sealed trait DPair[k <: AnyKind, K[_ <: k], +V[_ <: k]]: case _ => None object DPair: - given pair [k, K[_ <: k], V[_ <: k], C <: k] as Conversion[(K[C], V[C]), DPair[k, K, V]] = tup => + given pair [k, K[_ <: k], V[_ <: k], C <: k]: Conversion[(K[C], V[C]), DPair[k, K, V]] = tup => case class dpair(key: K[C], value: V[C]) extends DPair[k, K, V]: type A = C dpair(tup._1, tup._2) diff --git a/tests/pos/i9342b.scala b/tests/pos/i9342b.scala index c6712c00236f..e317391f9bb8 100644 --- a/tests/pos/i9342b.scala +++ b/tests/pos/i9342b.scala @@ -1,7 +1,7 @@ trait Label[A]: def apply(v: A): String -given [A] as Label[A] = _.toString +given [A]: Label[A] = _.toString extension [A](x: A) inline def label(using inline l: Label[A]): String = l(x) diff --git a/tests/pos/implicit-conversion.scala b/tests/pos/implicit-conversion.scala index 9154b24681c9..a2d12b8ab709 100644 --- a/tests/pos/implicit-conversion.scala +++ b/tests/pos/implicit-conversion.scala @@ -1,6 +1,6 @@ object Test { // a problematic implicit conversion, should we flag it? - given Conversion[String, Int] { + given Conversion[String, Int] with { def apply(x: String): Int = Integer.parseInt(toString) } } \ No newline at end of file diff --git a/tests/pos/inlined-the.scala b/tests/pos/inlined-the.scala index 290c39670355..5a3c43287724 100644 --- a/tests/pos/inlined-the.scala +++ b/tests/pos/inlined-the.scala @@ -5,7 +5,7 @@ object Instances { class C { def f() = { locally { - given d[T] as D[T] + given d[T]: D[T] with {} summon[D[Int]] implicit val s: 3 = ??? val a: 3 = summon[3] @@ -14,7 +14,7 @@ object Instances { } locally { - given d[T] as D[T] + given d[T]: D[T] with {} the2[D[Int]] implicit val s: 3 = ??? val a: 3 = the2[3] diff --git a/tests/pos/multi-given.scala b/tests/pos/multi-given.scala index eb1c40718b01..3be8bece1311 100644 --- a/tests/pos/multi-given.scala +++ b/tests/pos/multi-given.scala @@ -5,6 +5,6 @@ trait C def fancy(using a: A, b: B, c: C) = "Fancy!" def foo(implicit a: A, b: B, c: C) = "foo" -given A, B {} +given A with B with {} -given ops as A with B {} \ No newline at end of file +given ops: A with B with {} \ No newline at end of file diff --git a/tests/pos/multiversal.scala b/tests/pos/multiversal.scala index 89364910281b..f7fa14264a3c 100644 --- a/tests/pos/multiversal.scala +++ b/tests/pos/multiversal.scala @@ -1,7 +1,7 @@ object Test { import scala.CanEqual - given [X, Y](using CanEqual[X, Y]) as CanEqual[List[X], List[Y]] = CanEqual.derived + given [X, Y](using CanEqual[X, Y]): CanEqual[List[X], List[Y]] = CanEqual.derived val b: Byte = 1 val c: Char = 2 diff --git a/tests/pos/reference/delegates.scala b/tests/pos/reference/delegates.scala index 56b29c008924..9a05d0717788 100644 --- a/tests/pos/reference/delegates.scala +++ b/tests/pos/reference/delegates.scala @@ -26,11 +26,11 @@ end Common object Instances extends Common: - given intOrd as Ord[Int]: + given intOrd: Ord[Int] with extension (x: Int) def compareTo(y: Int) = if (x < y) -1 else if (x > y) +1 else 0 - given listOrd[T](using Ord[T]) as Ord[List[T]]: + given listOrd[T](using Ord[T]): Ord[List[T]] with extension (xs: List[T]) def compareTo(ys: List[T]): Int = (xs, ys) match case (Nil, Nil) => 0 case (Nil, _) => -1 @@ -49,13 +49,13 @@ object Instances extends Common: def second = xs.tail.head def third = xs.tail.tail.head - given listMonad as Monad[List]: + given listMonad: Monad[List] with extension [A, B](xs: List[A]) def flatMap (f: A => List[B]): List[B] = xs.flatMap(f) def pure[A](x: A): List[A] = List(x) - given readerMonad[Ctx] as Monad[[X] =>> Ctx => X]: + given readerMonad[Ctx]: Monad[[X] =>> Ctx => X] with extension [A, B](r: Ctx => A) def flatMap (f: A => Ctx => B): Ctx => B = ctx => f(r(ctx))(ctx) def pure[A](x: A): Ctx => A = @@ -89,12 +89,11 @@ object Instances extends Common: type Symbol trait SymDeco: extension (sym: Symbol) def name: String - def symDeco: SymDeco - given SymDeco = symDeco + given symDeco: SymDeco object TastyImpl extends TastyAPI: type Symbol = String - val symDeco = new SymDeco: + given symDeco: SymDeco with extension (sym: Symbol) def name = sym class D[T] @@ -111,11 +110,11 @@ object Instances extends Common: println(summon[Context].value) } locally { - given d[T] as D[T] + given d[T]: D[T] with {} println(summon[D[Int]]) } locally { - given (using Context) as D[Int] + given (using Context): D[Int] with {} println(summon[D[Int]]) } end C @@ -123,7 +122,7 @@ object Instances extends Common: class Token(str: String) object Token: - given StringToToken as Conversion[String, Token]: + given StringToToken: Conversion[String, Token] with def apply(str: String): Token = new Token(str) val x: Token = "if" @@ -141,11 +140,11 @@ object PostConditions: end PostConditions object AnonymousInstances extends Common: - given Ord[Int]: + given Ord[Int] with extension (x: Int) def compareTo(y: Int) = if (x < y) -1 else if (x > y) +1 else 0 - given [T: Ord] as Ord[List[T]]: + given [T: Ord]: Ord[List[T]] with extension (xs: List[T]) def compareTo(ys: List[T]): Int = (xs, ys).match case (Nil, Nil) => 0 case (Nil, _) => -1 @@ -162,10 +161,11 @@ object AnonymousInstances extends Common: extension [T](xs: List[T]) def second = xs.tail.head - given [From, To](using c: Convertible[From, To]) as Convertible[List[From], List[To]]: + given [From, To](using c: Convertible[From, To]) + : Convertible[List[From], List[To]] with extension (x: List[From]) def convert: List[To] = x.map(c.convert) - given Monoid[String]: + given Monoid[String] with extension (x: String) def combine(y: String): String = x.concat(y) def unit: String = "" @@ -231,9 +231,9 @@ object Completions: // // CompletionArg.from(statusCode) - given fromString as Conversion[String, CompletionArg] = Error(_) - given fromFuture as Conversion[Future[HttpResponse], CompletionArg] = Response(_) - given fromStatusCode as Conversion[Future[StatusCode], CompletionArg] = Status(_) + given fromString : Conversion[String, CompletionArg] = Error(_) + given fromFuture : Conversion[Future[HttpResponse], CompletionArg] = Response(_) + given fromStatusCode: Conversion[Future[StatusCode], CompletionArg] = Status(_) import CompletionArg._ def complete[T](arg: CompletionArg) = arg match diff --git a/tests/pos/reference/extension-methods.scala b/tests/pos/reference/extension-methods.scala index 5d063997f210..560255a1f8d6 100644 --- a/tests/pos/reference/extension-methods.scala +++ b/tests/pos/reference/extension-methods.scala @@ -70,7 +70,7 @@ object ExtMethods: end SafeDiv def test1 = - given ops1 as IntOps // brings safeMod into scope + given ops1: IntOps with {} // brings safeMod into scope 1.safeMod(2) class Lst[T](xs: T*): @@ -81,7 +81,7 @@ object ExtMethods: trait Ord[T]: extension (x: T) def less (y: T): Boolean object Ord: - given Ord[Int]: + given Ord[Int] with extension (x: Int) def less (y: Int): Boolean = x < y end Ord @@ -90,7 +90,7 @@ object ExtMethods: extension [T](xs: Lst[Lst[T]]) def flatten: Lst[T] = xs.foldLeft(Lst())(_ ++ _) - given ord[T: Ord] as Ord[Lst[T]]: + given ord[T: Ord]: Ord[Lst[T]] with extension (xs: Lst[T]) def less (ys: Lst[T]): Boolean = ??? end Lst diff --git a/tests/pos/the.scala b/tests/pos/the.scala index f8559450be23..52c6e364fd92 100644 --- a/tests/pos/the.scala +++ b/tests/pos/the.scala @@ -2,7 +2,7 @@ object Test { trait Foo { type T; val x: T } - given intFoo as Foo { + given intFoo: Foo with { type T = Int val x = 3 } diff --git a/tests/pos/toplevel-opaque-xm/Logarithm_1.scala b/tests/pos/toplevel-opaque-xm/Logarithm_1.scala index 436097fee478..f2744aaae5af 100644 --- a/tests/pos/toplevel-opaque-xm/Logarithm_1.scala +++ b/tests/pos/toplevel-opaque-xm/Logarithm_1.scala @@ -14,7 +14,7 @@ object Logarithm { def exponent(l: Logarithm): Double = l - given AnyRef { + given AnyRef with { // This is the second way to unlift the logarithm type extension (x: Logarithm) def toDouble: Double = math.exp(x) extension (x: Logarithm) def + (y: Logarithm) = Logarithm(math.exp(x) + math.exp(y)) diff --git a/tests/run-macros/BigFloat/BigFloat_1.scala b/tests/run-macros/BigFloat/BigFloat_1.scala index 296d14e0ee50..54ff41a6e61a 100644 --- a/tests/run-macros/BigFloat/BigFloat_1.scala +++ b/tests/run-macros/BigFloat/BigFloat_1.scala @@ -35,7 +35,7 @@ object BigFloat extends App { def fromDigits(digits: String) = apply(digits) } - given BigFloatFromDigits { + given BigFloatFromDigits with { override inline def fromDigits(digits: String) = ${ BigFloatFromDigitsImpl('digits) } @@ -43,7 +43,7 @@ object BigFloat extends App { // Should be in StdLib: - given Liftable[BigInt] { + given Liftable[BigInt] with { def toExpr(x: BigInt) = '{BigInt(${Expr(x.toString)})} } diff --git a/tests/run-macros/i6988/FirstArg_1.scala b/tests/run-macros/i6988/FirstArg_1.scala index 09e096927332..56a286dcbf82 100644 --- a/tests/run-macros/i6988/FirstArg_1.scala +++ b/tests/run-macros/i6988/FirstArg_1.scala @@ -2,7 +2,7 @@ package foo case class FirstArg(value: Any, source: String) object FirstArg { - inline given create as FirstArg = ${Macros.argsImpl} + inline given create: FirstArg = ${Macros.argsImpl} } object Macros { diff --git a/tests/run-macros/i7048/Lib_1.scala b/tests/run-macros/i7048/Lib_1.scala index 1cb1c0465342..07c78587073b 100644 --- a/tests/run-macros/i7048/Lib_1.scala +++ b/tests/run-macros/i7048/Lib_1.scala @@ -5,7 +5,7 @@ trait IsExpr[T] { def toExpr(x: T): Expr[Underlying] } -given [U] as IsExpr[Expr[U]] = new IsExpr[Expr[U]] { +given [U]: IsExpr[Expr[U]] = new IsExpr[Expr[U]] { type Underlying = U def toExpr(x: Expr[U]): Expr[U] = x } diff --git a/tests/run-macros/i8007/Macro_3.scala b/tests/run-macros/i8007/Macro_3.scala index 7eb0fd2baebc..6848627da138 100644 --- a/tests/run-macros/i8007/Macro_3.scala +++ b/tests/run-macros/i8007/Macro_3.scala @@ -7,11 +7,11 @@ trait Eq[T] { } object Eq { - given Eq[String] { + given Eq[String] with { def eqv(x: String, y: String) = x == y } - given Eq[Int] { + given Eq[Int] with { def eqv(x: Int, y: Int) = x == y } @@ -32,7 +32,7 @@ object Eq { case '[EmptyTuple] => Nil } - given derived[T: Type](using q: Quotes) as Expr[Eq[T]] = { + given derived[T: Type](using q: Quotes): Expr[Eq[T]] = { import quotes.reflect._ val ev: Expr[Mirror.Of[T]] = Expr.summon(using Type.of[Mirror.Of[T]]).get diff --git a/tests/run-macros/i9812b/Macro_1.scala b/tests/run-macros/i9812b/Macro_1.scala index b9ba7b6acbad..700edb1770d4 100644 --- a/tests/run-macros/i9812b/Macro_1.scala +++ b/tests/run-macros/i9812b/Macro_1.scala @@ -16,31 +16,31 @@ object SomeEnum: object Bar: def apply[S <: SomeEnum](s: S): SomeEnum = new Bar(s) -given LiftFoo as Liftable[Foo.type]: +given LiftFoo: Liftable[Foo.type] with def toExpr(x: Foo.type): Quotes ?=> Expr[Foo.type] = '{Foo} -given LiftBar[S <: SomeEnum: Type: Liftable] as Liftable[Bar[S]]: +given LiftBar[S <: SomeEnum: Type: Liftable]: Liftable[Bar[S]] with def toExpr(x: Bar[S]): Quotes ?=> Expr[Bar[S]] = '{new Bar(${Lift(x.s)})} sealed abstract class Lst[+T] final case class CONS[+T](head: T, tail: Lst[T]) extends Lst[T] case object NIL extends Lst[Nothing] -given IntLiftable[T <: Int] as Liftable[T]: +given IntLiftable[T <: Int]: Liftable[T] with def toExpr(x: T): Quotes ?=> Expr[T] = qctx ?=> { import quotes.reflect._ Literal(Constant.Int(x)).asExpr.asInstanceOf[Expr[T]] } -given LiftLst[T: Type: Liftable](using ev1: => Liftable[CONS[T]], ev2: => Liftable[NIL.type]) as Liftable[Lst[T]]: +given LiftLst[T: Type: Liftable](using ev1: => Liftable[CONS[T]], ev2: => Liftable[NIL.type]): Liftable[Lst[T]] with def toExpr(xs: Lst[T]): Quotes ?=> Expr[Lst[T]] = xs match case NIL => ev2.toExpr(NIL) case cons @ CONS(_, _) => ev1.toExpr(cons) -given LiftCONS[T: Type: Liftable](using Liftable[Lst[T]]) as Liftable[CONS[T]]: +given LiftCONS[T: Type: Liftable](using Liftable[Lst[T]]): Liftable[CONS[T]] with def toExpr(x: CONS[T]): Quotes ?=> Expr[CONS[T]] = '{CONS(${Lift(x.head)}, ${Lift(x.tail)})} -given LiftNIL as Liftable[NIL.type]: +given LiftNIL: Liftable[NIL.type] with def toExpr(x: NIL.type): Quotes ?=> Expr[NIL.type] = '{NIL} def mkLst[T](ts: T*) = ts.foldRight(NIL: Lst[T])(CONS(_,_)) diff --git a/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala b/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala index 38915b73c66e..8951f84963cb 100644 --- a/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala @@ -10,7 +10,7 @@ object Macros { type Env = Map[Int, Any] - given ev0 as Env = Map.empty + given ev0: Env = Map.empty def envWith[T](id: Int, ref: Expr[R[T]])(using env: Env): Env = env.updated(id, ref) diff --git a/tests/run-staging/i6281.scala b/tests/run-staging/i6281.scala index 2f19bc641d1b..1828249e8e94 100644 --- a/tests/run-staging/i6281.scala +++ b/tests/run-staging/i6281.scala @@ -21,7 +21,7 @@ object Test extends App { def reify[A](using Type[A]): STM[A, L] => Expr[Stm[A, L]] def reflect[A](using Type[A]): Expr[Stm[A, L]] => STM[A, L] } - given empty as Effects[HNil] { + given empty: Effects[HNil] with { def reify[A](using Type[A]) = m => m def reflect[A](using Type[A]) = m => m } diff --git a/tests/run-with-compiler/intmaptest.scala b/tests/run-with-compiler/intmaptest.scala index 90154290a310..c12cb03e979d 100644 --- a/tests/run-with-compiler/intmaptest.scala +++ b/tests/run-with-compiler/intmaptest.scala @@ -10,11 +10,11 @@ object Generator: val NumLimit = 300 val Iterations = 10000 - given integers as Generator[Int]: + given integers: Generator[Int] with val rand = new java.util.Random def generate = rand.nextInt() - given booleans as Generator[Boolean] = + given booleans: Generator[Boolean] = integers.map(x => x > 0) def range(end: Int): Generator[Int] = @@ -24,7 +24,7 @@ object Generator: case Lookup, Update, Remove export Op._ - given ops as Generator[Op] = + given ops: Generator[Op] = range(10).map { case 0 | 1 | 2 | 3 => Lookup case 4 | 5 | 6 | 7 => Update diff --git a/tests/run-with-compiler/maptest.scala b/tests/run-with-compiler/maptest.scala index 41f2da34551b..9a4b42981d94 100644 --- a/tests/run-with-compiler/maptest.scala +++ b/tests/run-with-compiler/maptest.scala @@ -10,11 +10,11 @@ object Generator: val NumLimit = 300 val Iterations = 10000 - given integers as Generator[Int]: + given integers: Generator[Int] with val rand = new java.util.Random def generate = rand.nextInt() - given booleans as Generator[Boolean] = + given booleans: Generator[Boolean] = integers.map(x => x > 0) def range(end: Int): Generator[Int] = @@ -24,7 +24,7 @@ object Generator: case Lookup, Update, Remove export Op._ - given ops as Generator[Op] = + given ops: Generator[Op] = range(10).map { case 0 | 1 | 2 | 3 => Lookup case 4 | 5 | 6 | 7 => Update diff --git a/tests/run-with-compiler/settest.scala b/tests/run-with-compiler/settest.scala index 2d930ca3fdf9..3a725990b840 100644 --- a/tests/run-with-compiler/settest.scala +++ b/tests/run-with-compiler/settest.scala @@ -10,11 +10,11 @@ object Generator: val NumLimit = 300 val Iterations = 10000 - given integers as Generator[Int]: + given integers: Generator[Int] with val rand = new java.util.Random def generate = rand.nextInt() - given booleans as Generator[Boolean] = + given booleans: Generator[Boolean] = integers.map(x => x > 0) def range(end: Int): Generator[Int] = @@ -24,7 +24,7 @@ object Generator: case Lookup, Update, Remove export Op._ - given ops as Generator[Op] = + given ops: Generator[Op] = range(10).map { case 0 | 1 | 2 | 3 => Lookup case 4 | 5 | 6 | 7 => Update diff --git a/tests/run/Signals.scala b/tests/run/Signals.scala index 4125c804b855..18a1947dcaf0 100644 --- a/tests/run/Signals.scala +++ b/tests/run/Signals.scala @@ -28,7 +28,7 @@ package frp: object Signal: type Caller = Signal[?] - given noCaller as Caller(???): + given noCaller: Caller(???) with override def computeValue() = () end Signal diff --git a/tests/run/Signals1.scala b/tests/run/Signals1.scala index 4ef86d0603d4..129965b4c2a5 100644 --- a/tests/run/Signals1.scala +++ b/tests/run/Signals1.scala @@ -43,7 +43,7 @@ package frp: end Var opaque type Caller = AbstractSignal[?] - given noCaller as Caller = new AbstractSignal[Nothing]: + given noCaller: Caller = new AbstractSignal[Nothing]: override def eval = ??? override def computeValue() = () diff --git a/tests/run/Typeable.scala b/tests/run/Typeable.scala index a3fdb6b26c57..18bf9a4deb6a 100644 --- a/tests/run/Typeable.scala +++ b/tests/run/Typeable.scala @@ -27,13 +27,13 @@ object Typeable: class instanceOf[T: Typeable]: def unapply(x: Any): Option[T] = Typeable[T].cast(x) - given int as Typeable[Int]: + given int: Typeable[Int] with def cast(x: Any): Option[Int] = x match case x: Int => Some(x) case _ => None def describe = "Int" - given list[T: Typeable] as Typeable[List[T]]: + given list[T: Typeable]: Typeable[List[T]] with def cast(x: Any): Option[List[T]] = x match case x: List[_] if x.forall(Typeable[T].cast(_).isDefined) => Some(x.asInstanceOf[List[T]]) case _ => None diff --git a/tests/run/abstract-givens.scala b/tests/run/abstract-givens.scala new file mode 100644 index 000000000000..6ff966411dde --- /dev/null +++ b/tests/run/abstract-givens.scala @@ -0,0 +1,19 @@ +trait T: + given x: Int + given y(using Int): String + given z[T](using T): Seq[T] + +object Test extends T, App: + given x: Int = 22 + override given y(using Int): String = summon[Int].toString + given z[T](using T): Seq[T] with + override def apply(x: Int) = ??? + override def length = ??? + override def iterator = ??? + override def toString = s"seq $x" + + assert(summon[Int] == 22) + assert(summon[String] == "22") + assert(summon[Seq[Int]].toString == "seq 22") + + diff --git a/tests/run/cochis-example.scala b/tests/run/cochis-example.scala index 4f32b00b6ddb..446f52e59c3e 100644 --- a/tests/run/cochis-example.scala +++ b/tests/run/cochis-example.scala @@ -1,11 +1,11 @@ import Predef.{assert, $conforms => _} trait A { - given id[X] as (X => X) = x => x + given id[X]: (X => X) = x => x def trans[X](x: X)(using f: X => X) = f(x) // (2) } object Test extends A with App{ - given succ as (Int => Int) = x => x + 1 // (3) + given succ: (Int => Int) = x => x + 1 // (3) def bad[X](x: X): X = trans[X](x) // (4) unstable definition ! val v1 = bad [Int] (3) // (5) evaluates to 3 assert(v1 == 3) diff --git a/tests/run/exports.scala b/tests/run/exports.scala index e3bca4329935..f68312ca54e2 100644 --- a/tests/run/exports.scala +++ b/tests/run/exports.scala @@ -7,7 +7,7 @@ object Test extends App { class Printer { def print() = println("printing") object cfg extends Config - given config as Config + given config: Config with {} } class Scanner { diff --git a/tests/run/extmethod-overload.scala b/tests/run/extmethod-overload.scala index c3d0ddbf2c20..64cddbfa2e7d 100644 --- a/tests/run/extmethod-overload.scala +++ b/tests/run/extmethod-overload.scala @@ -61,7 +61,7 @@ object Test extends App { extension [T](xs: List[T]) def +++ (ys: List[T]): List[T] = xs ++ ys ++ ys extension [T](xs: List[T]) def +++ (ys: Iterator[T]): List[T] = xs ++ ys ++ ys } - given Bar as Foo + given Bar: Foo with {} assert((1 |+| 2) == 3) assert((1 |+| "2") == 2) @@ -97,7 +97,7 @@ object Test extends App { extension (x: Int) def yy(y: Int) = x + y } - given AnyRef: + given AnyRef with extension (x: Int) { def yy (y: Int) = x - y } diff --git a/tests/run/extmethods2.scala b/tests/run/extmethods2.scala index f1369d37d306..2f61d36f260c 100644 --- a/tests/run/extmethods2.scala +++ b/tests/run/extmethods2.scala @@ -2,7 +2,7 @@ object Test extends App { class TC - given stringListOps(using TC) as Object { + given stringListOps(using TC): Object with { type T = List[String] extension (x: T) def foo(y: T) = (x ++ y, summon[TC]) extension (x: T) def bar(y: Int) = (x(0)(y), summon[TC]) diff --git a/tests/run/extra-implicits.scala b/tests/run/extra-implicits.scala index 615bd50a344d..72787b92e9a4 100644 --- a/tests/run/extra-implicits.scala +++ b/tests/run/extra-implicits.scala @@ -1,8 +1,8 @@ case class A(x: String) case class B(x: String) -given a1 as A("default") -given b1 as B("default") +given a1: A("default") with {} +given b1: B("default") with {} val a2 = A("explicit") val b2 = B("explicit") diff --git a/tests/run/fragables-extension.scala b/tests/run/fragables-extension.scala index 9476d1efd191..417a612a3f04 100644 --- a/tests/run/fragables-extension.scala +++ b/tests/run/fragables-extension.scala @@ -11,11 +11,11 @@ given Fragable[Int] = x => List(IntFrag(x)) given Fragable[String] = x => List(StringFrag(x)) -given [A: Fragable] as Fragable[List[A]] = +given [A: Fragable]: Fragable[List[A]] = x => x.flatMap(_.toFrags) given Fragable[EmptyTuple] = x => Nil -given [A: Fragable, B <: Tuple: Fragable] as Fragable[A *: B] = +given [A: Fragable, B <: Tuple: Fragable]: Fragable[A *: B] = x => x.head.toFrags ++ x.tail.toFrags def f[T: Fragable](x: T) = diff --git a/tests/run/genericNumLits.scala b/tests/run/genericNumLits.scala index 7d1737903d21..7f91ab0b3ef5 100644 --- a/tests/run/genericNumLits.scala +++ b/tests/run/genericNumLits.scala @@ -10,7 +10,7 @@ object Test extends App { case class Even(n: Int) - given FromDigits[Even] { + given FromDigits[Even] with { def fromDigits(digits: String): Even = { val intValue = digits.toInt if (intValue % 2 == 0) Even(intValue) diff --git a/tests/run/given-eta.scala b/tests/run/given-eta.scala index 571125f2b4c5..a01f1c441018 100644 --- a/tests/run/given-eta.scala +++ b/tests/run/given-eta.scala @@ -12,7 +12,7 @@ def g(x: Int)(using d: D) (y: d.T): d.T = d.trans(y) val x = f assert(x(2)(3) == 6) - given D: + given D with type T = Int def trans(other: T) = 2 * other val y = g diff --git a/tests/run/i2567.scala b/tests/run/i2567.scala index 6b321bbb0e80..7ab93aaab4f1 100644 --- a/tests/run/i2567.scala +++ b/tests/run/i2567.scala @@ -1,6 +1,6 @@ class TC -given tc as TC +given tc: TC with {} class Foo(using TC) { println("hi") diff --git a/tests/run/i7788.scala b/tests/run/i7788.scala index e20287e5b936..99d16ba1521c 100644 --- a/tests/run/i7788.scala +++ b/tests/run/i7788.scala @@ -4,9 +4,9 @@ trait Show[-A]: given Show[String] = x => x given Show[Int] = _.toString -given showEither[A,B](using sA: Show[A])(using Show[B]) as Show[Either[A,B]] = +given showEither[A,B](using sA: Show[A])(using Show[B]): Show[Either[A,B]] = _.fold(a => s"Left(${summon[Show[A]].show(a)})", b => s"Right(${summon[Show[B]].show(b)})") -given [A,B](using sA: Show[A])(using sB: Show[B]) as Show[(A,B)] = (a,b) => s"(${sA.show(a)}), ${sB.show(b)})" +given [A,B](using sA: Show[A])(using sB: Show[B]): Show[(A,B)] = (a,b) => s"(${sA.show(a)}), ${sB.show(b)})" @main def Test = diff --git a/tests/run/i8396.scala b/tests/run/i8396.scala index 08c5e769e517..3e44e3898dc5 100644 --- a/tests/run/i8396.scala +++ b/tests/run/i8396.scala @@ -6,9 +6,9 @@ object Prefix: type UpperBoundedType <: String type FullyBoundedType >: String <: String - given A as Show[AbstractType] - given B as Show[UpperBoundedType] - given C as Show[FullyBoundedType] + given A: Show[AbstractType] with {} + given B: Show[UpperBoundedType] with {} + given C: Show[FullyBoundedType] with {} @main def Test = summon[Show[Prefix.AbstractType]] diff --git a/tests/run/i9011.scala b/tests/run/i9011.scala index e76f0b522409..c75871a865bb 100644 --- a/tests/run/i9011.scala +++ b/tests/run/i9011.scala @@ -10,7 +10,7 @@ trait Eq[T] { } object Eq { - given Eq[Int] { + given Eq[Int] with { def eqv(x: Int, y: Int) = x == y } @@ -40,7 +40,7 @@ object Eq { } } - inline given derived[T](using m: Mirror.Of[T]) as Eq[T] = { + inline given derived[T](using m: Mirror.Of[T]): Eq[T] = { val elemInstances = summonAll[m.MirroredElemTypes] inline m match { case s: Mirror.SumOf[T] => eqSum(s, elemInstances) diff --git a/tests/run/i9473.scala b/tests/run/i9473.scala index f65f0f6df9e7..4fa18cab0c29 100644 --- a/tests/run/i9473.scala +++ b/tests/run/i9473.scala @@ -11,7 +11,7 @@ trait Eq[T] { } object Eq { - given Eq[Int] { + given Eq[Int] with { def eqv(x: Int, y: Int) = x == y } @@ -36,7 +36,7 @@ object Eq { } } - inline given derived[T](using m: Mirror.Of[T]) as Eq[T] = { + inline given derived[T](using m: Mirror.Of[T]): Eq[T] = { lazy val elemInstances = summonAll[m.MirroredElemTypes] inline m match { case s: Mirror.SumOf[T] => eqSum(s, elemInstances) diff --git a/tests/run/i9928.scala b/tests/run/i9928.scala index 6e4149ef6538..3a3f818b17d3 100644 --- a/tests/run/i9928.scala +++ b/tests/run/i9928.scala @@ -2,7 +2,7 @@ trait Magic[F]: extension (x: Int) def read: F trait LowPrio: - given Magic[String]: + given Magic[String] with extension(x: Int) def read: String = println("In string") s"$x" @@ -15,7 +15,7 @@ object test1: import Magic.given def apply(s: String): Foo = s - given Magic[Foo]: + given Magic[Foo] with extension (x: Int) def read: Foo = println("In foo") Foo(s"$x") @@ -25,7 +25,7 @@ object test1: object test2: object Magic extends LowPrio: - given Magic[Foo]: + given Magic[Foo] with extension (x: Int) def read: Foo = println("In foo") Foo(s"$x") diff --git a/tests/run/ift-return.scala b/tests/run/ift-return.scala index b49f4c647ee0..021c73173051 100644 --- a/tests/run/ift-return.scala +++ b/tests/run/ift-return.scala @@ -11,9 +11,9 @@ def f(x: Boolean): A ?=> (c: Ctx) ?=> (Int, c.T) = (summon[A].x, summon[Ctx].y) @main def Test = - given A: + given A with val x = 22 - given Ctx: + given Ctx with type T = String val x = "abc" val y = "def" diff --git a/tests/run/implicit-alias.scala b/tests/run/implicit-alias.scala index f10f85603175..ee6ca48da1be 100644 --- a/tests/run/implicit-alias.scala +++ b/tests/run/implicit-alias.scala @@ -22,7 +22,7 @@ object Test extends App { locally{ println("= new") - given t as TC = new TC + given t: TC = new TC summon[TC] summon[TC] } @@ -34,7 +34,7 @@ object Test extends App { locally{ println("= new VC") - given t as TV = new TV(new TC) + given t: TV = new TV(new TC) summon[TV] summon[TV] } @@ -46,21 +46,21 @@ object Test extends App { val tcc = new TCC locally { println("= x.y") - given t as TC = tcc.tc + given t: TC = tcc.tc summon[TC] summon[TC] } locally { println("with given") - given t(using TC1) as TC = new TC + given t(using TC1): TC = new TC summon[TC] summon[TC] } locally { println("with type params") - given t[X] as TC = new TC + given t[X]: TC = new TC summon[TC] summon[TC] } diff --git a/tests/run/implicit-disambiguation.scala b/tests/run/implicit-disambiguation.scala index 881e4ec8083f..ad6f9a9bedc6 100644 --- a/tests/run/implicit-disambiguation.scala +++ b/tests/run/implicit-disambiguation.scala @@ -9,12 +9,12 @@ class C extends A { } object M { def f(using B, C): String = { - given a as A = summon[B] + given a: A = summon[B] summon[A].show } } object Test extends App { - given b as B - given c as C + given b: B with {} + given c: C with {} println(M.f) } diff --git a/tests/run/implicit-specifity.scala b/tests/run/implicit-specifity.scala index bfde7b414824..7b57446c2aeb 100644 --- a/tests/run/implicit-specifity.scala +++ b/tests/run/implicit-specifity.scala @@ -2,20 +2,20 @@ case class Show[T](val i: Int) object Show { def apply[T](implicit st: Show[T]): Int = st.i - given showInt as Show[Int] = new Show[Int](0) - given fallback[T] as Show[T] = new Show[T](1) + given showInt: Show[Int] = new Show[Int](0) + given fallback[T]: Show[T] = new Show[T](1) } class Generic object Generic { - given gen as Generic = new Generic - given showGen[T](using Generic) as Show[T] = new Show[T](2) + given gen: Generic = new Generic + given showGen[T](using Generic): Show[T] = new Show[T](2) } class Generic2 object Generic2 { opaque type HiPriority = AnyRef - given showGen[T] as (Show[T] & HiPriority) = new Show[T](2).asInstanceOf + given showGen[T]: (Show[T] & HiPriority) = new Show[T](2).asInstanceOf } class SubGen extends Generic @@ -25,13 +25,13 @@ object SubGen { object Contextual { trait Context - given ctx as Context + given ctx: Context with {} - given showGen[T](using Generic) as Show[T] = new Show[T](2) + given showGen[T](using Generic): Show[T] = new Show[T](2) - given showGen[T](using Generic, Context) as Show[T] = new Show[T](3) + given showGen[T](using Generic, Context): Show[T] = new Show[T](3) - given showGen[T](using SubGen) as Show[T] = new Show[T](4) + given showGen[T](using SubGen): Show[T] = new Show[T](4) } object Test extends App { diff --git a/tests/run/implied-divergence.scala b/tests/run/implied-divergence.scala index dc431bb87288..791df6dbd5bd 100644 --- a/tests/run/implied-divergence.scala +++ b/tests/run/implied-divergence.scala @@ -2,11 +2,11 @@ // recursions. case class E(x: E | Null) -given e as E(null) +given e: E(null) with {} object Test extends App { - given f(using e: E) as E(e) + given f(using e: E): E(e) with {} assert(summon[E].toString == "E(E(null))") diff --git a/tests/run/implied-for.scala b/tests/run/implied-for.scala index ead431a67372..fea851847a0f 100644 --- a/tests/run/implied-for.scala +++ b/tests/run/implied-for.scala @@ -6,10 +6,10 @@ object A { class C extends T class D[T] - given b as B - given c as C - given t as T - given d as D[Int] + given b: B with {} + given c: C with {} + given t: T with {} + given d: D[Int] with {} } object Test extends App { @@ -29,11 +29,11 @@ class ExecutionContext class Monoid[T] object Instances { - given intOrd as Ordering[Int] + given intOrd: Ordering[Int] with {} - given listOrd[T](using Ordering[T]) as Ordering[List[T]] - given ec as ExecutionContext - given im as Monoid[Int] + given listOrd[T](using Ordering[T]): Ordering[List[T]] with {} + given ec: ExecutionContext with {} + given im: Monoid[Int] with {} } object Test2 { diff --git a/tests/run/implied-priority.scala b/tests/run/implied-priority.scala index 5f3a514bcc03..f66937007a3d 100644 --- a/tests/run/implied-priority.scala +++ b/tests/run/implied-priority.scala @@ -11,18 +11,18 @@ class Arg[T] // An argument that we use as a given for some given instances bel * Traditional scheme: prioritize with location in class hierarchy */ class LowPriorityImplicits { - given t1[T] as E[T]("low") + given t1[T]: E[T]("low") with {} } object NormalImplicits extends LowPriorityImplicits { - given t2[T](using Arg[T]) as E[T]("norm") + given t2[T](using Arg[T]): E[T]("norm") with {} } def test1 = { import NormalImplicits.given assert(summon[E[String]].str == "low") // No Arg available, so only t1 applies - { given Arg[String] + { given Arg[String] with {} assert(summon[E[String]].str == "norm") // Arg available, t2 takes priority } } @@ -31,22 +31,22 @@ def test1 = { */ object Priority { class Low - object Low { given Low } + object Low { given Low with {} } class High extends Low - object High { given High } + object High { given High with {} } } object Impl2 { - given t1[T](using Priority.Low) as E[T]("low") - given t2[T](using Priority.High)(using Arg[T]) as E[T]("norm") + given t1[T](using Priority.Low): E[T]("low") with {} + given t2[T](using Priority.High)(using Arg[T]): E[T]("norm") with {} } def test2 = { import Impl2.given assert(summon[E[String]].str == "low") // No Arg available, so only t1 applies - { given Arg[String] + { given Arg[String] with {} assert(summon[E[String]].str == "norm") // Arg available, t2 takes priority } } @@ -60,14 +60,14 @@ def test2 = { * an alternative without implicit arguments would override all of them. */ object Impl2a { - given t3[T] as E[T]("hi") + given t3[T]: E[T]("hi") with {} } def test2a = { import Impl2.given import Impl2a.given - given Arg[String] + given Arg[String] with {} assert(summon[E[String]].str == "hi") } @@ -75,13 +75,13 @@ def test2a = { * result type of the given instance, e.g. like this: */ object Impl3 { - given t1[T] as E[T]("low") + given t1[T]: E[T]("low") with {} } object Override { trait HighestPriority // A marker trait to indicate a higher priority - given over[T] as E[T]("hi"), HighestPriority + given over[T]: E[T]("hi") with HighestPriority with {} } def test3 = { @@ -101,9 +101,9 @@ def test3 = { * with a default argument. */ object Impl4 { - given t1 as E[String]("string") + given t1: E[String]("string") with {} - given t2[T](using Arg[T]) as E[T]("generic") + given t2[T](using Arg[T]): E[T]("generic") with {} } object fallback4 { @@ -116,7 +116,7 @@ def test4 = { assert(withFallback[String].str == "string") // t1 is applicable assert(withFallback[Int].str == "fallback") // No applicable instances, pick the default - { given Arg[Int] + { given Arg[Int] with {} assert(withFallback[Int].str == "generic") // t2 is applicable } } @@ -134,7 +134,7 @@ object HigherPriority { } object fallback5 { - given [T](using ev: E[T] = new E[T]("fallback")) as (E[T] & HigherPriority.Type) = HigherPriority.inject(ev) + given [T](using ev: E[T] = new E[T]("fallback")): (E[T] & HigherPriority.Type) = HigherPriority.inject(ev) } def test5 = { @@ -146,7 +146,7 @@ def test5 = { assert(summon[E[String]].str == "string") // t1 is applicable assert(summon[E[Int]].str == "fallback") // No applicable instances, pick the default - { given Arg[Int] + { given Arg[Int] with {} assert(summon[E[Int]].str == "generic") // t2 is applicable } } diff --git a/tests/run/implied-specifity-2.scala b/tests/run/implied-specifity-2.scala index 51c213c47a1e..d107081e78b3 100644 --- a/tests/run/implied-specifity-2.scala +++ b/tests/run/implied-specifity-2.scala @@ -1,32 +1,32 @@ class Low object Low { - given low as Low + given low: Low with {} } class Medium extends Low object Medium { - given medium as Medium + given medium: Medium with {} } class High extends Medium object High { - given high as High + given high: High with {} } class Foo[T](val i: Int) object Foo { def apply[T](using fooT: Foo[T]): Int = fooT.i - given foo[T](using Low) as Foo[T](0) - given foobar[T](using Low) as Foo[Bar[T]](1) - given foobarbaz(using Low) as Foo[Bar[Baz]](2) + given foo[T](using Low): Foo[T](0) with {} + given foobar[T](using Low): Foo[Bar[T]](1) with {} + given foobarbaz(using Low): Foo[Bar[Baz]](2) with {} } class Bar[T] object Bar { - given foobar[T](using Medium) as Foo[Bar[T]](3) - given foobarbaz(using Medium) as Foo[Bar[Baz]](4) + given foobar[T](using Medium): Foo[Bar[T]](3) with {} + given foobarbaz(using Medium): Foo[Bar[Baz]](4) with {} } class Baz object Baz { - given baz(using High) as Foo[Bar[Baz]](5) + given baz(using High): Foo[Bar[Baz]](5) with {} } class Arg @@ -35,24 +35,24 @@ given Arg class Bam(val str: String) -given lo(using Low) as Bam("lo") +given lo(using Low): Bam("lo") with {} -given hi(using High)(using Arg) as Bam("hi") +given hi(using High)(using Arg): Bam("hi") with {} class Bam2(val str: String) -given lo2(using Low) as Bam2("lo") +given lo2(using Low): Bam2("lo") with {} -given mid2(using High)(using Arg) as Bam2("mid") +given mid2(using High)(using Arg): Bam2("mid") with {} -given hi2 as Bam2("hi") +given hi2: Bam2("hi") with {} class Arg2 class Red(val str: String) -given normal(using Arg2) as Red("normal") +given normal(using Arg2): Red("normal") with {} -given reduced(using ev: Arg2 | Low) as Red("reduced") +given reduced(using ev: Arg2 | Low): Red("reduced") with {} object Test extends App { assert(Foo[Int] == 0) diff --git a/tests/run/instances-anonymous.scala b/tests/run/instances-anonymous.scala index 6df12e5d52e7..11fa89c41416 100644 --- a/tests/run/instances-anonymous.scala +++ b/tests/run/instances-anonymous.scala @@ -16,7 +16,7 @@ object Test extends App { println(circle.circumference) - given AnyRef { + given AnyRef with { extension (xs: Seq[String]) def longestStrings: Seq[String] = { val maxLength = xs.map(_.length).max xs.filter(_.length == maxLength) @@ -45,7 +45,7 @@ object Test extends App { def unit: T } - given Monoid[String] { + given Monoid[String] with { extension (x: String) def combine(y: String): String = x.concat(y) def unit: String = "" } @@ -63,13 +63,13 @@ object Test extends App { val minimum: T } - given Ord[Int] { + given Ord[Int] with { extension (x: Int) def compareTo(y: Int) = if (x < y) -1 else if (x > y) +1 else 0 val minimum = Int.MinValue } - given [T: Ord] as Ord[List[T]] { + given [T: Ord]: Ord[List[T]] with { extension (xs: List[T]) def compareTo(ys: List[T]): Int = (xs, ys).match { case (Nil, Nil) => 0 case (Nil, _) => -1 @@ -101,14 +101,14 @@ object Test extends App { def pure[A](x: A): F[A] } - given Monad[List] { + given Monad[List] with { extension [A, B](xs: List[A]) def flatMap (f: A => List[B]): List[B] = xs.flatMap(f) def pure[A](x: A): List[A] = List(x) } - given [Ctx] as Monad[[X] =>> Ctx => X] { + given [Ctx]: Monad[[X] =>> Ctx => X] with { extension [A, B](r: Ctx => A) def flatMap (f: A => Ctx => B): Ctx => B = ctx => f(r(ctx))(ctx) def pure[A](x: A): Ctx => A = diff --git a/tests/run/instances.scala b/tests/run/instances.scala index 6c3ea675ff5c..e49896cbba21 100644 --- a/tests/run/instances.scala +++ b/tests/run/instances.scala @@ -46,7 +46,7 @@ object Test extends App { trait Monoid[T] extends SemiGroup[T]: def unit: T - given StringMonoid as Monoid[String]: + given StringMonoid: Monoid[String] with extension (x: String) def combine(y: String): String = x.concat(y) def unit: String = "" @@ -63,12 +63,12 @@ object Test extends App { val minimum: T end Ord - given Ord[Int]: + given Ord[Int] with extension (x: Int) def compareTo(y: Int) = if (x < y) -1 else if (x > y) +1 else 0 val minimum = Int.MinValue - given listOrd[T: Ord] as Ord[List[T]]: + given listOrd[T: Ord]: Ord[List[T]] with extension (xs: List[T]) def compareTo(ys: List[T]): Int = (xs, ys).match case (Nil, Nil) => 0 case (Nil, _) => -1 @@ -99,13 +99,13 @@ object Test extends App { def pure[A](x: A): F[A] end Monad - given listMonad as Monad[List]: + given listMonad: Monad[List] with extension [A, B](xs: List[A]) def flatMap (f: A => List[B]): List[B] = xs.flatMap(f) def pure[A](x: A): List[A] = List(x) - given readerMonad[Ctx] as Monad[[X] =>> Ctx => X]: + given readerMonad[Ctx]: Monad[[X] =>> Ctx => X] with extension [A, B](r: Ctx => A) def flatMap (f: A => Ctx => B): Ctx => B = ctx => f(r(ctx))(ctx) def pure[A](x: A): Ctx => A = diff --git a/tests/run/overloading-specifity-2.scala b/tests/run/overloading-specifity-2.scala index 13ff783d9535..9b04d82bfa66 100644 --- a/tests/run/overloading-specifity-2.scala +++ b/tests/run/overloading-specifity-2.scala @@ -12,7 +12,7 @@ object Generic { object Test extends App { trait Context - //given ctx as Context + //given ctx: Context with {} object a { def foo[T](implicit gen: Generic): Show[T] = new Show[T](1) diff --git a/tests/run/overloading-specifity.scala b/tests/run/overloading-specifity.scala index 55406bacff95..905e45ace938 100644 --- a/tests/run/overloading-specifity.scala +++ b/tests/run/overloading-specifity.scala @@ -11,7 +11,7 @@ object Generic { object Test extends App { trait Context - given ctx as Context + given ctx: Context with {} object b { def foo[T](implicit gen: Generic): Show[T] = new Show[T](1) diff --git a/tests/run/poly-kinded-derives.scala b/tests/run/poly-kinded-derives.scala index c98dcb9541e1..61f19cc063b2 100644 --- a/tests/run/poly-kinded-derives.scala +++ b/tests/run/poly-kinded-derives.scala @@ -4,10 +4,10 @@ object Test extends App { { trait Show[T] object Show { - given Show[Int] {} - given [T](using st: Show[T]) as Show[Tuple1[T]] - given t2[T, U](using st: Show[T], su: Show[U]) as Show[(T, U)] - given t3 [T, U, V](using st: Show[T], su: Show[U], sv: Show[V]) as Show[(T, U, V)] + given Show[Int] with {} + given [T](using st: Show[T]): Show[Tuple1[T]] with {} + given t2[T, U](using st: Show[T], su: Show[U]): Show[(T, U)] with {} + given t3 [T, U, V](using st: Show[T], su: Show[U], sv: Show[V]): Show[(T, U, V)] with {} def derived[T](using m: Mirror.Of[T], r: Show[m.MirroredElemTypes]): Show[T] = new Show[T] {} } @@ -22,10 +22,10 @@ object Test extends App { { trait Functor[F[_]] object Functor { - given [C] as Functor[[T] =>> C] {} - given Functor[[T] =>> Tuple1[T]] {} - given t2 [T] as Functor[[U] =>> (T, U)] {} - given t3 [T, U] as Functor[[V] =>> (T, U, V)] {} + given [C]: Functor[[T] =>> C] with {} + given Functor[[T] =>> Tuple1[T]] with {} + given t2 [T]: Functor[[U] =>> (T, U)] with {} + given t3 [T, U]: Functor[[V] =>> (T, U, V)] with {} def derived[F[_]](using m: Mirror { type MirroredType[X] = F[X] ; type MirroredElemTypes[_] }, r: Functor[m.MirroredElemTypes]): Functor[F] = new Functor[F] {} } @@ -40,8 +40,8 @@ object Test extends App { { trait FunctorK[F[_[_]]] object FunctorK { - given [C] as FunctorK[[F[_]] =>> C] {} - given [T] as FunctorK[[F[_]] =>> Tuple1[F[T]]] + given [C]: FunctorK[[F[_]] =>> C] with {} + given [T]: FunctorK[[F[_]] =>> Tuple1[F[T]]] with {} def derived[F[_[_]]](using m: Mirror { type MirroredType[X[_]] = F[X] ; type MirroredElemTypes[_[_]] }, r: FunctorK[m.MirroredElemTypes]): FunctorK[F] = new FunctorK[F] {} } @@ -56,10 +56,10 @@ object Test extends App { { trait Bifunctor[F[_, _]] object Bifunctor { - given [C] as Bifunctor[[T, U] =>> C] {} - given Bifunctor[[T, U] =>> Tuple1[U]] {} - given t2 as Bifunctor[[T, U] =>> (T, U)] {} - given t3 [T] as Bifunctor[[U, V] =>> (T, U, V)] {} + given [C]: Bifunctor[[T, U] =>> C] with {} + given Bifunctor[[T, U] =>> Tuple1[U]] with {} + given t2: Bifunctor[[T, U] =>> (T, U)] with {} + given t3 [T]: Bifunctor[[U, V] =>> (T, U, V)] with {} def derived[F[_, _]](using m: Mirror { type MirroredType[X, Y] = F[X, Y] ; type MirroredElemTypes[_, _] }, r: Bifunctor[m.MirroredElemTypes]): Bifunctor[F] = ??? } diff --git a/tests/run/string-context-implicits-with-conversion.scala b/tests/run/string-context-implicits-with-conversion.scala index 54e52ebdda8d..a8899d4232a4 100644 --- a/tests/run/string-context-implicits-with-conversion.scala +++ b/tests/run/string-context-implicits-with-conversion.scala @@ -4,7 +4,7 @@ object Lib { opaque type Showed = String - given [T](using show: Show[T]) as Conversion[T, Showed] = x => show(x) + given [T](using show: Show[T]): Conversion[T, Showed] = x => show(x) trait Show[T] { def apply(x: T): String diff --git a/tests/run/structural-contextual.scala b/tests/run/structural-contextual.scala index 43872856e4ed..e1d0890b73cd 100644 --- a/tests/run/structural-contextual.scala +++ b/tests/run/structural-contextual.scala @@ -15,7 +15,7 @@ type Person = ResolvingSelectable { @main def Test = - given Resolver: + given Resolver with def resolve(label: String) = label match case "name" => "Emma" case "age" => 8 diff --git a/tests/run/tagless.scala b/tests/run/tagless.scala index 334a5a692e40..c245308ea6e9 100644 --- a/tests/run/tagless.scala +++ b/tests/run/tagless.scala @@ -40,17 +40,15 @@ object Test extends App { add(lit(8), neg(add(lit(1), lit(2)))) // Base operations as type classes - given Exp[Int] { + given Exp[Int] with def lit(i: Int): Int = i def neg(t: Int): Int = -t def add(l: Int, r: Int): Int = l + r - } - given Exp[String] { + given Exp[String] with def lit(i: Int): String = i.toString def neg(t: String): String = s"(-$t)" def add(l: String, r: String): String = s"($l + $r)" - } println(tf1[Int]) println(tf1[String]) @@ -67,13 +65,11 @@ object Test extends App { def tfm1[T: Exp : Mult] = add(lit(7), neg(mul(lit(1), lit(2)))) def tfm2[T: Exp : Mult] = mul(lit(7), tf1) - given Mult[Int] { + given Mult[Int] with def mul(l: Int, r: Int): Int = l * r - } - given Mult[String] { + given Mult[String] with def mul(l: String, r: String): String = s"$l * $r" - } println(tfm1[Int]) println(tfm1[String]) @@ -87,12 +83,11 @@ object Test extends App { } import Tree._ - given Exp[Tree], Mult[Tree] { + given Exp[Tree] with Mult[Tree] with def lit(i: Int): Tree = Node("Lit", Leaf(i.toString)) def neg(t: Tree): Tree = Node("Neg", t) def add(l: Tree, r: Tree): Tree = Node("Add", l , r) def mul(l: Tree, r: Tree): Tree = Node("Mult", l , r) - } val tf1Tree = tf1[Tree] val tfm1Tree = tfm1[Tree] @@ -108,7 +103,7 @@ object Test extends App { private class Exc(msg: String) extends Exception(msg) def _throw(msg: String)(using CanThrow): Nothing = throw new Exc(msg) def _try[T](op: Maybe[T])(handler: String => T): T = { - given CanThrow + given CanThrow with {} try op catch { case ex: Exception => handler(ex.getMessage) @@ -153,7 +148,7 @@ object Test extends App { def value[T](using Exp[T]): T } - given Exp[Wrapped] { + given Exp[Wrapped] with def lit(i: Int) = new Wrapped { def value[T](using e: Exp[T]): T = e.lit(i) } @@ -163,7 +158,6 @@ object Test extends App { def add(l: Wrapped, r: Wrapped) = new Wrapped { def value[T](using e: Exp[T]): T = e.add(l.value, r.value) } - } show { val t = fromTree[Wrapped](tf1Tree) @@ -196,7 +190,7 @@ object Test extends App { // Added operation: negation pushdown enum NCtx { case Pos, Neg } - given [T](using e: Exp[T]) as Exp[NCtx => T] { + given [T](using e: Exp[T]): Exp[NCtx => T] with import NCtx._ def lit(i: Int) = { case Pos => e.lit(i) @@ -208,7 +202,6 @@ object Test extends App { } def add(l: NCtx => T, r: NCtx => T): NCtx => T = c => e.add(l(c), r(c)) - } println(tf1[NCtx => String](NCtx.Pos)) @@ -216,13 +209,12 @@ object Test extends App { println(pushNeg(tf1[NCtx => String])) println(pushNeg(pushNeg(pushNeg(tf1))): String) - given [T](using e: Mult[T]) as Mult[NCtx => T] { + given [T](using e: Mult[T]): Mult[NCtx => T] with import NCtx._ def mul(l: NCtx => T, r: NCtx => T): NCtx => T = { case Pos => e.mul(l(Pos), r(Pos)) case Neg => e.mul(l(Pos), r(Neg)) } - } println(pushNeg(tfm1[NCtx => String])) println(pushNeg(tfm2[NCtx => String])) @@ -230,11 +222,10 @@ object Test extends App { import IExp._ // Going from type class encoding to ADT encoding - given initialize as Exp[IExp] { + given initialize: Exp[IExp] with def lit(i: Int): IExp = Lit(i) def neg(t: IExp): IExp = Neg(t) def add(l: IExp, r: IExp): IExp = Add(l, r) - } // Going from ADT encoding to type class encoding def finalize[T](i: IExp)(using e: Exp[T]): T = i match { diff --git a/tests/run/typeclass-derivation-doc-example.scala b/tests/run/typeclass-derivation-doc-example.scala index c70b1bac5c50..c85319b1ba88 100644 --- a/tests/run/typeclass-derivation-doc-example.scala +++ b/tests/run/typeclass-derivation-doc-example.scala @@ -11,7 +11,7 @@ trait Eq[T] { } object Eq { - given Eq[Int] { + given Eq[Int] with { def eqv(x: Int, y: Int) = x == y } @@ -36,7 +36,7 @@ object Eq { } } - inline given derived[T](using m: Mirror.Of[T]) as Eq[T] = { + inline given derived[T](using m: Mirror.Of[T]): Eq[T] = { val elemInstances = summonAll[m.MirroredElemTypes] inline m match { case s: Mirror.SumOf[T] => eqSum(s, elemInstances) diff --git a/tests/semanticdb/expect/Enums.expect.scala b/tests/semanticdb/expect/Enums.expect.scala index 1fc2256cee59..1e91f30acf4b 100644 --- a/tests/semanticdb/expect/Enums.expect.scala +++ b/tests/semanticdb/expect/Enums.expect.scala @@ -47,7 +47,7 @@ object Enums/*<-_empty_::Enums.*/: case Refl/*<-_empty_::Enums.`<:<`.Refl#*/[C/*<-_empty_::Enums.`<:<`.Refl#[C]*/]() extends (C/*->_empty_::Enums.`<:<`.Refl#[C]*/ <:_empty_::Enums.`<:<`#*/ C/*->_empty_::Enums.`<:<`.Refl#[C]*/) object <:_empty_::Enums.`<:<`.given_T().[T]*/ <:_empty_::Enums.`<:<`#*/ T/*->_empty_::Enums.`<:<`.given_T().[T]*/) = Refl/*->_empty_::Enums.`<:<`.Refl.*//*->_empty_::Enums.`<:<`.Refl.apply().*/() + given [T]: (T/*<-_empty_::Enums.`<:<`.given_T().*//*<-_empty_::Enums.`<:<`.given_T().[T]*//*->_empty_::Enums.`<:<`.given_T().[T]*/ <:_empty_::Enums.`<:<`#*/ T/*->_empty_::Enums.`<:<`.given_T().[T]*/) = Refl/*->_empty_::Enums.`<:<`.Refl.*//*->_empty_::Enums.`<:<`.Refl.apply().*/() extension [A/*<-_empty_::Enums.unwrap().[A]*/, B/*<-_empty_::Enums.unwrap().[B]*/](opt/*<-_empty_::Enums.unwrap().(opt)*/: Option/*->scala::Option#*/[A/*->_empty_::Enums.unwrap().[A]*/]) def unwrap/*<-_empty_::Enums.unwrap().*/(using ev/*<-_empty_::Enums.unwrap().(ev)*/: A/*->_empty_::Enums.unwrap().[A]*/ <:_empty_::Enums.`<:<`#*/ Option/*->scala::Option#*/[B/*->_empty_::Enums.unwrap().[B]*/]): Option/*->scala::Option#*/[B/*->_empty_::Enums.unwrap().[B]*/] = ev/*->_empty_::Enums.unwrap().(ev)*/ match case Refl/*->_empty_::Enums.`<:<`.Refl.*//*->_empty_::Enums.`<:<`.Refl.unapply().*/() => opt/*->_empty_::Enums.unwrap().(opt)*/.flatMap/*->scala::Option#flatMap().*/(identity/*->scala::Predef.identity().*//*->local0*/[Option/*->scala::Option#*/[B/*->_empty_::Enums.unwrap().[B]*/]]) diff --git a/tests/semanticdb/expect/Enums.scala b/tests/semanticdb/expect/Enums.scala index 56ed483b2d76..3d666fb618a9 100644 --- a/tests/semanticdb/expect/Enums.scala +++ b/tests/semanticdb/expect/Enums.scala @@ -47,7 +47,7 @@ object Enums: case Refl[C]() extends (C <:< C) object <:< : - given [T] as (T <:< T) = Refl() + given [T]: (T <:< T) = Refl() extension [A, B](opt: Option[A]) def unwrap(using ev: A <:< Option[B]): Option[B] = ev match case Refl() => opt.flatMap(identity[Option[B]]) diff --git a/tests/semanticdb/expect/Givens.expect.scala b/tests/semanticdb/expect/Givens.expect.scala index b037af9da2ca..126c1f8e9919 100644 --- a/tests/semanticdb/expect/Givens.expect.scala +++ b/tests/semanticdb/expect/Givens.expect.scala @@ -18,10 +18,10 @@ object Givens/*<-a::b::Givens.*/: def empty/*<-a::b::Givens.Monoid#empty().*/: A/*->a::b::Givens.Monoid#[A]*/ extension (x/*<-a::b::Givens.Monoid#combine().(x)*/: A/*->a::b::Givens.Monoid#[A]*/) def combine/*<-a::b::Givens.Monoid#combine().*/(y/*<-a::b::Givens.Monoid#combine().(y)*/: A/*->a::b::Givens.Monoid#[A]*/): A/*->a::b::Givens.Monoid#[A]*/ - given Monoid[String]: - /*<-a::b::Givens.given_Monoid_String.*//*->a::b::Givens.Monoid#*//*->scala::Predef.String#*/ def empty/*<-a::b::Givens.given_Monoid_String.empty().*/ = "" + given Monoid[String] with/*<-a::b::Givens.given_Monoid_String.*//*->a::b::Givens.Monoid#*//*->scala::Predef.String#*/ + def empty/*<-a::b::Givens.given_Monoid_String.empty().*/ = "" extension (x/*<-a::b::Givens.given_Monoid_String.combine().(x)*/: String/*->scala::Predef.String#*/) def combine/*<-a::b::Givens.given_Monoid_String.combine().*/(y/*<-a::b::Givens.given_Monoid_String.combine().(y)*/: String/*->scala::Predef.String#*/) = x/*->a::b::Givens.given_Monoid_String.combine().(x)*/ +/*->java::lang::String#`+`().*/ y/*->a::b::Givens.given_Monoid_String.combine().(y)*/ - inline given int2String/*<-a::b::Givens.int2String().*/ as Conversion/*->scala::Conversion#*/[Int/*->scala::Int#*/, String/*->scala::Predef.String#*/] = _.toString/*->scala::Any#toString().*/ + inline given int2String/*<-a::b::Givens.int2String().*/: Conversion/*->scala::Conversion#*/[Int/*->scala::Int#*/, String/*->scala::Predef.String#*/] = _.toString/*->scala::Any#toString().*/ def foo/*<-a::b::Givens.foo().*/[A/*<-a::b::Givens.foo().[A]*/](using A/*<-a::b::Givens.foo().(A)*/: Monoid/*->a::b::Givens.Monoid#*/[A/*->a::b::Givens.foo().[A]*/]): A/*->a::b::Givens.foo().[A]*/ = A/*->a::b::Givens.foo().(A)*/.combine/*->a::b::Givens.Monoid#combine().*/(A/*->a::b::Givens.foo().(A)*/.empty/*->a::b::Givens.Monoid#empty().*/)(A/*->a::b::Givens.foo().(A)*/.empty/*->a::b::Givens.Monoid#empty().*/) diff --git a/tests/semanticdb/expect/Givens.scala b/tests/semanticdb/expect/Givens.scala index be219b361924..819d70cfadca 100644 --- a/tests/semanticdb/expect/Givens.scala +++ b/tests/semanticdb/expect/Givens.scala @@ -18,10 +18,10 @@ object Givens: def empty: A extension (x: A) def combine(y: A): A - given Monoid[String]: + given Monoid[String] with def empty = "" extension (x: String) def combine(y: String) = x + y - inline given int2String as Conversion[Int, String] = _.toString + inline given int2String: Conversion[Int, String] = _.toString def foo[A](using A: Monoid[A]): A = A.combine(A.empty)(A.empty) diff --git a/tests/semanticdb/metac.expect b/tests/semanticdb/metac.expect index 521c8773312d..06ae1f60b3f0 100644 --- a/tests/semanticdb/metac.expect +++ b/tests/semanticdb/metac.expect @@ -936,13 +936,13 @@ Occurrences: [46:34..46:35): C -> _empty_/Enums.`<:<`.Refl#[C] [46:35..46:35): -> _empty_/Enums.`<:<`#``(). [48:9..48:12): <:< <- _empty_/Enums.`<:<`. -[49:10..49:17): [T] as <- _empty_/Enums.`<:<`.given_T(). +[49:10..49:17): [T]: (T <- _empty_/Enums.`<:<`.given_T(). [49:11..49:12): T <- _empty_/Enums.`<:<`.given_T().[T] -[49:18..49:19): T -> _empty_/Enums.`<:<`.given_T().[T] -[49:20..49:23): <:< -> _empty_/Enums.`<:<`# -[49:24..49:25): T -> _empty_/Enums.`<:<`.given_T().[T] -[49:29..49:33): Refl -> _empty_/Enums.`<:<`.Refl. -[49:33..49:33): -> _empty_/Enums.`<:<`.Refl.apply(). +[49:16..49:17): T -> _empty_/Enums.`<:<`.given_T().[T] +[49:18..49:21): <:< -> _empty_/Enums.`<:<`# +[49:22..49:23): T -> _empty_/Enums.`<:<`.given_T().[T] +[49:27..49:31): Refl -> _empty_/Enums.`<:<`.Refl. +[49:31..49:31): -> _empty_/Enums.`<:<`.Refl.apply(). [51:13..51:14): A <- _empty_/Enums.unwrap().[A] [51:16..51:17): B <- _empty_/Enums.unwrap().[B] [51:19..51:22): opt <- _empty_/Enums.unwrap().(opt) @@ -1304,7 +1304,7 @@ Occurrences: [18:33..18:34): y <- a/b/Givens.Monoid#combine().(y) [18:36..18:37): A -> a/b/Givens.Monoid#[A] [18:40..18:41): A -> a/b/Givens.Monoid#[A] -[20:8..21:3): <- a/b/Givens.given_Monoid_String. +[20:8..20:27): Monoid[String] with <- a/b/Givens.given_Monoid_String. [20:8..20:14): Monoid -> a/b/Givens.Monoid# [20:15..20:21): String -> scala/Predef.String# [21:8..21:13): empty <- a/b/Givens.given_Monoid_String.empty(). @@ -1317,10 +1317,10 @@ Occurrences: [22:53..22:54): + -> java/lang/String#`+`(). [22:55..22:56): y -> a/b/Givens.given_Monoid_String.combine().(y) [24:15..24:25): int2String <- a/b/Givens.int2String(). -[24:29..24:39): Conversion -> scala/Conversion# -[24:40..24:43): Int -> scala/Int# -[24:45..24:51): String -> scala/Predef.String# -[24:57..24:65): toString -> scala/Any#toString(). +[24:27..24:37): Conversion -> scala/Conversion# +[24:38..24:41): Int -> scala/Int# +[24:43..24:49): String -> scala/Predef.String# +[24:55..24:63): toString -> scala/Any#toString(). [26:6..26:9): foo <- a/b/Givens.foo(). [26:10..26:11): A <- a/b/Givens.foo().[A] [26:19..26:20): A <- a/b/Givens.foo().(A)