Skip to content

Instantly share code, notes, and snippets.

@berikv
Created October 16, 2021 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berikv/c4eb33f3316c4a9fb0638981b53bfadb to your computer and use it in GitHub Desktop.
Save berikv/c4eb33f3316c4a9fb0638981b53bfadb to your computer and use it in GitHub Desktop.
Static member cannot be used on protocol metatype
protocol P {}
struct S: P {}
extension P {
static var a: P { S() }
}
let v = P.a
// error: static member 'a' cannot be used on protocol metatype 'P.Protocol'
// let v = P.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment