Closed jbardin closed 11 months ago
I prefer to make NilType
panic when used for anything other than representing the total absence of a type. It always represents a bug in the calling program, so I'd rather let the caller know they have a bug and decide how to fix it.
Fair enough! Not every method panics, so I wasn't certain which way to go here. I'll figure which caller should be validating the type before this call.
I did make an exception for RawEquals
because it is trying to create a notion of "type identity" for more convenient testing, but otherwise any allowances for cty.NilType
are probably a historical mistake.
NilType
is a valid type which was missed when listing all types underWithoutOptionalAttributesDeep
. It should generally not appear here, but seems safe to account for in this case to prevent panics. If theNilType
is not valid, then the caller will have to deal with that anyway.