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
varx: Int {
0// OK
}
vary: Int {
#iffalsereturn0// OK
#elsereturn1// OK
#endif
}
varz: Int {
#iffalse0
#else1// error: missing return in a function expected to return 'Int'; did you mean to return the last expression?
#endif
}
It would be a really useful and clean idiom to use with platform tests, were it legal
The text was updated successfully, but these errors were encountered:
This doesn't seem too difficult to do—I'm tempted to label it a starter bug. We recognize single-expression functions in Parser::parseAbstractFunctionBody(); I think we could just look for an IfConfigDecl there and step into its active clause, probably in a loop.
@dabrahams@DougGregor Would this be a bug fix or would it require an evolution proposal?
Additional Detail from JIRA
md5: dbe62f528523cd6659e93f772ae6f49d
Issue Description:
This is a shame:
It would be a really useful and clean idiom to use with platform tests, were it legal
The text was updated successfully, but these errors were encountered: