Olivier Halligon 6/14/2018

Exploring @dynamicMemberLookup

Read Original

This technical article examines the @dynamicMemberLookup attribute introduced in Swift 4.2. It explains how this feature enables dynamic property resolution at runtime, discusses the controversy and potential confusion it can cause (like hiding compilation errors), and provides a code example illustrating the problem. The author then suggests ways to improve clarity by making dynamic member lookup explicit at the call site.

Exploring @dynamicMemberLookup

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week