File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
compiler/test/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ class CompilationTests extends ParallelTesting {
182182 compileFile(" ../tests/neg/tailcall/tailrec.scala" , defaultOptions) +
183183 compileFile(" ../tests/neg/tailcall/tailrec-2.scala" , defaultOptions) +
184184 compileFile(" ../tests/neg/tailcall/tailrec-3.scala" , defaultOptions) +
185+ compileFile(" ../tests/neg/i3246.scala" , scala2Mode) +
185186 compileDir(" ../tests/neg/typedIdents" , defaultOptions)
186187 }.checkExpectedErrors()
187188
Original file line number Diff line number Diff line change 11class Test {
22 def foo (x : Int ) = 1
3- val bar : () => Int = foo _
3+ val bar : () => Int = foo _ // error: type mismatch
44}
Original file line number Diff line number Diff line change @@ -4,4 +4,8 @@ class Test {
44 def baz = 1
55 def bam : () => Int = baz _
66 def ban : () => Int = 1 _
7+
8+ def titi (fun : () => Unit ) = ???
9+ def toto (fun : => Int ) = titi(fun _)
10+ titi(1 _) // rejected by scalac
711}
You can’t perform that action at this time.
0 commit comments