Skip to content

Commit

Permalink
Only check explicitly given type arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky committed Jul 2, 2022
1 parent 337dce8 commit e3a49c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/PostTyper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
val tree1 @ TypeApply(fn, args) = normalizeTypeArgs(tree)
for arg <- args do
checkInferredWellFormed(arg)
Checking.checkGoodBounds(arg.tpe, arg.srcPos)
if !arg.span.isZeroExtent then
// only check explicit type arguments. We rely on inferred type arguments
// to either have good bounds (if they come from a constraint), or be derived
// from values that recursively need to have good bounds.
Checking.checkGoodBounds(arg.tpe, arg.srcPos)
if (fn.symbol != defn.ChildAnnot.primaryConstructor)
// Make an exception for ChildAnnot, which should really have AnyKind bounds
Checking.checkBounds(args, fn.tpe.widen.asInstanceOf[PolyType])
Expand Down

0 comments on commit e3a49c2

Please sign in to comment.