Hi everyone,

I'm puzzled by the following behaviour in Swift 2.2. This code compiles and
behaves as expected:

  protocol Executable {}
  class Box<T: Any> {}
  let box = Box<Executable>()

If I now replace the type constraint on T with Executable, I'm getting a
compiler error:

  protocol Executable {}
  class Box<T: *Executable*> {}
  let box = Box<Executable>()

>From a type-theoretic perspective, I can't see why instantiating class Box
with type Executable should be prohibited. Also the corresponding error
message isn't really providing more insights: "Using 'Executable' as a
concrete type conforming to protocol 'Executable' is not supported".

Where can I find more about this behaviour in the Swift Language
Specification? Is this a known bug?

Thanks,
  Matthias
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to