From e1c097416efd9392a3f51fcf7f05a566e26c1ac6 Mon Sep 17 00:00:00 2001 From: mertcandav Date: Thu, 14 Mar 2024 18:56:29 +0300 Subject: [PATCH] jule update: init functions are cannot evaluate --- std/jule/sema/eval.jule | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/std/jule/sema/eval.jule b/std/jule/sema/eval.jule index c57ad6d12..f7c17b40c 100644 --- a/std/jule/sema/eval.jule +++ b/std/jule/sema/eval.jule @@ -33,7 +33,7 @@ use std::jule::ast::{ TernaryExpr, NamespaceTypeDecl, } -use std::jule::build::{ +use build for std::jule::build::{ LogMsg, Directive, PATH_STDLIB, @@ -719,15 +719,17 @@ impl Eval { | &Struct: ret self.eval_struct((&Struct)(def).instance(), ident) | &Fn: - ret self.eval_fn((&Fn)(def), ident) + let mut f = (&Fn)(def) + if f.ident != build::INIT_FN { + ret self.eval_fn(f, ident) + } | &FnIns: ret self.eval_fn_ins((&FnIns)(def)) | &TypeAlias: ret self.eval_type_alias((&TypeAlias)(def), ident) - |: - self.push_err(ident, LogMsg.IdentNotExist, ident.kind) - ret nil } + self.push_err(ident, LogMsg.IdentNotExist, ident.kind) + ret nil } fn eval_ident(mut self, ident: &IdentExpr): &Data {