This bug will be fixed in the 5.1 release ([5.1] Two function-builders fixes by rjmccall · Pull Request #25944 · apple/swift · GitHub).
Note that unfortunately function builders will remain a private feature in 5.1; we'll have to maintain compatibility with existing code that uses the @_functionBuilder
attribute, but we can still pursue alternative designs for the un-underscored feature.