File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -1202,8 +1202,9 @@ object RefChecks {
12021202 /** Check that public (and protected) methods/fields do not expose flexible types. */
12031203 def checkPublicFlexibleTypes (sym : Symbol )(using Context ): Unit =
12041204 if ctx.explicitNulls && ! ctx.isJava
1205- && sym.exists && ! sym.is(Private ) && sym.owner.isClass
1206- && ! sym.isOneOf(Synthetic | InlineProxy | Param | Exported ) then
1205+ && sym.exists && sym.owner.isClass
1206+ && ! sym.owner.isAnonymousClass
1207+ && ! sym.isOneOf(JavaOrPrivateOrSynthetic | InlineProxy | Param | Exported ) then
12071208 val resTp = sym.info.finalResultType
12081209 if resTp.existsPart(_.isInstanceOf [FlexibleType ], StopAt .Static ) then
12091210 report.warning(
Original file line number Diff line number Diff line change 1+ //> using options -Yexplicit-nulls -Werror
2+
3+ trait AwtComponentLogging extends java.awt.Component :
4+
5+ override def getPreferredSize : java.awt.Dimension =
6+ val dim : java.awt.Dimension = super .getPreferredSize
7+ dim
8+
9+ private def superPS1 = super .getPreferredSize
10+
11+ private val superPS2 = super .getPreferredSize
12+
13+ class Test :
14+ def getCompoment : java.awt.Component =
15+ new java.awt.Component {
16+ override def getPreferredSize = super .getPreferredSize
17+ }
You can’t perform that action at this time.
0 commit comments