summary refs log tree commit diff stats
path: root/tests/effects/teffects9.nim
blob: d92668fe9ed6c15d05d79dfd32dbfd21a3fcb8d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
discard """
  errormsg: "can raise an unlisted exception: ref Exception"
  line: 16
"""

# bug #8481

type
  ParentObj = ref object of RootObj
  DerivedObj = ref object of ParentObj

method doSome(o: ParentObj) {.base, raises: [].} =
  discard

method doSome(o: DerivedObj) =
  raise newException(Exception, "oops, this raised")

proc thisRaises() {.raises: [].} =
  let o = new(DerivedObj)
  o.doSome()

thisRaises()