summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/sigmatch.nim2
-rw-r--r--tests/ccgbugs/tnil_type.nim13
2 files changed, 11 insertions, 4 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 154d76209..07ed5c3bc 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -340,8 +340,6 @@ proc typeRel*(c: var TCandidate, f, aOrig: PType,
 
 proc concreteType(c: TCandidate, t: PType; f: PType = nil): PType =
   case t.kind
-  of tyNil:
-    result = nil              # what should it be?
   of tyTypeDesc:
     if c.isNoCall: result = t
     else: result = nil
diff --git a/tests/ccgbugs/tnil_type.nim b/tests/ccgbugs/tnil_type.nim
index 44ecf1cc9..b57e64513 100644
--- a/tests/ccgbugs/tnil_type.nim
+++ b/tests/ccgbugs/tnil_type.nim
@@ -2,5 +2,14 @@ discard """
   targets: "c cpp"
 """
 
-proc foo(v: type(nil)) = discard
-foo nil
+proc f1(v: typeof(nil)) = discard
+f1(nil)
+
+proc f2[T]() = discard
+f2[typeof(nil)]()
+
+proc f3(_: typedesc) = discard
+f3(typeof(nil))
+
+proc f4[T](_: T) = discard
+f4(nil)
\ No newline at end of file
4373af8'>0d52962 ^
188bbc7 ^
0d52962 ^
2381f7b ^

0d52962 ^

0d52962 ^








0d52962 ^



007b965 ^
0d52962 ^

007b965 ^
0d52962 ^

007b965 ^
0d52962 ^



1bdb931 ^
e2696fc ^
188bbc7 ^
1bdb931 ^
a655c21 ^


1bdb931 ^



a655c21 ^
95d88a8 ^
1bdb931 ^
a655c21 ^
3850fba ^
95d88a8 ^
3850fba ^
e2696fc ^
1bdb931 ^


2ae9cac ^
9656e13 ^
69c88da ^
3114176 ^
0d52962 ^
188bbc7 ^
9d792a2 ^

0d52962 ^

f2299cb ^

0d52962 ^

188bbc7 ^




0d52962 ^







a655c21 ^

0d52962 ^
a655c21 ^
0d52962 ^
007b965 ^
a655c21 ^
0d52962 ^
a655c21 ^
0d52962 ^
a655c21 ^
e77157d ^
0d52962 ^
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107