File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/compiler/scala/tools/nsc/typechecker Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -2711,11 +2711,6 @@ trait Typers extends Modes with Adaptations with Tags {
2711
2711
val stats = templ.body
2712
2712
namer.enterSyms(stats)
2713
2713
2714
- // This is also checked later in typedStats, but that is too late for SI-5361, so
2715
- // we eagerly check this here.
2716
- for (stat <- stats if ! treeInfo.isDeclarationOrTypeDef(stat))
2717
- OnlyDeclarationsError (stat)
2718
-
2719
2714
// need to delay rest of typedRefinement to avoid cyclic reference errors
2720
2715
unit.toCheck += { () =>
2721
2716
val stats1 = typedStats(stats, NoSymbol )
@@ -5067,7 +5062,13 @@ trait Typers extends Modes with Adaptations with Tags {
5067
5062
def typedCompoundTypeTree (tree : CompoundTypeTree ) = {
5068
5063
val templ = tree.templ
5069
5064
val parents1 = templ.parents mapConserve (typedType(_, mode))
5070
- if (parents1 exists (_.isErrorTyped)) tree setType ErrorType
5065
+
5066
+ // This is also checked later in typedStats, but that is too late for SI-5361, so
5067
+ // we eagerly check this here.
5068
+ for (stat <- templ.body if ! treeInfo.isDeclarationOrTypeDef(stat))
5069
+ OnlyDeclarationsError (stat)
5070
+
5071
+ if ((parents1 ++ templ.body) exists (_.isErrorTyped)) tree setType ErrorType
5071
5072
else {
5072
5073
val decls = newScope
5073
5074
// Console.println("Owner: " + context.enclClass.owner + " " + context.enclClass.owner.id)
You can’t perform that action at this time.
0 commit comments