Skip to content

Commit c5b176f

Browse files
Use needsAccessor
1 parent f00cda8 commit c5b176f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ object Inliner {
144144
case _: Apply | _: TypeApply | _: RefTree if needsAccessor(tree.symbol) =>
145145
if (tree.isTerm) {
146146
val (methPart, targs, argss) = decomposeCall(tree)
147-
val mSym = methPart.symbol
148-
if (mSym.isConstructor && (mSym.is(Private) || mSym.privateWithin.exists)) {
147+
if (methPart.symbol.isConstructor && needsAccessor(methPart.symbol)) {
149148
ctx.error("Cannot use private constructors in inline methods", tree.pos)
150149
tree // TODO: create a proper accessor for the private constructor
151150
} else {

0 commit comments

Comments
 (0)