Commit b27e4ed
Canonicalize names of nested functions by keeping a more fine grained counter -- per (module, method name) pair (#53719)
As mentioned in #53716, we've
been noticing that `precompile` statements lists from one version of our
codebase often don't apply cleanly in a slightly different version.
That's because a lot of nested and anonymous function names have a
global numeric suffix which is incremented every time a new name is
generated, and these numeric suffixes are not very stable across
codebase changes.
To solve this, this PR makes the numeric suffixes a bit more fine
grained: every pair of (module, top-level/outermost function name) will
have its own counter, which should make nested function names a bit more
stable across different versions.
This PR applies @JeffBezanson's idea of making the symbol name changes
directly in `current-julia-module-counter`.
Here is an example:
```Julia
julia> function foo(x)
function bar(y)
return x + y
end
end
foo (generic function with 1 method)
julia> f = foo(42)
(::var"#bar#foo##0"{Int64}) (generic function with 1 method)
```1 parent 006f107 commit b27e4ed
File tree
7 files changed
+193
-48
lines changed- doc/src/manual
- src
- flisp
- test
7 files changed
+193
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
218 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
219 | 228 | | |
| 229 | + | |
220 | 230 | | |
221 | | - | |
222 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
223 | 259 | | |
224 | 260 | | |
225 | 261 | | |
| |||
252 | 288 | | |
253 | 289 | | |
254 | 290 | | |
255 | | - | |
| 291 | + | |
256 | 292 | | |
257 | 293 | | |
258 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 23 | | |
29 | 24 | | |
30 | 25 | | |
31 | 26 | | |
32 | 27 | | |
33 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
34 | 32 | | |
35 | | - | |
| 33 | + | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | | - | |
| 37 | + | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
0 commit comments