Nicolas Winkler 6 vuotta sitten
vanhempi
commit
9cbb47b0c8
2 muutettua tiedostoa jossa 6 lisäystä ja 8 poistoa
  1. 3 7
      src/Cast.h
  2. 3 1
      src/test.qlw

+ 3 - 7
src/Cast.h

@@ -18,21 +18,17 @@ namespace qlow
 class qlow::sem::Cast
 {
 public:
-    std::shared_ptr<Type> from;
-    std::shared_ptr<Type> to;
+    std::weak_ptr<Type> to;
     
     bool isExplicit;
     
-    inline Cast(std::shared_ptr<Type> from, std::shared_ptr<Type> to) :
-        from{ std::move(from) },
+    inline Cast(std::weak_ptr<Type> to) :
         to{ std::move(to) },
         isExplicit{ true }
     {
     }
     
-    inline Cast(std::shared_ptr<Type> from, std::shared_ptr<Type> to,
-                bool isExplicit) :
-        from{ std::move(from) },
+    inline Cast(std::weak_ptr<Type> to, bool isExplicit) :
         to{ std::move(to) },
         isExplicit{ isExplicit }
     {

+ 3 - 1
src/test.qlw

@@ -28,8 +28,10 @@ bignumbers do
     //c := b as Int64
 end
 
-main2 do
+main: Integer do
     value: Integer
+    value := 42
+    return value
     //do_shit
 end