[scala] implement sfp type system - prototype rules; TODO: forward references