diff options
author | Haibo Huang <hhb@google.com> | 2020-09-22 17:28:32 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-09-22 17:28:32 +0000 |
commit | efde60e7146303998a704e8604e90d27ca3f6241 (patch) | |
tree | 196bf451ec7a656bcbaaeffce735fe19e5c7b66f /include/fruit/impl/injection_errors.h | |
parent | 1b13f367e02e2e90a59a7e6597bf47f64a1cf105 (diff) | |
parent | 873eb760e863775830a3c1293e77f9a4ec688bdd (diff) | |
download | google-fruit-efde60e7146303998a704e8604e90d27ca3f6241.tar.gz |
Upgrade google-fruit to 928458857f4b85a0016c2d724486343b4660cb46 am: 873eb760e8
Original change: https://android-review.googlesource.com/c/platform/external/google-fruit/+/1433213
Change-Id: I0f9b873c4f077ccbd789ea51ef4b7b9e41157951
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>; |