mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Allow int/float to coerce in type checker (#679)
This commit is contained in:
@ -8,6 +8,8 @@ use nu_protocol::{
|
||||
pub fn type_compatible(lhs: &Type, rhs: &Type) -> bool {
|
||||
match (lhs, rhs) {
|
||||
(Type::List(c), Type::List(d)) => type_compatible(c, d),
|
||||
(Type::Number, Type::Int) => true,
|
||||
(Type::Number, Type::Float) => true,
|
||||
(Type::Unknown, _) => true,
|
||||
(_, Type::Unknown) => true,
|
||||
(lhs, rhs) => lhs == rhs,
|
||||
|
Reference in New Issue
Block a user