From 24815acaeaeeb25a8ca2ccd0fedea1d0d889cfd1 Mon Sep 17 00:00:00 2001 From: ksss Date: Fri, 27 Sep 2024 15:39:53 +0900 Subject: [PATCH] Should set self_type to self --- core/module.rbs | 4 ++-- test/typecheck/eval/Steepfile | 7 +++++++ test/typecheck/eval/test.rb | 26 ++++++++++++++++++++++++++ test/typecheck/eval/test.rbs | 11 +++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 test/typecheck/eval/Steepfile create mode 100644 test/typecheck/eval/test.rb create mode 100644 test/typecheck/eval/test.rbs diff --git a/core/module.rbs b/core/module.rbs index 7ed46c08f..de4bdcb0e 100644 --- a/core/module.rbs +++ b/core/module.rbs @@ -377,7 +377,7 @@ class Module < Object # or method `code' for Thing:Class # def class_eval: (String arg0, ?String filename, ?Integer lineno) -> untyped - | [U] () { (self m) -> U } -> U + | [U] () { (self m) [self: self] -> U } -> U # # Evaluates the given block in the context of the class/module. The method @@ -1083,7 +1083,7 @@ class Module < Object # or method `code' for Thing:Class # def module_eval: (String arg0, ?String filename, ?Integer lineno) -> untyped - | [U] () { (self m) -> U } -> U + | [U] () { (self m) [self: self] -> U } -> U #