Skip to content

Commit 474c002

Browse files
committed
Fix #2949: Change order of elaboration
Swap the order in which the constructor or a class is elaborated relative to indexing the class contents. The change indexes first, which fixes #2949.
1 parent 972f6d5 commit 474c002

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,9 +909,9 @@ class Namer { typer: Typer =>
909909
// the parent types are elaborated.
910910
index(constr)
911911
annotate(constr :: params)
912-
symbolOfTree(constr).ensureCompleted()
913912

914913
indexAndAnnotate(rest)(inClassContext(selfInfo))
914+
symbolOfTree(constr).ensureCompleted()
915915

916916
val parentTypes = ensureFirstIsClass(parents.map(checkedParentType(_)))
917917
val parentRefs = ctx.normalizeToClassRefs(parentTypes, cls, decls)

0 commit comments

Comments
 (0)