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
type F func(F)
func Y(f F) {
println("Y combinator")
}
but attempts to call Y fail:
gi> Y(Y)
oops: 'problem detected during Go static type checking: 'cycles not allowed: 'parent:'func(main.F)' -> child:'main.F' completes a cycle''' on input 'Y(Y)'.
Notes to self: gopherjs handles this fine. Luajit runs it fine. It is purely a typechecking layer issue.
gi> Y
func Y(f F) { println("Y combinator") }
elapsed: '114.824µs'
gi> Y(nil)
oops: 'problem detected during Go static type checking: 'cycles not allowed: 'parent:'func(main.F)' -> child:'main.F' completes a cycle''' on input 'Y(nil)'
gi> :r
Raw LuaJIT language mode.
raw luajit gi> Y(nil)
Y combinator
elapsed: '46.878µs'
raw luajit gi>
the following compiles:
but attempts to call Y fail:
oops: 'problem detected during Go static type checking: 'cycles not allowed: 'parent:'func(main.F)' -> child:'main.F' completes a cycle''' on input 'Y(Y)'.
Go playground has no problem running it: https://play.golang.org/p/l2bWUnAETIx
The text was updated successfully, but these errors were encountered: