Why this doesn't work?
k[x_Integer:2?(#>0&)]:=x^2 k (*should be 4*) k (*should be 4*)
These following are all working as expected:
(* with Optional *) f[x_Integer:2]:=x^2 f (* with PatternTest *) g[x_Integer?(#>0&)]:=x^2 g (* with Optional + Condition *) h[x_Integer:2]:=x^2/;x>0 h h