<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Do you have a member named ‘type’ in the current scope?<div class=""><br class=""></div><div class="">We changed the behavior of type(of:) so that it behaves like a normal declaration in the Swift module instead of a special keyword. Unfortunately this means if you have a ‘type’ already visible in scope, you have to fully qualify Swift.type(of:).</div><div class=""><br class=""></div><div class="">Slava</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 19, 2017, at 11:18 AM, Edward Connell via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">When running the compiler using the "-swift-version 4" flag, the compiler complains about creating a dynamic type. Errors are flagged from within concrete base classes and also within protocol extensions.<br class=""><div class=""><br class=""></div><div class=""><div class=""><i class="">error: cannot invoke 'type' with an argument list of type '(of: Self)'</i></div><div class=""><i class=""> let newObject = type(of: self).init()</i></div></div><div class=""><br class=""></div><div class="">Has this changed?? Are we supposed to create dynamic types a different way now?</div><div class=""><br class=""></div><div class="">Thanks, Ed</div></div>
_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></div></body></html>