-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inline string literals in dot calls #19829
Conversation
Test failure is an inference thing. Boils down to: julia> Base.REPLCompletions.get_type(:([""] .== ""), Main)
(Any,false) when it should give |
Since the |
…o handle dot calls now that they generate anonymous functions
a1e221c
to
7416eef
Compare
# powerful enough to analyze general dot calls because it can't handle | ||
# anonymous-function evaluation.) | ||
# s = "CompletionFoo.test5(push!(Base.split(\"\",' '),\"\",\"\").==\"\"," | ||
# c, r, res = test_complete(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this error or should these be @test_broken
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I forgot about the @test_broken
macro.
Okay to merge? |
Can we test that is really being inlined? As in here |
Added a test for inlining. |
Ready to merge. |
This adds a small optimization to inline string literals in dot calls. i.e.
f.("foo", bar)
becomesbroadcast(x -> f("foo", x), bar)
rather thanbroadcast((y,x) -> f(y, x), "foo", bar)
. In a small benchmark of["a" for i = 1:1000] .* "b"
, it led to about a 50% speedup.