Skip to content

Commit

Permalink
implement getfield overloading (#24960)
Browse files Browse the repository at this point in the history
New functions `Base.getproperty` and `Base.setproperty!`
can be overloaded to change the behavior of `x.p` and `x.p = v`,
respectively.

This forces inference constant propagation through get/setproperty,
since it is very likely this method will yield better information after specializing on the field name
(even if `convert` is too big to make us want to inline the generic version and trigger the heuristic normally).

closes #16195 (and thus also closes #16226)
fix #1974
  • Loading branch information
vtjnash committed Dec 18, 2017
1 parent 984e4c0 commit ca0410d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cluster.jl
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ function launch_n_additional_processes(manager, frompid, fromconfig, cnt, launch

wconfig = WorkerConfig()
for x in [:host, :tunnel, :sshflags, :exeflags, :exename, :enable_threaded_blas]
setfield!(wconfig, x, getfield(fromconfig, x))
Base.setproperty!(wconfig, x, Base.getproperty(fromconfig, x))
end
wconfig.bind_addr = bind_addr
wconfig.port = port
Expand Down

0 comments on commit ca0410d

Please sign in to comment.