I'm tempted to say that this should assert instead of error. It seems like a programmer error to try a method like this on a temporary ref.