Bug introduced in 8.0.4 or earlier and persists through 11.1.1
Thank you for bringing this to our attention. I have filed a report with our developers.
Why does this
{42.`}~MatchQ~(x0 : _List)
{42.`}~MatchQ~(x0 : {___})
{42.`}~MatchQ~(x0 : _List : {1.})
{42.`}~MatchQ~(x0 : {___} : {1.})
give
True
True
True
False
Instead of all true?
Answer
This bug is fixed in our next release. Note, however, that, that the use of Optional generates a warning now, as the optional value could never possible be used in such pattern:
In[14]:= {42.`}~MatchQ~(x0 : {___} : {1.})
During evaluation of In[14]:= Optional::optloose: Optional pattern
x0:{___}:{1.} has no enclosing pattern so no optional value can be matched.
Out[14]= True
Comments
Post a Comment