fluent-kit icon indicating copy to clipboard operation
fluent-kit copied to clipboard

Page<T> where T: Encodable does not seem to be allowed to be extendable

Open jcbriones opened this issue 3 years ago • 1 comments

Describe the bug

Not sure if this is really a bug but I'm trying to extend the Page struct from FluentKit on my project and it's saying that the T is not conforming to Encodable but it seems it is extending the Page to Encodable. I am guessing it migh be because the extension was internal and not set to public? This is the error I am getting image Type 'T' does not conform to protocol 'Encodable'

To Reproduce

Steps to reproduce the behavior:

  1. Create a protocol and inside the protocol to use the page's items.
  2. Create an extension for Page that uses the protocol
  3. You'll get the error that T is not encodable.

Expected behavior

That T is encodable even when used in an extension.

Environment

  • Vapor Framework version: 4.69.2
  • Vapor Toolbox version: Not installed
  • OS version: MacOS 13.2

Additional context

You can message me directly if you'd like to do one on one to figure out the issue.

jcbriones avatar Feb 08 '23 18:02 jcbriones

Just realized that T does not conform to Encodable or Decodable. It's just an extension where T is encodable or decodable. Is there a reason why T does not directly conform to codable?

jcbriones avatar Feb 08 '23 20:02 jcbriones