// Copyright 2025 Gabriel Bjørnager Jensen.

mod test;

use crate::Int;

use core::convert::Infallible;

/// Denotes a signed integer that is at least as wide as [`i16`].
///
/// # Safety
///
/// Only primitive, signed, integral types that fit the size requirement may implement this type.
pub trait IntLeast16
where
	Self:
		crate::seal::IntLeast16
		+ Int
		+ From<i16>
		+ From<u8>
		+ TryFrom<i16, Error = Infallible>
		+ TryFrom<u8,  Error = Infallible>,
{}

macro_rules! impl_int_least16 {
	{ $($Ty:ty),*$(,)? } => {$(
		impl ::multitype::seal::IntLeast16 for $Ty {}

		impl ::multitype::IntLeast16 for $Ty {}
	)*};
}

impl_int_least16! {
	i16,
	i32,
	i64,
	i128,
	isize,
}
