Skip to content

Commit 909e508

Browse files
committed
static assert in promote_scalar else branch
1 parent 2fe12b4 commit 909e508

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stan/math/prim/fun/promote_scalar.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ inline constexpr auto promote_scalar(UnPromotedTypes&& x) {
4444
} else if constexpr (is_stan_scalar_v<UnPromotedTypes>) {
4545
return PromotionScalars(std::forward<UnPromotedTypes>(x));
4646
} else {
47-
throw std::domain_error(
48-
"promote_scalar: "
49-
"Unrecognized type for promotion");
47+
static_assert(sizeof(std::decay_t<UnPromotedTypes>*) == 0,
48+
"promote_scalar: Unrecognized type for promotion. "
49+
"This is an internal error, please report it to the stan "
50+
"github as an issue.");
5051
}
5152
}
5253

0 commit comments

Comments
 (0)