Replace a couple of sprintf calls in printVerses with interpolated st…#499
Replace a couple of sprintf calls in printVerses with interpolated st…#499
Conversation
|
I wasn't sure whether to change the |
|
Were you planning to replace more sprintf calls? |
|
I haven't had time to look at it more since I opened this :-( There are a number of other warnings from AOT builds in this area, e.g. So there would be more work there to fix that as well. |
|
No worries. Just wanted to make sure I wasn't neglecting your work |
|
I'd forgotten about this one. Current versions of the compiler can compile interpolations that only involve strings into calls to string.Concat and avoid formatting altogether so they can also be more efficient, though maybe that's less important in tests. |
|
I generally use interpolation instead of sprintf. I find interpolation easier to read. |
|
Anyway, would you prefer a pass over the code to see how many things can be changed in one go, or keep it to smaller changes as issues come up? |
|
If the goal is AOT compatibility, then I think it'd make sense to survey what it would take upfront. It seems like replacing a few string formats at a time would lack clarity in the git record. If the investigations shows this will be a big task, we can revise our approach based on the context we gain |
…rings
refs #498
I tried stubbing out the DVar/Logging bits that are described in #498 and then running the
I am (should fail)example test from the Expecto project template in an AOT build, and it crashed withand replacing these two sprintfs with interpolated strings allows it to run, and print out a failure message.
This is basically the simplest possible test case, but it at least shows that it can execute tests and process the results in AOT builds.