Skip to content

Commit 5c02f77

Browse files
committed
Expand criterion when to not check inferred types a bit
1 parent 2ed6754 commit 5c02f77

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ class CheckCaptures extends Recheck, SymTransformer:
894894

895895
def canUseInferred = // If canUseInferred is false, all capturing types in the type of `sym` need to be given explicitly
896896
sym.is(Private) // private symbols can always have inferred types
897+
|| sym.privateWithin == sym.effectiveOwner
897898
|| sym.name.is(DefaultGetterName) // default getters are exempted since otherwise it would be
898899
// too annoying. This is a hole since a defualt getter's result type
899900
// might leak into a type variable.

0 commit comments

Comments
 (0)