title: Why Go generics not support Struct as return value?
body: <p>Go version is 1.18-rc, here is my code:</p>
  <pre><code>type Dog struct {
      Name    string
      CanBark bool
  }
  
  type Cat struct {
      Name     string
      CanClimb bool
  }
  
  type Pet interface {
      Dog | Cat
  }
  
  func GetDog[p Pet]() p {
      return Dog{
          Name:    &quot;Sam&quot;,
          CanBark: true,
      }
  }
  </code></pre>
  <p>when I run the code, I got the message &quot;cannot use (Dog literal) (value of type Dog) as p value in return&quot;.</p>