Skip to content

Commit 69cc297

Browse files
committed
fix(compiler): accept Any type in unary operations
1 parent 859d421 commit 69cc297

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/compiler/src/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ impl<'a> AstTransformer for VarIdTyPass<'a> {
13141314
}
13151315
UnaryOp::Neg => {
13161316
let operand_ty = operand.ty();
1317-
if ![Ty::Float, Ty::Int].contains(&operand_ty) {
1317+
if ![Ty::Float, Ty::Int, Ty::Any].contains(&operand_ty) {
13181318
self.errors.push(StaticError {
13191319
span: self.span(operand.span()),
13201320
kind: StaticErrorKind::UnaryOpInvalidType,

0 commit comments

Comments
 (0)