> On Nov 13, 2017, at 10:27 PM, Chris Lattner via swift-evolution > <[email protected]> wrote: > > > >> On Nov 13, 2017, at 1:45 AM, Adrian Zubarev <[email protected] >> <mailto:[email protected]>> wrote: >> >> Hello Chris, I have some questions about this passage: >> >> Before this proposal, the Swift language has two types that participate in >> call syntax: functions and metatypes (for initialization). Neither of those >> may conform to protocols at the moment, so this introduces no possible >> ambiguity into the language. >> Can you shortly describe why it would be ambiguous if metatypes would >> conform to protocols? >> > It would only be ambiguous if a metatype conformed to the DynamicCallable > protocol specifically. This can’t happen today, and if it happened, we could > easily define disambiguation rules.
FWIW it looks like we don’t allow calling a value of metatype type as of Swift 3 — you have to add ‘.init’: t.swift:6:4: error: initializing from a metatype value must reference 'init' explicitly m() ^ .init Slava > > -Chris > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
