Shouldn't this be `otherPattern.toString == pattern.toString` ?