authorgravatar for mitchell.hashimoto@gmail.comMitchell Hashimoto <mitchell.hashimoto@gmail.com> 2022-02-25 18:47:10-08:00
committergravatar for mitchell.hashimoto@gmail.comMitchell Hashimoto <mitchell.hashimoto@gmail.com> 2022-02-25 18:47:10-08:00
log91af552f87817f3a5fa23d812cecc79649c7e506
treec9739231d5ac57aabe6ed81f0a55b836c45ee6ab
parent943ee59bb1524a46dd13af6a55d30025e25dd061
signaturelock-open Commit is signed but in an unrecognized format.

stage2: resolve peer types that trivially coerce


1 files changed, 12 insertions(+), 0 deletions(-)

src/Sema.zig+12
...@@ -16993,6 +16993,18 @@ fn resolvePeerTypes(...@@ -16993,6 +16993,18 @@ fn resolvePeerTypes(
16993 const chosen_ty = sema.typeOf(chosen);16993 const chosen_ty = sema.typeOf(chosen);
16994 if (candidate_ty.eql(chosen_ty))16994 if (candidate_ty.eql(chosen_ty))
16995 continue;16995 continue;
16996
16997 // If the candidate can coernce into our chosen type, we're done.
16998 // If the chosen type can coerce into the candidate, use that.
16999 if ((try sema.coerceInMemoryAllowed(block, chosen_ty, candidate_ty, false, target, src, src)) == .ok) {
17000 continue;
17001 }
17002 if ((try sema.coerceInMemoryAllowed(block, candidate_ty, chosen_ty, false, target, src, src)) == .ok) {
17003 chosen = candidate;
17004 chosen_i = candidate_i + 1;
17005 continue;
17006 }
17007
16996 const candidate_ty_tag = candidate_ty.zigTypeTag();17008 const candidate_ty_tag = candidate_ty.zigTypeTag();
16997 const chosen_ty_tag = chosen_ty.zigTypeTag();17009 const chosen_ty_tag = chosen_ty.zigTypeTag();
1699817010