[vala/staging] vala: Drop RealLiteral.get_type_name()



commit edcf8e739bd6a4435fdb7df2d4cb027fe56aec18
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Sep 28 17:42:47 2021 +0200

    vala: Drop RealLiteral.get_type_name()

 vala/valarealliteral.vala | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/vala/valarealliteral.vala b/vala/valarealliteral.vala
index 9c1e7d86e..2924cd764 100644
--- a/vala/valarealliteral.vala
+++ b/vala/valarealliteral.vala
@@ -49,19 +49,6 @@ public class Vala.RealLiteral : Literal {
                visitor.visit_expression (this);
        }
 
-       /**
-        * Returns the type name of the value this literal represents.
-        *
-        * @return the name of literal type
-        */
-       public string get_type_name () {
-               if (value.has_suffix ("f") || value.has_suffix ("F")) {
-                       return "float";
-               }
-
-               return "double";
-       }
-
        public override bool is_pure () {
                return true;
        }
@@ -77,7 +64,14 @@ public class Vala.RealLiteral : Literal {
 
                checked = true;
 
-               var st = (Struct) context.root.scope.lookup (get_type_name ());
+               string type_name;
+               if (value.has_suffix ("f") || value.has_suffix ("F")) {
+                       type_name ="float";
+               } else {
+                       type_name = "double";
+               }
+
+               var st = (Struct) context.root.scope.lookup (type_name);
                // ensure attributes are already processed
                st.check (context);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]