Issue https://github.com/JuliaLang/julia/issues/9135 is causing
troubles.  This is a workaround, undo once the issue is fixed.
updated  to deal with type constaint functions