Repository navigation
Conversation
With a Vector{Function}, the replaced names are inferred as Any so the renaming
of duplicate names is dynamically dispatched, which a trimmed binary may not
contain. The default is now an empty tuple, with which names are inferred to be
Strings.
blegat
force-pushed
the
bl/juliac-unique-names
branch
from
November 16, 2026 08:09
840a40e to
93d095d
Compare
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the tracing does not contain a case where two variables have the same name. When you then try to write a MOF file with names clash you get an error because you are missing methods (this happens in the JuMPy tests for instance).
The reason is that
replacementsis aVector{Function}so in the following:MathOptInterface.jl/src/FileFormats/utils.jl
Lines 212 to 222 in 2aecedb
new_nameis inferred toAny. During tracing, since the names are different we don't enter theifclause and sincenew_nameis inferred toAny, JuliaC don't know which methods is needed forstringso then when we run the executable with a model containing duplicate names, we enter that if clause and we don't have the method we need.We could require of the user to add duplicate names in tracing but this seems like an instance where the tradeoff is in favor if instead fixing it here. MOF also always calls this method with
replacements = ()so it's not likeVector{Function}is preventing the compiler to over specialize.