From b3ec357e1deac43f0aca684af1aa40e57238a171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Sat, 7 Jan 2023 14:22:31 +0100 Subject: [PATCH 1/2] Add docs for `ArrayLiteral#-` --- src/compiler/crystal/macros.cr | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/crystal/macros.cr b/src/compiler/crystal/macros.cr index 9dadf48af06c..a2dd2963e200 100644 --- a/src/compiler/crystal/macros.cr +++ b/src/compiler/crystal/macros.cr @@ -707,6 +707,10 @@ module Crystal::Macros def +(other : ArrayLiteral) : ArrayLiteral end + # Similar to `Array#-`. + def -(other : ArrayLiteral) : ArrayLiteral + end + # Returns the type specified at the end of the array literal, if any. # # This refers to the part after brackets in `[] of String`. @@ -883,6 +887,9 @@ module Crystal::Macros # # Its macro methods are nearly the same as `ArrayLiteral`. class TupleLiteral < ASTNode + # Similar to `Array#-`. + def -(other : ArrayLiteral) : ArrayLiteral + end end # A fictitious node representing a variable or instance From bb236c7ea0da362ee3cb9b66e59a9dc5c0aa2914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Sat, 7 Jan 2023 17:47:51 +0100 Subject: [PATCH 2/2] Remove `TupleLiteral#-` --- src/compiler/crystal/macros.cr | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/compiler/crystal/macros.cr b/src/compiler/crystal/macros.cr index a2dd2963e200..ae2a2e73c25a 100644 --- a/src/compiler/crystal/macros.cr +++ b/src/compiler/crystal/macros.cr @@ -887,9 +887,6 @@ module Crystal::Macros # # Its macro methods are nearly the same as `ArrayLiteral`. class TupleLiteral < ASTNode - # Similar to `Array#-`. - def -(other : ArrayLiteral) : ArrayLiteral - end end # A fictitious node representing a variable or instance