Commit b5e0f6b
[Diagnostic] Support constructing Diagnostic Error through ObjectRef (#13977)
This PR supports creating a diagnostic error from an arbitrary Object.
Given that we are bringing the diagnostic error for general uses in the
long term, in which case
* not every Expr necessarily has a span,
* we have well-implemented elegant location-aware printer for an object
itself,
* we may need to print some object other than Expr, or does even not
have a span field,
we support diagnostic error with arbitrary object to denote the
location.
Co-authored-by: Tianqi Chen <[email protected]>1 parent b371c46 commit b5e0f6b
2 files changed
+56
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
| |||
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
87 | 107 | | |
88 | 108 | | |
89 | 109 | | |
| |||
102 | 122 | | |
103 | 123 | | |
104 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
105 | 130 | | |
106 | 131 | | |
107 | 132 | | |
| |||
115 | 140 | | |
116 | 141 | | |
117 | 142 | | |
| 143 | + | |
| 144 | + | |
118 | 145 | | |
119 | 146 | | |
120 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 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 | + | |
69 | 97 | | |
70 | 98 | | |
71 | 99 | | |
| |||
284 | 312 | | |
285 | 313 | | |
286 | 314 | | |
287 | | - | |
| 315 | + | |
288 | 316 | | |
289 | 317 | | |
290 | 318 | | |
| |||
0 commit comments