summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2019-01-08 18:37:25 -0800
committerGitHub <noreply@github.com>2019-01-08 18:37:25 -0800
commit6ce3949c8aa489d268f272829d03edab175bfc7a (patch)
tree777513c9aef3896204b8dfd9cea40517d57d2ce7 /lib/pure
parentbf3a308e86e7c5999855546962aed564218a8121 (diff)
downloadNim-6ce3949c8aa489d268f272829d03edab175bfc7a.tar.gz
add `isNamedTuple`; make $(1, 2) be (1, 2) instead of (Field0: 1, Field1: 2) which leaked implementation detail (#10070)
* add `isNamedTuple`; make $(1, 2) be (1, 2) instead of leaking implementation detail (Field0: 1, Field1: 2)
  fixes this: #8670 (comment) /cc @alehander42 @Vindaar @mratsim

* Note: isNamedTuple is useful in other places, eg #10010 (comment)

* move isNamedTuple to helpers.nim to avoid exposing new symbol to system.nim

* remove workaround in tests/vm/tissues.nim failing test now that #10218 was makes it work
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/typetraits.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pure/typetraits.nim b/lib/pure/typetraits.nim
index 5f5bfdbd7..a373a9370 100644
--- a/lib/pure/typetraits.nim
+++ b/lib/pure/typetraits.nim
@@ -10,7 +10,10 @@
 ## This module defines compile-time reflection procs for
 ## working with types
 
+include "system/helpers" # for `isNamedTuple`
+
 export system.`$`
+export isNamedTuple
 
 proc name*(t: typedesc): string {.magic: "TypeTrait".}
   ## Alias for system.`$`(t) since Nim v0.20.0.
;vc@akkartik.com> 2015-02-19 23:49:13 -0800 committer Kartik K. Agaram <vc@akkartik.com> 2015-02-19 23:49:13 -0800 798 - start of record support' href='/akkartik/mu/commit/cpp/017and-record?h=hlt&id=b291f85b8d0ece9312b066a84cbeca1b367fe85f'>b291f85b ^
ab9e2eae ^
57699011 ^

916ae8f5 ^





f7051fad ^
916ae8f5 ^

3ba63579 ^
916ae8f5 ^

3ba63579 ^
916ae8f5 ^
c1297a36 ^
916ae8f5 ^
c82d0176 ^
3ba63579 ^
6cc46216 ^

e853b94e ^


6cc46216 ^
916ae8f5 ^
916ae8f5 ^


e853b94e ^
7da71d03 ^
e853b94e ^
916ae8f5 ^








ab9e2eae ^

916ae8f5 ^
6f5d7864 ^
916ae8f5 ^
916ae8f5 ^

ab9e2eae ^


57699011 ^
a4559f72 ^
3c435756 ^
6cc46216 ^



a3d9828c ^
6cc46216 ^





cc5805dc ^
6cc46216 ^





6f5d7864 ^
6cc46216 ^





57699011 ^
6cc46216 ^
a4559f72 ^




f7051fad ^
a4559f72 ^



3ba63579 ^
c1297a36 ^

a4559f72 ^
c82d0176 ^
3ba63579 ^
79f4349c ^

e853b94e ^


79f4349c ^
a4559f72 ^










ab9e2eae ^

a4559f72 ^
6f5d7864 ^
a4559f72 ^
a4559f72 ^

57699011 ^
62ed0e47 ^



















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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166