Kaynağa Gözat

Fix manifest and mapping issues

Billy Barrow 1 ay önce
ebeveyn
işleme
7cfa0331f9

+ 2 - 2
MANIFEST.usm

@@ -3,14 +3,14 @@
   "version": "1.0.0",
   "summary": "Enumerable library for vala",
   "licences": [ {"name": "LGPLv3", "category": "libre", "text": "LICENSE"} ],
-  "flags": [],
+  "flags": ["ninjaStyleProgress"],
   "provides": {
     "lib:libinvercargill-1.so": "as-expected",
     "inc:invercargill-1.h": "as-expected",
     "vapi:invercargill-1.vapi": "as-expected",
     "gir:invercargill-1.gir": "as-expected",
     "typelib:invercargill-1.typelib": "as-expected",
-    "pc:invercargill.pc": "as-expected"
+    "pc:invercargill-1.pc": "as-expected"
   },
   "depends": {
     "runtime": [

+ 12 - 5
src/lib/Enumerable.vala

@@ -156,7 +156,9 @@ namespace Invercargill {
         }
 
         public virtual Attempts<TOut> attempt_select<TOut>(owned AttemptTransformDelegate<T, TOut> transform) {
-            return select<Attempt<TOut>>(i => new Attempt<TOut>(() => transform(i))).assert_promotion<Attempts>();
+            // Promote this manually to preserve wrapped type
+            var attempts = new Attempts<TOut>();
+            return attempts.call_wrap(select<Attempt<TOut>>(i => new Attempt<TOut>(() => transform(i))));
         }
 
         public virtual Attempts<SelectionContext<T, TOut>> attempt_contextualised_select<TOut>(owned AttemptTransformDelegate<T, TOut> transform) {
@@ -164,21 +166,26 @@ namespace Invercargill {
         }
 
         public virtual Attempts<TOut> attempt_select_nested<TOut>(owned AttemptTransformDelegate<T, Enumerable<Attempt<TOut>>> transform) {
-            return attempt_select<Enumerable<Attempt<TOut>>>((owned)transform)
+            // Promote this manually to preserve wrapped type
+            var attempts = new Attempts<TOut>();
+            return attempts.call_wrap(
+                attempt_select<Enumerable<Attempt<TOut>>>((owned)transform)
                 .as_enumerable()
                 .select_many<Attempt<TOut>>(a => a.success ? a.result : Iterate.single<Attempt<TOut>>(new Attempt<TOut>.unsuccessful(a.error)))
-                .assert_promotion<Attempts>();
+            );
         }
 
         public virtual Attempts<T> attempt_where(owned AttemptPredicate<T> predicate) {
-            return select_where<Attempt<T>>((i, out o) => {
+            // Promote this manually to preserve wrapped type
+            var attempts = new Attempts<T>();
+            return attempts.call_wrap(select_where<Attempt<T>>((i, out o) => {
                 bool match = true;
                 o = new Attempt<T>(() => {
                     match = predicate(i);
                     return i;
                 });
                 return match;
-            }).assert_promotion<Attempts>();
+            }));
         }
 
         public virtual Enumerable<Pair<TFirst, TSecond>> select_pairs<TFirst, TSecond>(owned TransformDelegate<T, TFirst> transform1, owned TransformDelegate<T, TSecond> transform2) {

+ 2 - 1
src/lib/Mapping/PropertyMapper.vala

@@ -158,7 +158,8 @@ namespace Invercargill.Mapping {
                     setter(o, collection.seal());
                 }
             };
-            return new PropertyMappingBuilder<T>(this, mapping);;
+            add_mapping(mapping);
+            return new PropertyMappingBuilder<T>(this, mapping);
         }
 
         public virtual PropertyMapperBuilder<T> set_constructor(ObjectConstructor<T> constructor) {

+ 1 - 1
src/lib/Promotions/Registration.c

@@ -1,5 +1,5 @@
 
-#include "invercargill.h"
+#include "invercargill-1.h"
 
 VALA_EXTERN GType invercargill_binary_data_promotion_implementation_get_type (void) G_GNUC_CONST ;