Getting "'string' does not name a type" Error

Try String instead.

Better still, don't use String at all.