From a128719cbd68ac62c65ec7f4e290a78563bdafd7 Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Thu, 28 Dec 2023 21:01:53 +0900 Subject: [PATCH] Update codegen.rs --- crates/erg_compiler/codegen.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/erg_compiler/codegen.rs b/crates/erg_compiler/codegen.rs index 5a3390495..b95a6fed3 100644 --- a/crates/erg_compiler/codegen.rs +++ b/crates/erg_compiler/codegen.rs @@ -781,6 +781,12 @@ impl PyCodeGenerator { | "invert" | "is_" | "is_not" | "call" => { self.load_operators(); } + "CodeType" => { + self.emit_global_import_items( + Identifier::public("types"), + vec![(Identifier::public("CodeType"), None)], + ); + } // NoneType is not defined in the global scope, use `type(None)` instead "NoneType" => { self.emit_push_null();