Skip to content

Commit 42e8c0c

Browse files
dwijnandWojciechMazur
authored andcommitted
Parser simple expression error recovery change from null to ??? (#19103)
Previously, simpleExpr was recovered as `Literal(Constant(null))` which led to some errors in interactive. Type inference in Scala 3 works on whole chain, thus type vars were inferred as union type of `Null` because of this very reason. Recovering such errors as `unimplementedExpr` which has a type of `Nothing`, solves the issue.
1 parent ad05c50 commit 42e8c0c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,7 @@ class Definitions {
947947
def TupleXXLModule(using Context): Symbol = TupleXXLClass.companionModule
948948

949949
def TupleXXL_fromIterator(using Context): Symbol = TupleXXLModule.requiredMethod("fromIterator")
950+
def TupleXXL_unapplySeq(using Context): Symbol = TupleXXLModule.requiredMethod(nme.unapplySeq)
950951

951952
@tu lazy val RuntimeTupleMirrorTypeRef: TypeRef = requiredClassRef("scala.runtime.TupleMirror")
952953

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ object SpaceEngine {
838838
val tpw = tp.widen.dealias
839839
val classSym = tpw.classSymbol
840840
classSym.is(Sealed) && !tpw.isLargeGenericTuple || // exclude large generic tuples from exhaustivity
841+
// requires an unknown number of changes to make work
841842
tpw.isInstanceOf[OrType] ||
842843
(tpw.isInstanceOf[AndType] && {
843844
val and = tpw.asInstanceOf[AndType]

0 commit comments

Comments
 (0)