Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/Desugar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ object desugar {
case pat @ Bind(nme.WILDCARD, body) =>
val name =
body match
case Typed(Ident(nme.WILDCARD), tpt) if pat.mods.is(Given) => inventGivenName(tpt)
case Typed(Ident(nme.WILDCARD), tpt) if pat.mods.is(Given) => inventGivenOrExtensionName(tpt)
case _ => UniqueName.fresh()
(cpy.Bind(pat)(name, body).withMods(pat.mods), Ident(name))
case Bind(name, _) => (pat, Ident(name))
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/init/Checker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Checker extends Phase:
cancellable {
val classes = traverser.getClasses()

if ctx.settings.Whas.safeInit then
if ctx.settings.Whas.checkInit then
Semantic.checkClasses(classes)(using checkCtx)
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ trait ImplicitRunInfo:
WildcardType
else
seen += t
t.superType match
t.underlying match
case TypeBounds(lo, hi) =>
if lo.isBottomTypeAfterErasure then apply(hi)
else AndType.make(apply(lo), apply(hi))
Expand Down
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import config.Config
import transform.CheckUnused.OriginalName

import scala.annotation.constructorOnly
import scala.util.chaining.scalaUtilChainingOps
import dotty.tools.dotc.rewrites.Rewrites

object Typer {
Expand Down
5 changes: 3 additions & 2 deletions compiler/test/dotty/tools/dotc/reporting/CodeActionTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import dotty.tools.DottyTest
import dotty.tools.dotc.rewrites.Rewrites
import dotty.tools.dotc.rewrites.Rewrites.ActionPatch
import dotty.tools.dotc.util.SourceFile
import dotty.tools.dotc.core.Contexts._

import scala.annotation.tailrec
import scala.jdk.CollectionConverters.*
Expand Down Expand Up @@ -295,8 +296,8 @@ class CodeActionTest extends DottyTest:
val rep = new StoreReporter(null) with UniqueMessagePositions with HideNonSensicalMessages
initialCtx.setReporter(rep).withoutColors

private def checkCodeAction(code: String, title: String, expected: String, afterPhase: String = "typer") =
ctx = newContext
private def checkCodeAction(code: String, title: String, expected: String, afterPhase: String = "typer", ctxx: Context = newContext) =
ctx = ctxx
val source = SourceFile.virtual("test", code).content
val runCtx = checkCompile(afterPhase, code) { (_, _) => () }
val diagnostics = runCtx.reporter.removeBufferedMessages
Expand Down
12 changes: 12 additions & 0 deletions tests/pos/i21951b.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

class A
object A:
given A = ???

class B[X]
object B:
given g[T]: B[T] = ???

object Test:
def foo[X >: A] = summon[X] // was error
def bar[F[T] >: B[T]] = summon[F[Int]] // was error
Loading