Skip to content

Commit 4d8fa6d

Browse files
committed
Fix type of outerSelect
Needs to be a TermType, or FirstTransform will replace it with a TypeTree.
1 parent 7bf86d2 commit 4d8fa6d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
826826
* @param tp The type of the destination of the outer path.
827827
*/
828828
def outerSelect(levels: Int, tp: Type)(implicit ctx: Context): Tree =
829-
untpd.Select(tree, OuterSelectName(EmptyTermName, levels)).withType(tp)
829+
untpd.Select(tree, OuterSelectName(EmptyTermName, levels)).withType(SkolemType(tp))
830830

831831
// --- Higher order traversal methods -------------------------------
832832

tests/pos/i3130d.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class D(x: Int) {
2+
class DD {
3+
inline def apply() = new DD()
4+
}
5+
val inner = new DD
6+
}
7+
object Test {
8+
new D(2).inner.apply()
9+
}

0 commit comments

Comments
 (0)