From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YKHxB+7jAGeDlQAAqHPOHw:P1 (envelope-from ) for ; Sat, 05 Oct 2024 08:59:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id YKHxB+7jAGeDlQAAqHPOHw (envelope-from ) for ; Sat, 05 Oct 2024 08:59:58 +0200 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b="To/2UsnX"; dkim=pass header.d=maniero.me header.s=hostingermail1 header.b="I7/ffw2m"; dmarc=pass (policy=none) header.from=maniero.me; arc=pass ("mailchannels.net:s=arc-2022:i=1"); spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht ARC-Seal: i=2; s=key1; d=johnnyrichard.com; t=1728111598; a=rsa-sha256; cv=pass; b=3+7UdYjiCP0vaZDQSBGi7OJn5YGvZXPiYdyIJKIam0nyR7R9CShegaelzmQKR5NGM3EAHN 5xtkLXSMjA9nSpWpnCIu7SYbWITqO1GeFcWj5WLJg+EeYC65n5c+nDkxwJ6OgiTbMjM3X6 zei9Toks5tvgygJE5W1uEswvGiaG+HOvXrwU03yqiB/6PYZiIAZDAlHBnMKYfFmCMebEd9 k3V5jo3ltt63H3pnA2IzIwJ7f9N7XnJeBN/+4tF5YiwVOVGbFlJQvpw3EUzvFiXMOz5MbM T8jWOxdOhUM+wax8QVIlq5mh5YVVf1aqrISq40SzpIAA08wvty9XeJJT1oot4g== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b="To/2UsnX"; dkim=pass header.d=maniero.me header.s=hostingermail1 header.b="I7/ffw2m"; dmarc=pass (policy=none) header.from=maniero.me; arc=pass ("mailchannels.net:s=arc-2022:i=1"); spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1728111598; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=3dCwOcdlt0CD31c7fj29zMmtgiCqtCQPWWEtLT8JT4o=; b=Zyr8FX/sgjfCLlvdqOXsDOHMAA+zPnpUpZSICUiAjAxNxa2eaK87juKU8v4Lw7is7zs1tm hetBbLfEsc2Fru3UTwNBHXRxBLVcN8lEr0dsEhpDVFid7E4YbJmFsSPZVEYbT/NhJaFeBs 3chJvhOe62spIfjfEvsWvsGdfx68rt99JgqF+mvz9j5z9Rq5TiRqlwzfMZjFpuzCNPQMSw okwWIXX1wS8P/87UI9TYcAhhqvDI0OQ7WOYTM1U8ahlCl1b9fygNPTp8GanvpDaj19dAT9 OZPPwUOlsjiYBljJisKY+20fg1KUv/KGHORcKK9wKu1DicCoiuHhAqoEbaJ2HQ== Received: from mail-a.sr.ht (mail-a.sr.ht [46.23.81.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C07341921D for ; Sat, 05 Oct 2024 08:59:57 +0200 (CEST) DKIM-Signature: a=rsa-sha256; bh=Nu5AKINbcxageTUxGu+X9aFOl8ajTWitirbo6ZJCUDw=; c=simple/simple; d=lists.sr.ht; h=From:To:Cc:Subject:In-Reply-To:References:Date:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID; q=dns/txt; s=20240113; t=1728111596; v=1; b=To/2UsnXbDoDbxf1x6YYyN86QxkR3AkV7ejt0C8TgBVfb8yuTEf9688i6YEDdgl17FW2RWMt v9Mv/qD6QRxeO8yXBxbJlI7PUyrmtwFQF9Ieme1uvLGdbq/lTUSf/LDuPt++hFyOr//AgI51M4t MrpLLsFhQu18hDNaMavnJZm8zKhu4IHW5eO3gFbKWCT2udtg4HPt1P8eASZztm48dR7PKpRjeLh xNadhPR6MluX3WlQ+MSysDSlx2KMSIW1B6xhGSkpdjEp643rWtOles1ESBZ/JiPBRAyMEXnuIFZ b3GM577KhX6MKeuDIBmRRvuziz4FpFM/605SPhr5BsklQ== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id BEE8920246 for ; Sat, 05 Oct 2024 06:59:56 +0000 (UTC) Received: from fennec.ash.relay.mailchannels.net (fennec.ash.relay.mailchannels.net [23.83.222.58]) by mail-a.sr.ht (Postfix) with ESMTPS id D0CD32023D for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 05 Oct 2024 06:59:55 +0000 (UTC) X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 27F9E90203F for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 5 Oct 2024 06:59:54 +0000 (UTC) Received: from fr-int-smtpout5.hostinger.io (100-96-87-171.trex-nlb.outbound.svc.cluster.local [100.96.87.171]) (Authenticated sender: hostingeremail) by relay.mailchannels.net (Postfix) with ESMTPA id 8B7709028C9 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 5 Oct 2024 06:59:53 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1728111593; a=rsa-sha256; cv=none; b=ZYvjwrxJmfYjTKJqofklW2MJeR7UHE8xcwx2EhGcyWYL/h3Nxzt16m77NNzZ3txJXs9UrR P1iJg1urzf4jiwSMOhCVQCXrO6edFms5Qb4jhmkAjTPldqRWvdoT7K+8Xkxt94Kk3JmK9/ /+aB/iwWwH1fRk4nN2lv1usMjKzKsov6/Vudtc/PwuMeR/5YC3Y7cMW1L4KookqMfpH5TK 9Exw7zVJ6fkGWcVHHRxSsEGNv0tAmMmQDS5PXzcO6jgGx4HUY2AC875Hy6n+aRuWb3bjsU 8QlUtuOo6SCYcaFd3ZahVaOr+wv0SU8WYY829SNTmRXIWNlG28L8x0xlniB/RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1728111593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3dCwOcdlt0CD31c7fj29zMmtgiCqtCQPWWEtLT8JT4o=; b=aEqU+mdu+lIdPHZZc73630gH8HhTt2boWkN2XvsYBMMk4UNyVzh4F38q6vyb5sHYxKyStW 6cYMHDJitJdrcrlfZ9hO18CUKsvaNh9/VgWixbE1n/08WBwoOy1uFIqL/CdKL5068ZLq9d wuYenxkqkQhzr/NesMrXJ9EW02U/Li3Bp913ald63A4eWK06yOIOofjPnYhRh2pZxk0FJ4 VUkXm812mjArEg0FDfUX+hMbb0lPdyl8wemotKy3iPHeCLFGtLmXQmKITBJo6sdxAqEU0b +jTs8OJajrlwGBn4kvZmzSTwUJDxUzeyjtHmGPeORkFTNcEyrWiTKhPNgMsr3A== ARC-Authentication-Results: i=1; rspamd-5778c966d7-27hgr; auth=pass smtp.auth=hostingeremail smtp.mailfrom=carlos@maniero.me X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me X-MC-Relay: Neutral X-MailChannels-SenderId: hostingeremail|x-authuser|carlos@maniero.me X-MailChannels-Auth-Id: hostingeremail X-Suffer-Descriptive: 4159a79c391e196a_1728111594052_1587000445 X-MC-Loop-Signature: 1728111594052:3937625223 X-MC-Ingress-Time: 1728111594052 Received: from fr-int-smtpout5.hostinger.io (fr-int-smtpout5.hostinger.io [89.116.146.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.87.171 (trex/7.0.2); Sat, 05 Oct 2024 06:59:54 +0000 From: Carlos Maniero DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maniero.me; s=hostingermail1; t=1728111591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3dCwOcdlt0CD31c7fj29zMmtgiCqtCQPWWEtLT8JT4o=; b=I7/ffw2mjv+Vwk5lLfO1tPopFoBy3Bm2KQUoY3Iqdc5x/U27R2WAYr4k1HxloF05Eo+83k Y2Jn4R2dwAs2KJBPfQD4SeSwXp6SUOi/ld/0tHzye3LQKvc60S8+A5TYSwKaQyCqyp7e+x AHPUz/ghEbz6hl6XiMYhwipupcpjwablQtBA9bLKuQW6gcDnaKNspUXSFHl1gUhkH1CiLq A8/MULs10/1QEl1rCm4EiszFwsl6WR3UQyadcGLQAJjxBcZy/F8qKAiRGzLcOirbsDECZX OnxCgbeobQWYcudeSCFyC0Sms6MZNyW+Q4cDzclEbaYxInN3gT/dy5MLwz+jtA== To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Carlos Maniero Subject: [PATCH olang v1 1/2] scope: register functions into the scope Message-Id: <20241005065924.300710-2-carlos@maniero.me> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241005065924.300710-1-carlos@maniero.me> References: <20241005065924.300710-1-carlos@maniero.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Sat, 05 Oct 2024 06:59:51 +0000 (UTC) X-CM-Envelope: MS4xfP5r1hVNelRaX6gPLepmcb7vZAawV6ro3eCsgewJy2Hjab4GGkwsSZQ/buo57WW5nuSam44vNpMxJoFwU21AhYLoOdrqQlKrol1TViiAXRbDcd1XXgQd fBSpNqwRJIgMMrovIRYuSdU7LLFFH3CZ43xo+6X4ni7AeLtYiPZmfmM4aabWdpBA+Qe5UvKHuMTZGrEj3SDKfjpT2ZXW+yHxuW1U80bUEO2OEPnCMM9lahrj X-CM-Analysis: v=2.4 cv=Z6G+H2RA c=1 sm=1 tr=0 ts=6700e3e7 a=WwxFCuf3mf1fs3oSi6/dng==:117 a=WwxFCuf3mf1fs3oSi6/dng==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=Z6C7xDrva0H86cDLXyMA:9 a=BXDaF_L80NY05PYiAFlV:22 X-AuthUser: carlos@maniero.me X-Sourcehut-Patchset-Status: UNKNOWN List-Unsubscribe: List-Subscribe: List-Archive: Archived-At: List-Post: List-ID: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel.lists.sr.ht> Sender: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel@lists.sr.ht> X-Migadu-Country: NL X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.74 X-Spam-Score: -5.74 X-Migadu-Queue-Id: C07341921D X-Migadu-Scanner: mx10.migadu.com X-TUID: ra40S08hUINW This is required to resolve the function return type during a function call. Signed-off-by: Carlos Maniero --- src/checker.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/checker.c b/src/checker.c index b7cbe20..ac4102a 100644 --- a/src/checker.c +++ b/src/checker.c @@ -67,6 +67,9 @@ populate_scope(checker_t *checker, scope_t *scope, ast_node_t *ast) ast_fn_definition_t *fn_def = &ast->as_fn_def; fn_def->scope = scope_push(scope); + symbol_t *symbol = symbol_new(checker->arena, fn_def->id, type_from_id(fn_def->return_type)); + scope_insert(scope, symbol); + list_item_t *item = list_head(fn_def->params); while (item != NULL) { -- 2.34.1