You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this is a perfectly valid use case for languages like JS and C++, as result<> return type are lowered into blob directly, using exceptions to propagate error-type values if they occur. This is what happens already with normal methods that return result<>.
Thoughts? I wonder if it is possible to enable this use case. Without it, APIs are forced to use alternative static methods like create: static func(), which is not standard, and hurts readability/discoverability.
Totally agreed; we should definitely do this. I believe #285 makes this same point, so perhaps we can dup this to that?
Spec-wise, the change is very simple; we just relax the validation rules for [constructor]...-named functions to also allow result. Most of the work would be in wit-bindgen and related tools. Let me know if anyone is keen to work on this!
Activity
lukewagner commentedon Jan 14, 2025
Totally agreed; we should definitely do this. I believe #285 makes this same point, so perhaps we can dup this to that?
Spec-wise, the change is very simple; we just relax the validation rules for
[constructor]...-named functions to also allowresult. Most of the work would be in wit-bindgen and related tools. Let me know if anyone is keen to work on this!OmarTawfik commentedon Jan 17, 2025
Thank you. I missed #285. I can close this one as a dup.