File: tmetaobjectfields.nim

package info (click to toggle)
nim 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,911,644 kB
  • sloc: sh: 24,603; ansic: 1,761; python: 1,492; makefile: 1,013; sql: 298; asm: 141; xml: 13
file content (75 lines) | stat: -rw-r--r-- 1,680 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
discard """
  cmd: "nim check --hints:off $file"
  action: "reject"
  nimout: '''
tmetaobjectfields.nim(26, 5) Error: 'array' is not a concrete type
tmetaobjectfields.nim(30, 5) Error: 'seq' is not a concrete type
tmetaobjectfields.nim(34, 5) Error: 'set' is not a concrete type
tmetaobjectfields.nim(37, 3) Error: 'sink' is not a concrete type
tmetaobjectfields.nim(39, 3) Error: 'lent' is not a concrete type
tmetaobjectfields.nim(56, 16) Error: 'seq' is not a concrete type
tmetaobjectfields.nim(60, 5) Error: 'ptr' is not a concrete type
tmetaobjectfields.nim(61, 5) Error: 'ref' is not a concrete type
tmetaobjectfields.nim(62, 5) Error: 'auto' is not a concrete type
tmetaobjectfields.nim(63, 5) Error: 'UncheckedArray' is not a concrete type
tmetaobjectfields.nim(68, 5) Error: 'object' is not a concrete type
tmetaobjectfields.nim(72, 5) Error: 'Type3011:ObjectType' is not a concrete type
'''
"""


# bug #6982
# bug #19546
# bug #23531
type
  ExampleObj1 = object
    arr: array

type
  ExampleObj2 = object
    arr: seq

type
  ExampleObj3 = object
    arr: set

type A = object
  b: sink
  # a: openarray
  c: lent

type PropertyKind = enum
  tInt,
  tFloat,
  tBool,
  tString,
  tArray

type
  Property = ref PropertyObj
  PropertyObj = object
    case kind: PropertyKind
    of tInt: intValue: int
    of tFloat: floatValue: float
    of tBool: boolValue: bool
    of tString: stringValue: string
    of tArray: arrayValue: seq

type
  RegressionTest = object
    a: ptr
    b: ref
    c: auto
    d: UncheckedArray

# bug #3011
type
  Type3011 = ref object 
    context: ref object

type
  Value3011 = ref object
    typ: Type3011

proc x3011(): Value3011 =
  nil