diff options
author | Haibo Huang <hhb@google.com> | 2020-09-22 19:23:03 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-09-22 19:23:03 +0000 |
commit | 6b2ed839aeca03c4f8d757f9d5b02d17f780848b (patch) | |
tree | 196bf451ec7a656bcbaaeffce735fe19e5c7b66f /include/fruit/impl/injection_errors.h | |
parent | 572fac3f0241a7d0fb2e03cdcaf8d04ba427a7eb (diff) | |
parent | c93bd61c66abb28f4242763556a6540ae020d955 (diff) | |
download | google-fruit-6b2ed839aeca03c4f8d757f9d5b02d17f780848b.tar.gz |
Upgrade google-fruit to 928458857f4b85a0016c2d724486343b4660cb46 am: 873eb760e8 am: efde60e714 am: dc3aaf3620 am: 5fc3332375 am: c93bd61c66
Original change: https://android-review.googlesource.com/c/platform/external/google-fruit/+/1433213
Change-Id: Ib70b2e55b893c3fd13f03008c8e908b46223893e
Diffstat (limited to 'include/fruit/impl/injection_errors.h')
-rw-r--r-- | include/fruit/impl/injection_errors.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/fruit/impl/injection_errors.h b/include/fruit/impl/injection_errors.h index a0e9def..68247d2 100644 --- a/include/fruit/impl/injection_errors.h +++ b/include/fruit/impl/injection_errors.h @@ -124,6 +124,16 @@ struct NotASignatureError { "the form MyClass(int, float)."); }; +template <typename CandidateSignature> +struct AssistedParamInRegisterConstructorSignatureError { + static_assert(AlwaysFalse<CandidateSignature>::value, + "CandidateSignature was used as signature for a registerConstructor() (explicit or implicit via the " + "INJECT macro / Inject typedef) but it contains an assisted parameter. When using assisted parameters" + "You need to inject a factory like std::function<std::unique_ptr<MyClass>(int, float)> instead of " + "injecting MyClass directly. If you used an explicit registerConstructor(), you also need to switch " + "that to registerFactory()."); +}; + template <typename CandidateLambda> struct NotALambdaError { static_assert(AlwaysFalse<CandidateLambda>::value, @@ -494,6 +504,11 @@ struct NotASignatureErrorTag { using apply = NotASignatureError<CandidateSignature>; }; +struct AssistedParamInRegisterConstructorSignatureErrorTag { + template <typename CandidateSignature> + using apply = AssistedParamInRegisterConstructorSignatureError<CandidateSignature>; +}; + struct NotALambdaErrorTag { template <typename CandidateLambda> using apply = NotALambdaError<CandidateLambda>; |