# File lib/tramp/attribute.rb, line 58
    def check_value!(value)
      # Allow nil and Strings to fall back on the validations for typecasting
      # Everything else gets checked with is_a?
      if value.nil?
        nil
      elsif value.is_a?(String)
        value
      elsif value.is_a?(expected_type)
        value
      else
        raise TypeError, "Expected #{expected_type.inspect} but got #{value.inspect}"
      end
    end