allwpilib
allwpilib copied to clipboard
Detect when SimDevice.create* is creating a duplicate and report an error
Right now if I create two identical SimBooleans from the same SimDevice I just get a null pointer exception, a message saying the names conflict would be nice.
Someone more knowledgeable about the HAL than me would need to check if this would violate an assumption about the return value of HAL_CreateSimDevice(), but I think we could change the return value in SimDeviceData::CreateDevice to a unique negative error code which SimDevice.create() could detect to throw an exception instead of returning null.