Skip to content

Commit ee42662

Browse files
Fix dependent6.scala
1 parent 629c40b commit ee42662

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
4646
ta.assignType(untpd.Apply(fn, args), fn, args)
4747
}
4848

49-
def TypeApply(fn: Tree, args: List[Tree])(implicit ctx: Context): TypeApply = {
50-
assert(fn.isInstanceOf[RefTree] || fn.isInstanceOf[GenericApply[_]])
49+
def TypeApply(fn: Tree, args: List[Tree])(implicit ctx: Context): TypeApply =
5150
ta.assignType(untpd.TypeApply(fn, args), fn, args)
52-
}
5351

5452
def Literal(const: Constant)(implicit ctx: Context): Literal =
5553
ta.assignType(untpd.Literal(const))

tests/pos/dependent6.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ object Foo {
33
dependent case object Nil extends List
44
dependent case class Cons(head: Int, tail: List) extends List
55

6-
76
dependent def cons1 =
87
Cons(1, Cons(2, Nil)) match {
98
case Cons(x, _) => x
@@ -40,11 +39,10 @@ object Foo {
4039
cons4: 2
4140
cons5: {Nil}
4241

43-
4442
case class Some(x: Some)
4543

4644
dependent def bla =
4745
(??? : Some) match {
4846
case Some(Some(x)) => x
4947
}
50-
}
48+
}

0 commit comments

Comments
 (0)