FuelLabs / sway

🌴 Empowering everyone to build reliable and efficient smart contracts.
https://docs.fuel.network/docs/sway/
Apache License 2.0
62.58k stars 5.37k forks source link

Fixes `for` specific error message. #6758

Open esdrubal opened 13 hours ago

esdrubal commented 13 hours ago

The added test case was emitting a wrong/confusing error message, because a for loop only gets type-checked in its desugared form, as a while loop.

The error message was A while loop's loop body cannot implicitly return a value. Try assigning it to a mutable variable declared outside of the loop instead.

Corrected to: A for loop's loop body cannot implicitly return a value. Try assigning it to a mutable variable declared outside of the loop instead.

Fixes #6395

Description

Checklist

codspeed-hq[bot] commented 13 hours ago

CodSpeed Performance Report

Merging #6758 will not alter performance

Comparing esdrubal/6395 (f4d9fba) with master (64d1c6e)

Summary

✅ 22 untouched benchmarks