# Trouble with UpSet(Delayed) and IgnoringInactive

I'm having problems setting an upvalue for a symbol that is supposed to ignore Inactive:

IgnoringInactive[f[g[x]]] ^:= match;


Then for some reason, this fails to match:

f[Inactive[g][x]]


I also tried TagSet, as in g /: IgnoringInactive[f[g[x]]] := match but that didn't work either.

What is the intended way to assign a rule to g while ignoring possible Inactive wrapper around g?

• Since g is inactive, no rules associated with it are used. What about tag set for f? – Kuba May 27 '18 at 19:50
• It does set an upvalue, but perhaps @Kuba is saying that the upvalue is not invoked, so you don't get the result of f[Inactive[g][x]] /. UpValues[g], which yields match. I think it's worth reporting to WRI. Either you should get the result or the attempt to set the upvalue should give an error. Or at worst, there could be this sort of example added to the possible issues section of the docs for IgnoringInactive. – Michael E2 May 27 '18 at 20:48
• To add my take on Kuba's comment: The upvalue is not invoked because g is too deep in the expression f[Inactive[g][x]]. When reaching g, the evaluator looks for upvalue matching Inactive[g], of which there isn't one. So it goes on its merry way. It wasn't redesigned to go up one more level in the case when it gets Inactive[symbol] to see if there are IgnoringInactive upvalue rules that match. But that's just guess. – Michael E2 May 27 '18 at 20:51
• @MichaelE2 I think it is correct though it could be confusing at first. My opinion is that example is not a use case for IgnoringInactive. I would arguee with error on set upvalue because Inactive[f][g[x]] will be matched well. – Kuba May 27 '18 at 20:52