diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index d75afc330f5f..c782c78f8eb7 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -82,6 +82,7 @@ class CompilationTests { compileFile("tests/rewrites/i11895.scala", defaultOptions.and("-indent", "-rewrite")), compileFile("tests/rewrites/i12340.scala", unindentOptions.and("-rewrite")), compileFile("tests/rewrites/i17187.scala", unindentOptions.and("-rewrite")), + compileFile("tests/rewrites/i17399.scala", unindentOptions.and("-rewrite")), ).checkRewrites() } diff --git a/tests/rewrites/i17399.check b/tests/rewrites/i17399.check new file mode 100644 index 000000000000..0b7eef78db4f --- /dev/null +++ b/tests/rewrites/i17399.check @@ -0,0 +1,7 @@ +def test[T](body:T):T = body + +object Test { + test { + println("test 1") + } +} diff --git a/tests/rewrites/i17399.scala b/tests/rewrites/i17399.scala new file mode 100644 index 000000000000..965d17c4f718 --- /dev/null +++ b/tests/rewrites/i17399.scala @@ -0,0 +1,5 @@ +def test[T](body:T):T = body + +object Test: + test: + println("test 1")