Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ object GenericSignatures {
foldOver(tp.typeParams.nonEmpty, parents)
case AnnotatedType(tpe, _) =>
foldOver(x, tpe)
case ExprType(tpe) =>
true
case tp =>
foldOver(x, tp)
}
Expand Down
18 changes: 17 additions & 1 deletion compiler/test/dotty/tools/backend/jvm/DottyBytecodeTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ class TestBCode extends DottyBytecodeTest {
}
}

@Test def byNameParameters = {
val source = """
|class Foo {
| def byNameParam(str: => String): Unit = {}
|}
""".stripMargin

checkBCode(source) { dir =>
val clsIn = dir.lookupName("Foo.class", directory = false).input
val clsNode = loadClassNode(clsIn)
val methodNode: MethodNode = getMethod(clsNode, "byNameParam")

assert(methodNode.signature == "(Lscala/Function0<Ljava/lang/String;>;)V")
}
}

/** This test verifies that simple matches are transformed if possible
* despite no annotation
*/
Expand Down Expand Up @@ -957,7 +973,7 @@ class TestBCode extends DottyBytecodeTest {

@Test
def invocationReceivers(): Unit = {
import Opcodes._
import Opcodes.*

checkBCode(List(invocationReceiversTestCode.definitions("Object"))) { dir =>
val c1 = loadClassNode(dir.lookupName("C1.class", directory = false).input)
Expand Down