Interface fails to work because I have a class named Context.

Bug

When you try to extend from NSViewRepresentable but you have a class named Context swift throws a error message that doesn't help at all.


Type 'MetalViewRepresentable' does not conform to protocol 'NSViewRepresentable'

Steps to reproduce

  1. Create a MacOS App
  2. Copy this code
struct MetalViewRepresentable: NSViewRepresentable {
  @Binding var metalView: MTKView

  func makeNSView(context: Context) -> some NSView {
    metalView
  }

  func updateNSView(_ uiView: NSViewType, context: Context) {
  }
}
  1. Write this line of code in any file
class Context {}
Interface fails to work because I have a class named Context.
 
 
Q