File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,8 @@ object Types {
305
305
that.existsPart(this == _)
306
306
307
307
/** Does this type not refer to TypeParamRefs or uninstantiated TypeVars? */
308
- final def isGround (implicit ctx : Context ): Boolean = true
308
+ final def isGround (implicit ctx : Context ): Boolean =
309
+ (new isGroundAccumulator).apply(true , this )
309
310
310
311
/** Is this a type of a repeated parameter? */
311
312
def isRepeatedParam (implicit ctx : Context ): Boolean =
@@ -3279,7 +3280,7 @@ object Types {
3279
3280
3280
3281
def isGround (acc : TypeAccumulator [Boolean ])(implicit ctx : Context ): Boolean = {
3281
3282
if (! isGroundKnown) {
3282
- isGroundCache = acc.foldOver(false , this )
3283
+ isGroundCache = acc.foldOver(true , this )
3283
3284
isGroundKnown = true
3284
3285
}
3285
3286
isGroundCache
@@ -4797,7 +4798,7 @@ object Types {
4797
4798
}
4798
4799
4799
4800
class isGroundAccumulator (implicit ctx : Context ) extends TypeAccumulator [Boolean ] {
4800
- def apply (x : Boolean , tp : Type ) = x || {
4801
+ def apply (x : Boolean , tp : Type ) = x && {
4801
4802
tp match {
4802
4803
case _ : TypeParamRef => false
4803
4804
case tp : TypeVar => apply(x, tp.underlying)
You can’t perform that action at this time.
0 commit comments