Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ object SymDenotations {
*/
private def companionNamed(name: TypeName)(implicit ctx: Context): Symbol =
if (owner.isClass)
owner.info.decl(name).suchThat(_.isCoDefinedWith(symbol)).symbol
owner.info.decl(name).suchThat(x => x.isCoDefinedWith(symbol) && x.isClass && x.symbol.isClass).symbol
else if (!owner.exists || ctx.compilationUnit == null)
NoSymbol
else if (!ctx.compilationUnit.tpdTree.isEmpty)
Expand Down
7 changes: 0 additions & 7 deletions src/dotty/tools/dotc/core/Symbols.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ trait Symbols { this: Context =>

// ---- Symbol creation methods ----------------------------------

/** Create a symbol from a function producing its denotation */
def newSymbolDenoting[N <: Name](denotFn: Symbol => SymDenotation, coord: Coord = NoCoord): Symbol { type ThisName = N } = {
val sym = newNakedSymbol[N](coord)
sym.denot = denotFn(sym)
sym
}

/** Create a symbol from its fields (info may be lazy) */
def newSymbol[N <: Name](
owner: Symbol,
Expand Down
1 change: 1 addition & 0 deletions test/dotc/tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class tests extends CompilerTest {
@Test def pos_packageObj = compileFile(posDir, "i0239", twice)
@Test def pos_anonClassSubtyping = compileFile(posDir, "anonClassSubtyping", twice)
@Test def pos_extmethods = compileFile(posDir, "extmethods", twice)
@Test def pos_companions = compileFile(posDir, "companions", twice)

@Test def pos_all = compileFiles(posDir) // twice omitted to make tests run faster

Expand Down