I've always known that reference type variables are stored in the heap while value type variables are stored in the stack. Recently, I found this picture that says that ints, doubles, strings, etc. are value types, while functions and closures are reference types:

Now I'm really confused. So where are ints, doubles, strings, etc. are kept when they are defined inside a class, aka reference type? At the same type, where are functions are closures kept when defined inside a struct, aka value type?