Skip to content

Commit d85d8a9

Browse files
vjhaanpaavtjnashViralBShah
authored
Fixed the compiler.jl and inlining algorithm demos in documentation (#34869)
* Fixed the demo of compiler.jl to avoid MethodError Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com>
1 parent 6a9ced3 commit d85d8a9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

doc/src/devdocs/inference.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ mths = methods(convert, atypes) # worth checking that there is only one
3434
m = first(mths)
3535

3636
# Create variables needed to call `typeinf_code`
37-
params = Core.Compiler.Params(typemax(UInt)) # parameter is the world age,
38-
# typemax(UInt) -> most recent
39-
sparams = Core.svec() # this particular method doesn't have type-parameters
40-
optimize = true # run all inference optimizations
41-
types = Tuple{typeof(convert), atypes.parameters...} # Tuple{typeof(convert), Type{Int}, UInt}
42-
Core.Compiler.typeinf_code(m, types, sparams, optimize, params)
37+
params = Core.Compiler.Params(Base.get_world_counter()) # parameter is the world age,
38+
sparams = Core.svec(Int64) # this particular method has a type-parameter
39+
optimize = true # run all inference optimizations
40+
Core.Compiler.typeinf_code(m, atypes, sparams, optimize, params)
4341
```
4442

4543
If your debugging adventures require a `MethodInstance`, you can look it up by

0 commit comments

Comments
 (0)