From 9ea69eed4be7baaefa57fb19dbb4cbf86e3b96cb Mon Sep 17 00:00:00 2001 From: Michael Lill Date: Fri, 3 Nov 2023 14:05:15 +0100 Subject: [PATCH] OnDemandClazz remove special handling for universe --- src/dev/flang/air/Clazzes.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/dev/flang/air/Clazzes.java b/src/dev/flang/air/Clazzes.java index 0c1cb3932d..bd8e28b765 100644 --- a/src/dev/flang/air/Clazzes.java +++ b/src/dev/flang/air/Clazzes.java @@ -104,11 +104,7 @@ public static class OnDemandClazz */ public Clazz getIfCreated() { - if (_t == null) - { - get(); - } - else if (_clazz == null && _clazzesForTypes_.containsKey(_t.get())) + if (_clazz == null && _clazzesForTypes_.containsKey(_t.get())) { _clazz = clazz(_t.get()); } @@ -118,14 +114,7 @@ public Clazz get() { if (_clazz == null) { - if (_t == null) - { - _clazz = clazz(Types.resolved.universe.selfType()); - } - else - { - _clazz = clazz(_t.get()); - } + _clazz = clazz(_t.get()); } return _clazz; } @@ -138,7 +127,7 @@ public void clear() /** * Handy preallocated classes to be used during execution: */ - public static final OnDemandClazz universe = new OnDemandClazz(null); + public static final OnDemandClazz universe = new OnDemandClazz(() -> Types.resolved.universe.selfType()); public static final OnDemandClazz c_void = new OnDemandClazz(() -> Types.resolved.t_void ); public static final OnDemandClazz bool = new OnDemandClazz(() -> Types.resolved.t_bool ); public static final OnDemandClazz c_TRUE = new OnDemandClazz(() -> Types.resolved.f_TRUE .selfType() );