File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -458,15 +458,16 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
458
458
if (! sym.exists || (sym eq defn.LanguageModuleClass ) || (sym eq defn.Scala2LanguageModuleRef )) " "
459
459
else toPrefix(sym.owner) + sym.name + " ."
460
460
def featureName = toPrefix(owner) + feature
461
- def hasImport (implicit ctx : Context ): Boolean = (
462
- ctx.importInfo != null
463
- && ( (ctx.importInfo.site.widen.typeSymbol eq owner)
464
- && ctx.importInfo.originals.contains(feature)
465
- ||
466
- { var c = ctx.outer
467
- while (c.importInfo eq ctx.importInfo) c = c.outer
468
- hasImport(c)
469
- }))
461
+ def hasImport (implicit ctx : Context ): Boolean = {
462
+ if (ctx.importInfo == null || (ctx.importInfo.site.widen.typeSymbol ne owner)) false
463
+ else if (ctx.importInfo.excluded.contains(feature)) false
464
+ else if (ctx.importInfo.originals.contains(feature)) true
465
+ else {
466
+ var c = ctx.outer
467
+ while (c.importInfo eq ctx.importInfo) c = c.outer
468
+ hasImport(c)
469
+ }
470
+ }
470
471
def hasOption = ctx.base.settings.language.value exists (s => s == featureName || s == " _" )
471
472
hasImport(ctx.withPhase(ctx.typerPhase)) || hasOption
472
473
}
Original file line number Diff line number Diff line change 1
1
class Foo extends scala.Dynamic // error
2
2
trait Bar extends scala.Dynamic // error
3
3
object Baz extends scala.Dynamic // error
4
+
5
+ package A {
6
+ import scala .language .dynamics
7
+ package B {
8
+ import scala .language .{ dynamics => _ }
9
+ class Foo extends scala.Dynamic // error
10
+ trait Bar extends scala.Dynamic // error
11
+ object Baz extends scala.Dynamic // error
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments