How to get length info from expression.Constant correctly?

Please try asking any AI for advice. That’s a good way to do it.