From a84fe94cf1354420e798d4f03618b18adcb4b24c Mon Sep 17 00:00:00 2001 From: mertcandav Date: Tue, 30 Jan 2024 15:46:27 +0300 Subject: [PATCH] sema: fix private methods of structures are allowed to access out of package --- std/jule/sema/eval.jule | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/std/jule/sema/eval.jule b/std/jule/sema/eval.jule index df1ad0720..343a61b9c 100644 --- a/std/jule/sema/eval.jule +++ b/std/jule/sema/eval.jule @@ -2351,6 +2351,10 @@ impl Eval { self.push_err(si.ident, LogMsg.ObjHaveNotIdent, s.decl.ident, si.ident.kind) ret nil } + if !self.s.is_accessible_define(m.public, m.token) { + self.push_err(si.ident, LogMsg.IdentIsNotAccessible, m.ident) + self.push_suggestion(LogMsg.MakePubToAccess) + } if m.params[0].is_ref() && !ref { self.push_err(si.ident, LogMsg.RefMethodUsedWithNotRefInstance)