summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/compile.c b/compile.c
index e57ad4498a..e9ce106eca 100644
--- a/compile.c
+++ b/compile.c
@@ -7096,20 +7096,13 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, const NODE *node, int poppe
}
static int
-check_yield_place(const rb_iseq_t *iseq, int line)
+check_yield_place(const rb_iseq_t *iseq)
{
- VALUE file;
switch (iseq->body->local_iseq->body->type) {
case ISEQ_TYPE_TOP:
case ISEQ_TYPE_MAIN:
- return FALSE;
case ISEQ_TYPE_CLASS:
- file = rb_iseq_path(iseq);
- if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED)) {
- rb_compile_warn(RSTRING_PTR(file), line,
- "`yield' in class syntax will not be supported from Ruby 3.0. [Feature #15575]");
- }
- return TRUE;
+ return FALSE;
default:
return TRUE;
}
@@ -7836,7 +7829,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
INIT_ANCHOR(args);
- if (check_yield_place(iseq, line) == FALSE) {
+ if (check_yield_place(iseq) == FALSE) {
COMPILE_ERROR(ERROR_ARGS "Invalid yield");
goto ng;
}