Created
February 15, 2018 00:51
-
-
Save anicholson/3df416e9bfec02e1085634dfe1c53d28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error in /Users/andy/projects/consider_crystal/macro.cr:6: expanding macro | |
JSON.mapping( | |
[32;1m^~~~~~~[0m | |
in /Users/andy/projects/consider_crystal/macro.cr:6: expanding macro | |
JSON.mapping( | |
[32;1m^[0m | |
in macro 'mapping' /usr/local/Cellar/crystal-lang/0.24.1_2/src/json/mapping.cr:219, line 1: | |
[32;1m>[0m[1m 1. ::JSON.mapping({lat: Float64, lng: Float642})[0m | |
2. | |
expanding macro | |
in macro 'mapping' /usr/local/Cellar/crystal-lang/0.24.1_2/src/json/mapping.cr:219, line 1: | |
[32;1m>[0m[1m 1. ::JSON.mapping({lat: Float64, lng: Float642})[0m | |
2. | |
expanding macro | |
in macro 'mapping' /usr/local/Cellar/crystal-lang/0.24.1_2/src/json/mapping.cr:63, line 24: | |
1. | |
2. | |
3. | |
4. | |
5. | |
6. | |
7. | |
8. @lat : Float64 | |
9. | |
10. | |
11. def lat=(_lat : Float64 ) | |
12. @lat = _lat | |
13. end | |
14. | |
15. | |
16. | |
17. def lat | |
18. @lat | |
19. end | |
20. | |
21. | |
22. | |
23. | |
[32;1m>[0m[1m 24. @lng : Float642 [0m | |
25. | |
26. | |
27. def lng=(_lng : Float642 ) | |
28. @lng = _lng | |
29. end | |
30. | |
31. | |
32. | |
33. def lng | |
34. @lng | |
35. end | |
36. | |
37. | |
38. | |
39. | |
40. | |
41. def initialize(__temp_23 : ::JSON::PullParser) | |
42. | |
43. __temp_24 = nil | |
44. __temp_25 = false | |
45. | |
46. __temp_26 = nil | |
47. __temp_27 = false | |
48. | |
49. | |
50. __temp_28 = __temp_23.location | |
51. __temp_23.read_begin_object | |
52. while __temp_23.kind != :end_object | |
53. __temp_29 = __temp_23.location | |
54. key = __temp_23.read_object_key | |
55. case key | |
56. | |
57. when "lat" | |
58. __temp_25 = true | |
59. | |
60. __temp_24 = | |
61. | |
62. | |
63. | |
64. | |
65. | |
66. Float64.new(__temp_23) | |
67. | |
68. | |
69. | |
70. | |
71. | |
72. | |
73. | |
74. when "lng" | |
75. __temp_27 = true | |
76. | |
77. __temp_26 = | |
78. | |
79. | |
80. | |
81. | |
82. | |
83. Float642.new(__temp_23) | |
84. | |
85. | |
86. | |
87. | |
88. | |
89. | |
90. | |
91. else | |
92. | |
93. __temp_23.skip | |
94. | |
95. end | |
96. end | |
97. __temp_23.read_next | |
98. | |
99. | |
100. | |
101. if __temp_24.nil? && !__temp_25 && !::Union(Float64).nilable? | |
102. raise ::JSON::ParseException.new("Missing json attribute: lat", *__temp_28) | |
103. end | |
104. | |
105. | |
106. | |
107. if __temp_26.nil? && !__temp_27 && !::Union(Float642).nilable? | |
108. raise ::JSON::ParseException.new("Missing json attribute: lng", *__temp_28) | |
109. end | |
110. | |
111. | |
112. | |
113. | |
114. | |
115. @lat = (__temp_24).as(Float64) | |
116. | |
117. | |
118. | |
119. @lng = (__temp_26).as(Float642) | |
120. | |
121. | |
122. | |
123. | |
124. | |
125. | |
126. | |
127. | |
128. end | |
129. | |
130. def to_json(json : ::JSON::Builder) | |
131. json.object do | |
132. | |
133. _lat = @lat | |
134. | |
135. | |
136. unless _lat.nil? | |
137. | |
138. | |
139. json.field("lat") do | |
140. | |
141. | |
142. | |
143. _lat.to_json(json) | |
144. | |
145. | |
146. | |
147. end | |
148. | |
149. | |
150. end | |
151. | |
152. | |
153. _lng = @lng | |
154. | |
155. | |
156. unless _lng.nil? | |
157. | |
158. | |
159. json.field("lng") do | |
160. | |
161. | |
162. | |
163. _lng.to_json(json) | |
164. | |
165. | |
166. | |
167. end | |
168. | |
169. | |
170. end | |
171. | |
172. | |
173. end | |
174. end | |
175. | |
[1mundefined constant Float642 [33;1m(did you mean 'Float64')[0m[0m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment