aboutsummaryrefslogtreecommitdiff
path: root/tests/repl/overrides.check
blob: 0fbd3d0e3a4ee89f94b863d2c263b30f7c2ce4ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
scala> class B { override def foo(i: Int): Unit = {}; }
-- [E036] Reference Error: <console> -------------------------------------------
4 |class B { override def foo(i: Int): Unit = {}; }
  |                       ^
  |                       method foo overrides nothing

longer explanation available when compiling with `-explain`
scala> class A { def foo: Unit = {}; }
defined class A
scala> class B extends A { override def foo(i: Int): Unit = {}; }
-- [E037] Reference Error: <console> -------------------------------------------
5 |class B extends A { override def foo(i: Int): Unit = {}; }
  |                                 ^
  |      method foo has a different signature than the overridden declaration

longer explanation available when compiling with `-explain`
scala> :quit