Why is "UUserWidget is not a type name" when I try to declare the variable?

Bit of a late reply but I ran into this problem… Needed to add UMG, Slate and SlateCore to the public dependencies in the build file, check out: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums