diff --git a/src/lib/diff/tree-mutator-collection-binding.hpp b/src/lib/diff/tree-mutator-collection-binding.hpp index b9cc8ca40..505ed3567 100644 --- a/src/lib/diff/tree-mutator-collection-binding.hpp +++ b/src/lib/diff/tree-mutator-collection-binding.hpp @@ -60,6 +60,9 @@ using lib::meta::Strip; using lib::diff::GenNode; +#define ASSERT_VALID_SIGNATURE(_FUN_, _SIG_) \ + static_assert (has_Sig<_FUN_, _SIG_>::value, "Function " STRINGIFY(_FUN_) " unsuitable, expected signature: " STRINGIFY(_SIG_)); + /** * Attach to collection: Concrete binding setup. * This record holds all the actual binding and closures @@ -83,6 +86,12 @@ { using Coll = typename Strip::TypeReferred; using Elm = typename Coll::value_type; + + ASSERT_VALID_SIGNATURE (MAT, bool(GenNode const& spec, Elm const& elm)) + ASSERT_VALID_SIGNATURE (CTR, Elm (GenNode const&)) + ASSERT_VALID_SIGNATURE (SEL, bool(GenNode const&)) + ASSERT_VALID_SIGNATURE (ASS, bool(Elm&, GenNode const&)) + ASSERT_VALID_SIGNATURE (MUT, bool(Elm&, TreeMutator::MutatorBuffer)) Coll& collection; @@ -445,13 +454,13 @@ } static bool - disable_assignment (GenNode const&) + disable_assignment (Elm&, GenNode const&) { return false; } static bool - disable_childMutation (GenNode const&, TreeMutator::MutatorBuffer) + disable_childMutation (Elm&, TreeMutator::MutatorBuffer) { return false; } diff --git a/tests/library/diff/tree-manipulation-binding-test.cpp b/tests/library/diff/tree-manipulation-binding-test.cpp index 268b154ed..235771b41 100644 --- a/tests/library/diff/tree-manipulation-binding-test.cpp +++ b/tests/library/diff/tree-manipulation-binding-test.cpp @@ -308,10 +308,10 @@ namespace test{ { cout << "match? "< - + + + @@ -2442,6 +2444,54 @@ + + + + + + + +

+ der Builder in der nested DSL generiert einen sonderbar falschen "this"-Typ, +

+

+ genauer gesagt, eine TYPID die falsch ist. +

+

+ Und zwar kommt es da zum "Übersprechen" von einem Typ-Parameter in den anderen. +

+

+ Im Besonderen hab ich beobachtet, daß, wenn man auf den 3.Typparameter ein Lambda gibt, +

+

+ dann auf dem 4. oder 5. Typparameter der bisherige /alte Typ des 3.Typparameters auftaucht, +

+

+ u.U auch eingeschachtelt als ein Argument. +

+

+ +

+

+ Habe mich aber davon überzeugt, daß die eigentlichen Typ-Parameter in Ordnung sind. +

+

+ Und zwar habe ich das verifiziert +

+
    +
  • + durch Ausgeben der Typen im Konstruktor (mithilfe meiner typeStr<TY>() +
  • +
  • + durch Einbauen einer Static-Assertion mit Signatur-Match +
  • +
+ + +
+ +
+
@@ -2509,7 +2559,9 @@ - + + +