]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Drop RealLiteral.get_type_name()
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 28 Sep 2021 15:42:47 +0000 (17:42 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 1 Oct 2021 18:52:01 +0000 (20:52 +0200)
vala/valarealliteral.vala

index 9c1e7d86eee21bedc2c5ef24a3741c9293e3c4b3..2924cd764733cba4d6067ac73937b33100ba0f6f 100644 (file)
@@ -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);