# Front end goes wild with named slots

Bug introduced in 10 and fixed in 12.1

Assume the following simple expression

{#"Test"}&


Now go in front of the # and just start typing another named slot expression. On my system, the front end invalidates the input by magically inserting invisible characters

For a real cool demonstration, look at this

My system is: Mathematica 10.2 on Ubuntu 14.04

### Update:

Official response of WRI confirms that it is a bug:

Thank you for taking the time to send in this report. It does appear that entering an additional string (quotation marks) is causing an issue with the front end's box structure, and I have forwarded an incident report to our developers with the information you provided.

• Do you think this is related to what happens here and in the question I linked in the comments? – march Sep 24 '15 at 3:23
• I get exactly the same results with Mathematica 10.2 on Windows 7 x64. – WReach Sep 24 '15 at 3:34
• Yes, I believe they are strongly related. What seems to happen is that when you open quotes and insert a string, the front end has to take the rest of your whole expression as string, because you haven't inserted the closing quotes yet. The moment you close the quotes, the front end rebuilds a wrong box-structure of your expression. This happens in my example and it happens in yours. You can easily verify this yourself. – halirutan Sep 24 '15 at 3:34
• @march And if you don't know how to verify this, then just use a minimal example like this "a"(a )^2. Take one version that you copy and another version that you type by inserting the string at last. Then, look at both expressions by pressing Ctrl+Shift+E to show the box structure. You will see that the SupercriptBox does not contain the correct elements. – halirutan Sep 24 '15 at 3:40
• Yes I see. Interestingly enough, as @MarcoB points out in that post, the formatted superscript is necessary for that example, which doesn't seem to be the case for yours. I've seen cases where the # will lose track of its corresponding & and turn pink when, for instance, I introduce new formatted fraction signs in an expression (although I'm having trouble reproducing that right now). Point being: it doesn't seem to be just quotes causing problems. I'll try my best to find an example... – march Sep 24 '15 at 3:49