So if it is a string and contains "/", it is categorized as a path?
https://upspin.googlesource.com/upspin/+/master/errors/error...
User names can contain slashes apparently:
Re:Error handling in Upspin
by andreareina on Thursday December 07, 2017 @10:26AM
(#15870815)
Yeah, that part seems fragile. Which is why I'm against magic do-what-I-mean logic unless there's only one reasonable way to make semantic sense of it. And preferably only one way to do so, reasonable or unreasonable.
Are any (currently existing) type systems able to encode this sort of thing such that it can be statically checked? IIUC from here[1] the compiler allows any type to be passed in. Sum types catch the error of passing the wrong type in, but don't do anything about passing the same type in multiple times. It's unclear whether the Upspin solution of last-write-wins is simply an easy default that falls out of how they process the arguments, or whether they actually use that property somewhere. I've made the equivalent case an error in my code since it seems much more likely to be indicative of a logic error, I'd love to hear arguments for doing it the other way.
[1] https://upspin.googlesource.com/upspin/+/master/errors/error...