Skip to content

Commit f382936

Browse files
committed
Merge branch 'master' into better-type-reporting-1
2 parents d6c5d92 + 7627583 commit f382936

File tree

433 files changed

+20169
-2810
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

433 files changed

+20169
-2810
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ jobs:
158158
run: '"C:\Program Files\Git\bin\bash" ./project/scripts/winCmdTests'
159159
shell: cmd
160160

161+
- name: win tests
162+
run: './project/scripts/winCmdTests.bat'
163+
shell: cmd
164+
161165
- name: Scala.js Test
162166
run: sbt ";sjsJUnitTests/test ;sjsCompilerTests/test"
163167
shell: cmd

.github/workflows/cla.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ jobs:
66
steps:
77
- uses: actions/checkout@v2
88
- run: ./project/scripts/check-cla.sh
9+
env:
10+
AUTHOR: ${{ github.event.pull_request.user.login }}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,6 @@
201201
[submodule "community-build/community-projects/fs2"]
202202
path = community-build/community-projects/fs2
203203
url = https://github.com/dotty-staging/fs2.git
204+
[submodule "community-build/community-projects/libretto"]
205+
path = community-build/community-projects/libretto
206+
url = https://github.com/dotty-staging/libretto.git
Submodule libretto added at d229f3c
Submodule munit updated 38 files

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,19 @@ object projects:
278278

279279
lazy val scalatest: SbtCommunityProject = SbtCommunityProject(
280280
project = "scalatest",
281-
sbtTestCommand = "scalacticDotty/clean; scalacticDottyJS/clean; scalacticTestDotty/test; scalatestTestDotty/test; scalacticDottyJS/compile; scalatestDottyJS/compile",
281+
sbtTestCommand =
282+
List(
283+
"scalacticDotty/clean; scalacticDottyJS/clean",
284+
285+
// Some scalatest's tests are flaky (https://github.com/scalatest/scalatest/issues/2049)
286+
// so we disable them, this list is based on the one used in the Scala 2 community build
287+
// (https://github.com/scala/community-build/blob/2.13.x/proj/scalatest.conf).
288+
"""set scalatestTest / Test / unmanagedSources / excludeFilter := HiddenFileFilter || "GeneratorSpec.scala" || "FrameworkSuite.scala" || "WaitersSpec.scala" || "TestSortingReporterSpec.scala" || "JavaFuturesSpec.scala" || "ParallelTestExecutionSpec.scala" || "TimeLimitsSpec.scala" || "TestThreadsStartingCounterSpec.scala" || "SuiteSortingReporterSpec.scala" || "CommonGeneratorsSpec.scala" || "PropCheckerAssertingSpec.scala" || "ConductorMethodsSuite.scala"""",
289+
"""set scalacticTest / Test / unmanagedSources / excludeFilter := HiddenFileFilter || "NonEmptyArraySpec.scala"""",
290+
"""set genRegularTests4 / Test / managedSources ~= (_.filterNot(_.getName == "FrameworkSuite.scala").filterNot(_.getName == "GeneratorSpec.scala").filterNot(_.getName == "CommonGeneratorsSpec.scala").filterNot(_.getName == "ParallelTestExecutionSpec.scala").filterNot(_.getName == "DispatchReporterSpec.scala").filterNot(_.getName == "TestThreadsStartingCounterSpec.scala").filterNot(_.getName == "EventuallySpec.scala"))""",
291+
292+
"scalacticTestDotty/test; scalatestTestDotty/test; scalacticDottyJS/compile; scalatestDottyJS/compile"
293+
).mkString("; "),
282294
sbtPublishCommand = "scalacticDotty/publishLocal; scalatestDotty/publishLocal; scalacticDottyJS/publishLocal; scalatestDottyJS/publishLocal",
283295
sbtDocCommand = ";scalacticDotty/doc", // fails with missing type ;scalatestDotty/doc"
284296
// cannot take signature of (test: org.scalatest.concurrent.ConductorFixture#OneArgTest):
@@ -357,8 +369,8 @@ object projects:
357369
lazy val stdLib213 = SbtCommunityProject(
358370
project = "stdLib213",
359371
extraSbtArgs = List("-Dscala.build.compileWithDotty=true"),
360-
sbtTestCommand = """library/compile""",
361-
sbtPublishCommand = """set library/Compile/packageDoc/publishArtifact := false; library/publishLocal""",
372+
sbtTestCommand = """set Global / fatalWarnings := false; library/compile""",
373+
sbtPublishCommand = """set Global / fatalWarnings := false; set library/Compile/packageDoc/publishArtifact := false; library/publishLocal""",
362374
// sbtDocCommand = "library/doc" // Does no compile? No idea :/
363375
)
364376

@@ -691,6 +703,13 @@ object projects:
691703
dependencies = List(cats, catsEffect3, munitCatsEffect, scalacheckEffect, scodecBits)
692704
)
693705

706+
lazy val libretto = SbtCommunityProject(
707+
project = "libretto",
708+
sbtTestCommand = "core/test; examples/compile",
709+
sbtPublishCommand = "core/publishLocal; examples/publishLocal",
710+
dependencies = List(scalatest)
711+
)
712+
694713
end projects
695714

696715
def allProjects = List(
@@ -765,6 +784,7 @@ def allProjects = List(
765784
projects.munitCatsEffect,
766785
projects.scalacheckEffect,
767786
projects.fs2,
787+
projects.libretto,
768788
)
769789

770790
lazy val projectMap = allProjects.groupBy(_.project)

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class CommunityBuildTestC extends CommunityBuildTest:
144144
@Test def fastparse = projects.fastparse.run()
145145
@Test def geny = projects.geny.run()
146146
@Test def intent = projects.intent.run()
147+
@Test def libretto = projects.libretto.run()
147148
@Test def minitest = projects.minitest.run()
148149
@Test def onnxScala = projects.onnxScala.run()
149150
@Test def oslib = projects.oslib.run()

compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ import dotty.tools.dotc.core.Names.Name
2121
import dotty.tools.dotc.core.NameKinds.ExpandedName
2222
import dotty.tools.dotc.core.Signature
2323
import dotty.tools.dotc.core.StdNames._
24+
import dotty.tools.dotc.core.NameKinds
2425
import dotty.tools.dotc.core.Symbols._
2526
import dotty.tools.dotc.core.Types
2627
import dotty.tools.dotc.core.Types._
2728
import dotty.tools.dotc.core.TypeErasure
2829
import dotty.tools.dotc.transform.GenericSignatures
30+
import dotty.tools.dotc.transform.ElimErasedValueType
2931
import dotty.tools.io.AbstractFile
3032
import dotty.tools.dotc.report
3133

@@ -506,7 +508,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
506508
*
507509
* must-single-thread
508510
*/
509-
private def addForwarder(jclass: asm.ClassVisitor, module: Symbol, m: Symbol): Unit = {
511+
private def addForwarder(jclass: asm.ClassVisitor, module: Symbol, m: Symbol, isSynthetic: Boolean): Unit = {
510512
val moduleName = internalName(module)
511513
val methodInfo = module.thisType.memberInfo(m)
512514
val paramJavaTypes: List[BType] = methodInfo.firstParamTypes map toTypeKind
@@ -517,9 +519,10 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
517519
* and we don't know what classes might be subclassing the companion class. See SI-4827.
518520
*/
519521
// TODO: evaluate the other flags we might be dropping on the floor here.
520-
// TODO: ACC_SYNTHETIC ?
521522
val flags = GenBCodeOps.PublicStatic | (
522523
if (m.is(JavaVarargs)) asm.Opcodes.ACC_VARARGS else 0
524+
) | (
525+
if (isSynthetic) asm.Opcodes.ACC_SYNTHETIC else 0
523526
)
524527

525528
// TODO needed? for(ann <- m.annotations) { ann.symbol.initialize }
@@ -594,7 +597,16 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
594597
report.log(s"No forwarder for non-public member $m")
595598
else {
596599
report.log(s"Adding static forwarder for '$m' from $jclassName to '$moduleClass'")
597-
addForwarder(jclass, moduleClass, m)
600+
// It would be simpler to not generate forwarders for these methods,
601+
// but that wouldn't be binary-compatible with Scala 3.0.0, so instead
602+
// we generate ACC_SYNTHETIC forwarders so Java compilers ignore them.
603+
val isSynthetic =
604+
m0.name.is(NameKinds.SyntheticSetterName) ||
605+
// Only hide bridges generated at Erasure, mixin forwarders are also
606+
// marked as bridge but shouldn't be hidden since they don't have a
607+
// non-bridge overload.
608+
m0.is(Bridge) && m0.initial.validFor.firstPhaseId == erasurePhase.next.id
609+
addForwarder(jclass, moduleClass, m, isSynthetic)
598610
}
599611
}
600612
}
@@ -926,7 +938,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
926938
// (one that doesn't erase to the actual signature). See run/t3452b for a test case.
927939

928940
val memberTpe = atPhase(erasurePhase) { moduleClass.denot.thisType.memberInfo(sym) }
929-
val erasedMemberType = TypeErasure.fullErasure(memberTpe)
941+
val erasedMemberType = ElimErasedValueType.elimEVT(TypeErasure.transformInfo(sym, memberTpe))
930942
if (erasedMemberType =:= sym.denot.info)
931943
getGenericSignatureHelper(sym, moduleClass, memberTpe).orNull
932944
else null

compiler/src/dotty/tools/backend/jvm/BTypesFromSymbols.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import dotty.tools.dotc.core.Phases._
1313
import dotty.tools.dotc.core.Symbols._
1414
import dotty.tools.dotc.core.Phases.Phase
1515
import dotty.tools.dotc.transform.SymUtils._
16-
import dotty.tools.dotc.util.WeakHashSet
1716

1817
/**
1918
* This class mainly contains the method classBTypeFromSymbol, which extracts the necessary
@@ -49,7 +48,6 @@ class BTypesFromSymbols[I <: DottyBackendInterface](val int: I) extends BTypes {
4948
def newAnyRefMap[K <: AnyRef, V](): mutable.AnyRefMap[K, V] = new mutable.AnyRefMap[K, V]()
5049
def newWeakMap[K, V](): mutable.WeakHashMap[K, V] = new mutable.WeakHashMap[K, V]()
5150
def recordCache[T <: Clearable](cache: T): T = cache
52-
def newWeakSet[K >: Null <: AnyRef](): WeakHashSet[K] = new WeakHashSet[K]()
5351
def newMap[K, V](): mutable.HashMap[K, V] = new mutable.HashMap[K, V]()
5452
def newSet[K](): mutable.Set[K] = new mutable.HashSet[K]
5553
}
@@ -60,7 +58,6 @@ class BTypesFromSymbols[I <: DottyBackendInterface](val int: I) extends BTypes {
6058
def newWeakMap[K, V](): collection.mutable.WeakHashMap[K, V]
6159
def newMap[K, V](): collection.mutable.HashMap[K, V]
6260
def newSet[K](): collection.mutable.Set[K]
63-
def newWeakSet[K >: Null <: AnyRef](): dotty.tools.dotc.util.WeakHashSet[K]
6461
def newAnyRefMap[K <: AnyRef, V](): collection.mutable.AnyRefMap[K, V]
6562
}
6663

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import scala.annotation.threadUnsafe
1212
import scala.collection.generic.Clearable
1313
import scala.collection.mutable
1414
import scala.reflect.ClassTag
15-
import dotty.tools.dotc.util.WeakHashSet
1615
import dotty.tools.io.AbstractFile
1716
import scala.tools.asm.AnnotationVisitor
1817
import dotty.tools.dotc.core._

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Decorators._
1818
import Flags._
1919
import dotty.tools.dotc.ast.Trees._
2020
import Names._
21+
import NameKinds.DefaultGetterName
2122
import Types._
2223
import Symbols._
2324
import Denotations._
@@ -1069,6 +1070,14 @@ class JSCodeGen()(using genCtx: Context) {
10691070
} else if (sym.isJSNativeCtorDefaultParam) {
10701071
// #11592
10711072
None
1073+
} else if (sym.is(Bridge) && sym.name.is(DefaultGetterName) && currentClassSym.isNonNativeJSClass) {
1074+
/* #12572 Bridges for default accessors in non-native JS classes must not be emitted,
1075+
* because they call another default accessor, making their entire body an
1076+
* <undefined-param> that cannot be eliminated.
1077+
* Such methods are never called anyway, because they are filtered out in
1078+
* JSExportsGen.defaultGetterDenot().
1079+
*/
1080+
None
10721081
} else /*if (sym.isClassConstructor && isHijackedBoxedClass(sym.owner)) {
10731082
None
10741083
} else*/ {

compiler/src/dotty/tools/backend/sjs/JSExportsGen.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ final class JSExportsGen(jsCodeGen: JSCodeGen)(using Context) {
774774
else sym.owner
775775

776776
private def defaultGetterDenot(targetSym: Symbol, sym: Symbol, paramIndex: Int): Denotation =
777-
targetSym.info.member(DefaultGetterName(sym.name.asTermName, paramIndex))
777+
targetSym.info.memberBasedOnFlags(DefaultGetterName(sym.name.asTermName, paramIndex), excluded = Bridge)
778778

779779
private def defaultGetterDenot(sym: Symbol, paramIndex: Int): Denotation =
780780
defaultGetterDenot(targetSymForDefaultGetter(sym), sym, paramIndex)

compiler/src/dotty/tools/dotc/CompilationUnit.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class CompilationUnit protected (val source: SourceFile) {
6666
def isSuspendable: Boolean = true
6767

6868
/** Suspends the compilation unit by thowing a SuspendException
69-
* and recoring the suspended compilation unit
69+
* and recording the suspended compilation unit
7070
*/
7171
def suspend()(using Context): Nothing =
7272
assert(isSuspendable)

compiler/src/dotty/tools/dotc/ast/Positioned.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class Positioned(implicit @constructorOnly src: SourceFile) extends Src
3636
ids.put(this, ownId)
3737
if ownId == debugId then
3838
println(s"Debug tree (id=$debugId) creation \n$this\n")
39-
Reporter.displayPrompt(Console.in, new PrintWriter(Console.err, true))
39+
Thread.dumpStack()
4040

4141
allocateId()
4242

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,10 +699,12 @@ object Trees {
699699
s"TypeTree${if (hasType) s"[$typeOpt]" else ""}"
700700
}
701701

702-
/** A type tree that defines a new type variable. Its type is always a TypeVar.
703-
* Every TypeVar is created as the type of one TypeVarBinder.
702+
/** A type tree whose type is inferred. These trees appear in two contexts
703+
* - as an argument of a TypeApply. In that case its type is always a TypeVar
704+
* - as a (result-)type of an inferred ValDef or DefDef.
705+
* Every TypeVar is created as the type of one InferredTypeTree.
704706
*/
705-
class TypeVarBinder[-T >: Untyped](implicit @constructorOnly src: SourceFile) extends TypeTree[T]
707+
class InferredTypeTree[-T >: Untyped](implicit @constructorOnly src: SourceFile) extends TypeTree[T]
706708

707709
/** ref.type */
708710
case class SingletonTypeTree[-T >: Untyped] private[ast] (ref: Tree[T])(implicit @constructorOnly src: SourceFile)
@@ -1079,6 +1081,7 @@ object Trees {
10791081
type JavaSeqLiteral = Trees.JavaSeqLiteral[T]
10801082
type Inlined = Trees.Inlined[T]
10811083
type TypeTree = Trees.TypeTree[T]
1084+
type InferredTypeTree = Trees.InferredTypeTree[T]
10821085
type SingletonTypeTree = Trees.SingletonTypeTree[T]
10831086
type RefinedTypeTree = Trees.RefinedTypeTree[T]
10841087
type AppliedTypeTree = Trees.AppliedTypeTree[T]

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -963,8 +963,10 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
963963

964964
/** `tree.isInstanceOf[tp]`, with special treatment of singleton types */
965965
def isInstance(tp: Type)(using Context): Tree = tp.dealias match {
966+
case ConstantType(c) if c.tag == StringTag =>
967+
singleton(tp).equal(tree)
966968
case tp: SingletonType =>
967-
if (tp.widen.derivesFrom(defn.ObjectClass))
969+
if tp.widen.derivesFrom(defn.ObjectClass) then
968970
tree.ensureConforms(defn.ObjectType).select(defn.Object_eq).appliedTo(singleton(tp))
969971
else
970972
singleton(tp).equal(tree)
@@ -979,11 +981,13 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
979981
}
980982

981983
/** cast tree to `tp`, assuming no exception is raised, i.e the operation is pure */
982-
def cast(tp: Type)(using Context): Tree = {
983-
assert(tp.isValueType, i"bad cast: $tree.asInstanceOf[$tp]")
984+
def cast(tp: Type)(using Context): Tree = cast(TypeTree(tp))
985+
986+
/** cast tree to `tp`, assuming no exception is raised, i.e the operation is pure */
987+
def cast(tpt: TypeTree)(using Context): Tree =
988+
assert(tpt.tpe.isValueType, i"bad cast: $tree.asInstanceOf[$tpt]")
984989
tree.select(if (ctx.erasedTypes) defn.Any_asInstanceOf else defn.Any_typeCast)
985-
.appliedToType(tp)
986-
}
990+
.appliedToTypeTree(tpt)
987991

988992
/** cast `tree` to `tp` (or its box/unbox/cast equivalent when after
989993
* erasure and value and non-value types are mixed),

compiler/src/dotty/tools/dotc/config/CliCommand.scala

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import Settings._
77
import core.Contexts._
88
import Properties._
99

10-
import scala.collection.JavaConverters._
10+
import scala.PartialFunction.cond
11+
import scala.collection.JavaConverters._
1112

1213
trait CliCommand:
1314

@@ -107,7 +108,7 @@ trait CliCommand:
107108
// For now, skip the default values that do not make sense for the end user.
108109
// For example 'false' for the version command.
109110
""
110-
s"${formatName(s.name)} ${formatDescription(s.description)}${formatSetting("Default", defaultValue)}${formatSetting("Choices", s.legalChoices)}"
111+
s"${formatName(s.name)} ${formatDescription(shortHelp(s))}${formatSetting("Default", defaultValue)}${formatSetting("Choices", s.legalChoices)}"
111112
ss.map(helpStr).mkString("", "\n", s"\n${formatName("@<file>")} ${formatDescription("A text file containing compiler arguments (options and source files).")}\n")
112113
end availableOptionsMsg
113114

@@ -123,15 +124,30 @@ trait CliCommand:
123124
prefix + "\n" + availableOptionsMsg(cond)
124125

125126
protected def isStandard(s: Setting[?])(using settings: ConcreteSettings)(using SettingsState): Boolean =
126-
!isAdvanced(s) && !isPrivate(s)
127+
!isVerbose(s) && !isWarning(s) && !isAdvanced(s) && !isPrivate(s) || s.name == "-Werror" || s.name == "-Wconf"
128+
protected def isVerbose(s: Setting[?])(using settings: ConcreteSettings)(using SettingsState): Boolean =
129+
s.name.startsWith("-V") && s.name != "-V"
130+
protected def isWarning(s: Setting[?])(using settings: ConcreteSettings)(using SettingsState): Boolean =
131+
s.name.startsWith("-W") && s.name != "-W" || s.name == "-Xlint"
127132
protected def isAdvanced(s: Setting[?])(using settings: ConcreteSettings)(using SettingsState): Boolean =
128133
s.name.startsWith("-X") && s.name != "-X"
129134
protected def isPrivate(s: Setting[?])(using settings: ConcreteSettings)(using SettingsState): Boolean =
130135
s.name.startsWith("-Y") && s.name != "-Y"
136+
protected def shortHelp(s: Setting[?])(using settings: ConcreteSettings)(using SettingsState): String =
137+
s.description.linesIterator.next()
138+
protected def isHelping(s: Setting[?])(using settings: ConcreteSettings)(using SettingsState): Boolean =
139+
cond(s.value) {
140+
case ss: List[?] if s.isMultivalue => ss.contains("help")
141+
case s: String => "help" == s
142+
}
131143

132144
/** Messages explaining usage and options */
133145
protected def usageMessage(using settings: ConcreteSettings)(using SettingsState) =
134146
createUsageMsg("where possible standard", shouldExplain = false, isStandard)
147+
protected def vusageMessage(using settings: ConcreteSettings)(using SettingsState) =
148+
createUsageMsg("Possible verbose", shouldExplain = true, isVerbose)
149+
protected def wusageMessage(using settings: ConcreteSettings)(using SettingsState) =
150+
createUsageMsg("Possible warning", shouldExplain = true, isWarning)
135151
protected def xusageMessage(using settings: ConcreteSettings)(using SettingsState) =
136152
createUsageMsg("Possible advanced", shouldExplain = true, isAdvanced)
137153
protected def yusageMessage(using settings: ConcreteSettings)(using SettingsState) =

compiler/src/dotty/tools/dotc/config/CompilerCommand.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ abstract class CompilerCommand extends CliCommand:
1414

1515
final def helpMsg(using settings: ScalaSettings)(using SettingsState, Context): String =
1616
if (settings.help.value) usageMessage
17+
else if (settings.Vhelp.value) vusageMessage
18+
else if (settings.Whelp.value) wusageMessage
1719
else if (settings.Xhelp.value) xusageMessage
1820
else if (settings.Yhelp.value) yusageMessage
1921
else if (settings.showPlugins.value) ctx.base.pluginDescriptions
2022
else if (settings.XshowPhases.value) phasesMessage
2123
else ""
2224

2325
final def isHelpFlag(using settings: ScalaSettings)(using SettingsState): Boolean =
24-
Set(settings.help, settings.Xhelp, settings.Yhelp, settings.showPlugins, settings.XshowPhases) exists (_.value)
26+
import settings._
27+
val flags = Set(help, Vhelp, Whelp, Xhelp, Yhelp, showPlugins, XshowPhases)
28+
flags.exists(_.value) || allSettings.exists(isHelping)

compiler/src/dotty/tools/dotc/config/Config.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ object Config {
2424
inline val checkConstraintsNonCyclic = false
2525

2626
/** Check that each constraint resulting from a subtype test
27-
* is satisfiable.
27+
* is satisfiable. Also check that a type variable instantiation
28+
* satisfies its constraints.
29+
* Note that this can fail when bad bounds are in scope, like in
30+
* tests/neg/i4721a.scala.
2831
*/
2932
inline val checkConstraintsSatisfiable = false
3033

@@ -34,6 +37,9 @@ object Config {
3437
*/
3538
inline val checkConstraintsPropagated = false
3639

40+
/** Check that constraint bounds do not contain wildcard types */
41+
inline val checkNoWildcardsInConstraint = false
42+
3743
/** If a constraint is over a type lambda `tl` and `tvar` is one of
3844
* the type variables associated with `tl` in the constraint, check
3945
* that the origin of `tvar` is a parameter of `tl`.

0 commit comments

Comments
 (0)