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
current implementation implicitly resolves 0-arg templates as a call; IMO it's a design mistake that should be fixed, and it should require a pragma {.implicitcall.} eg:
templatefun(): string="foo"doAssertfun() =="foo"# okdoAssert fun =="foo"# should CT errortemplatefun2(): string {.implicitcall.} ="foo"doAssertfun2() =="foo"# should CT errordoAssert fun2 =="foo"# ok
alternative proposal (just different syntax, same idea)
instead of {.implicitcall.}, use template fun2 without parens:
templatefun(): string="foo"doAssertfun() =="foo"# okdoAssert fun =="foo"# should CT errortemplatefun2: string="foo"doAssertfun2() =="foo"# should CT errordoAssert fun2 =="foo"# ok
current implementation implicitly resolves 0-arg templates as a call; IMO it's a design mistake that should be fixed, and it should require a pragma {.implicitcall.} eg:
alternative proposal (just different syntax, same idea)
instead of {.implicitcall.}, use
template fun2
without parens:links
The text was updated successfully, but these errors were encountered: