Skip to content

Commit d1d6c2e

Browse files
committed
Fix Tests and add bounds check for inlined functions
1 parent cabfa68 commit d1d6c2e

File tree

5 files changed

+8
-18
lines changed

5 files changed

+8
-18
lines changed

compiler/src/dotty/tools/dotc/transform/PostTyper.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
363363
case Inlined(call, bindings, expansion) if !call.isEmpty =>
364364
val pos = call.sourcePos
365365
CrossVersionChecks.checkExperimentalRef(call.symbol, pos)
366+
super.transform(call)
366367
val callTrace = Inlines.inlineCallTrace(call.symbol, pos)(using ctx.withSource(pos.source))
367368
cpy.Inlined(tree)(callTrace, transformSub(bindings), transform(expansion)(using inlineContext(call)))
368369
case templ: Template =>

tests/neg/i17168.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
type F[X <: String] = X
2+
3+
val a = summon[F[Int] =:= Int] // error

tests/pos/i13332super.scala

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/run/anon-mirror-gen-local.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Outer5 { self =>
5555
}
5656
}
5757

58-
lazy val o = new Outer5() // infinite init
58+
final lazy val o = new Outer5() // infinite init
5959

6060
}
6161

@@ -142,7 +142,7 @@ def locally3 = {
142142
class Bar extends Foo {
143143

144144
def hello =
145-
val mQux = summon[Mirror.Of[Bar.super.foo.type]]
145+
val mQux = summon[Mirror.Of[foo.type]]
146146
assert(mQux.fromProduct(EmptyTuple) == Qux)
147147
}
148148

@@ -157,4 +157,4 @@ def locally3 = {
157157
testOuter6
158158
locally1
159159
locally2
160-
locally3
160+
locally3

tests/run/i13332a.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class SubUniverse extends Universe {
150150

151151
trait Whole {
152152
trait MixinA {
153-
lazy val mixinB = new MixinB() {}
153+
final lazy val mixinB = new MixinB() {}
154154
}
155155
trait MixinB {
156156
object A extends MixinB { // by inheriting `MixinB`, we should not check for inheritance from the right

0 commit comments

Comments
 (0)