diff options
author | Paul Phillips <paulp@improving.org> | 2013-04-23 13:26:21 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-04-23 19:42:57 -0700 |
commit | cf93e02b6216b96d302f3430919a921f11f0c55a (patch) | |
tree | 04353966c5626a689f4e76e089316518f50e06c1 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | fe8280c020eab60a7f94cb1faa50ba412635caea (diff) | |
download | scala-cf93e02b6216b96d302f3430919a921f11f0c55a.tar.gz scala-cf93e02b6216b96d302f3430919a921f11f0c55a.tar.bz2 scala-cf93e02b6216b96d302f3430919a921f11f0c55a.zip |
Added ensureFullyDefined.
Obvious fusion of "isFullyDefined" and "makeFullyDefined".
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 60b6248a07..acc6243599 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3403,8 +3403,7 @@ trait Typers extends Adaptations with Tags { if (formals == null) duplErrorTree(WrongNumberOfArgsError(tree, fun)) else { val args1 = typedArgs(args, mode, formals, formalsExpanded) - val pt1 = if (isFullyDefined(pt)) pt else makeFullyDefined(pt) // SI-1048 - + val pt1 = ensureFullyDefined(pt) // SI-1048 val itype = glb(List(pt1, arg.tpe)) arg setType pt1 // restore type (arg is a dummy tree, just needs to pass typechecking) val unapply = UnApply(fun1, args1) setPos tree.pos setType itype @@ -5028,9 +5027,8 @@ trait Typers extends Adaptations with Tags { if (isPatternMode) { val uncheckedTypeExtractor = extractorForUncheckedType(tpt.pos, tptTyped.tpe) - // make fully defined to avoid bounded wildcard types that may be in pt from calling dropExistential (SI-2038) - val ptDefined = if (isFullyDefined(pt)) pt else makeFullyDefined(pt) + val ptDefined = ensureFullyDefined(pt) val ownType = inferTypedPattern(tptTyped, tptTyped.tpe, ptDefined, canRemedy = uncheckedTypeExtractor.nonEmpty) treeTyped setType ownType |