<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=""><div class="">Dany,</div><div class=""><br class=""></div><div class="">I've already updated my working copy of the proposal to change that to not requiring the leading dot based on feedback.</div><div class=""><br class=""></div><div class="">-- E</div><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 14, 2016, at 6:24 AM, Dany St-Amant via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">Le 13 févr. 2016 à 15:29, David Waite via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">Erica,</div><div class=""><br class=""></div><div class="">The current spec has the following line:</div><div class="" style="font-size: 8px;"><br class="" style="font-size: 8px;"></div><div class="" style="font-size: 8px;"><blockquote type="cite" class="" style="font-size: 8px;"><div class="" style="font-size: 8px;"><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 8px;"><div class="" style="font-size: 8px;"><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 12px; background-color: rgb(255, 255, 255);"><pre class="" style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;"><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">static</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">func</span> <span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">staticFunc2</span>() { <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> foo <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span>Tails } <span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// requires leading dot</span></pre></div></div></div></div></blockquote></div><div class="">The leading dot requirement does not exist today for references to static properties and functions from a static function.</div></div></div></blockquote><div class=""><br class=""></div>After focusing on this line and on the error we get back when trying it now in playground, I no longer see the reported inconsistent as such, but just as a clash of two permissible syntax, which if changed as proposed will just swap an inconsistency for another one.</div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">For those wondering, the reported error is: type of expression is ambiguous without more context</div><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><br class=""></div><div class="">The shorthand syntax is to be used when the compiler, and the programmer knows what the type is. In the above example, why should the compile infer that variable foo is of type Coin. It would make more sense for that particular function to be:</div><div class=""><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">static</span><span class="Apple-converted-space"> </span><span class="" style="color: rgb(187, 44, 162);">func</span><span class="Apple-converted-space"> </span>staticFunc2() {<span class="Apple-converted-space"> </span><span class="" style="color: rgb(187, 44, 162);">let</span><span class="Apple-converted-space"> </span>foo =<span class="Apple-converted-space"> </span><span class="" style="color: rgb(79, 129, 135);">Coin</span>.Tails }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">static</span><span class="Apple-converted-space"> </span><span class="" style="color: rgb(187, 44, 162);">func</span><span class="Apple-converted-space"> </span>staticFunc2() {<span class="Apple-converted-space"> </span><span class="" style="color: rgb(187, 44, 162);">let</span><span class="Apple-converted-space"> </span>foo:<span class="" style="color: rgb(79, 129, 135);">Coin</span><span class="Apple-converted-space"> </span>= .Tails }</div><div class=""> </div><div class="">And be consistent with (both at a global scope or as static inside the enum):</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">let</span><span class="Apple-converted-space"> </span>firstCoin:<span class="" style="color: rgb(79, 129, 135);">Coin</span><span class="Apple-converted-space"> </span>= .H<span class="" style="color: rgb(49, 89, 93);">eads</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">let</span><span class="Apple-converted-space"> </span>secondCoin =<span class="Apple-converted-space"> </span><span class="" style="color: rgb(79, 129, 135);">Coin</span>.T<span class="" style="color: rgb(49, 89, 93);">ails</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">let</span> thirdCoin = .Heads<span class="Apple-converted-space"> </span><span class="" style="color: rgb(0, 132, 0);">// not allowed</span></div><div class=""><span class="" style="color: rgb(0, 132, 0);"><br class=""></span></div></div><div class="">The apparent inconsistency seems to stem from the compiler doing an implicit equivalent of:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"><span class="" style="color: rgb(187, 44, 162);">let</span><span class="Apple-converted-space"> </span>heads =<span class="Apple-converted-space"> </span><span class="" style="color: rgb(79, 129, 135);">Coin</span>.<span class="" style="color: rgb(49, 89, 93);">heads</span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="color: rgb(187, 44, 162);">let</span><span class="Apple-converted-space"> </span>tails =<span class="Apple-converted-space"> </span><span class="" style="color: rgb(79, 129, 135);">Coin</span>.<span class="" style="color: rgb(49, 89, 93);">tails</span></div><div class=""><span class="" style="color: rgb(49, 89, 93);"><br class=""></span></div></div><div class="">If one define these on its own at a global level, the same inconsistent use of the leading dot is present everywhere.</div><div class=""><br class=""></div><div class="">I’m thinking that the proposal as stated "mandate leading dot" is wrong, it should be redone as "prevent direct access to the implicit static let auto-generated for the enum case within the enum declaration". Unfortunately, I do not know if there are legit use of this implicit static let in the wild.</div><div class=""><br class=""></div><div class="">This way, for the staticFunc2 we get:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> staticFunc2() { <span class="" style="color: rgb(187, 44, 162);">let</span> foo = <span class="" style="color: rgb(79, 129, 135);">Coin</span>.Tails } <span class="" style="color: rgb(0, 132, 0);">// Acceptable</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> staticFunc2() { <span class="" style="color: rgb(187, 44, 162);">let</span> foo:<span class="" style="color: rgb(79, 129, 135);">Coin</span> = .Tails }<span class="Apple-converted-space"> </span><span class="" style="color: rgb(0, 132, 0);">// Acceptable</span></div></div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> staticFunc2() { <span class="" style="color: rgb(187, 44, 162);">let</span> foo = Tails } <span class="" style="color: rgb(0, 132, 0);">// New error, no longer accessible</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> staticFunc2() { <span class="" style="color: rgb(187, 44, 162);">let</span> foo = .Tails } <span class="" style="color: rgb(0, 132, 0);">// Current error, ambiguous</span></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Dany</div><div class=""><br class=""></div></div><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">Is your proposal to:</div><div class="">- require a dot in front of static properties/functions in this case as well for consistency across all static things</div><div class="">- require a dot only in front of the case statements, to promote consistency only for use of cases within an enum</div><div class="">- or, do you wish to change your mind about this particular case?</div><div class=""><br class=""></div><div class="">-DW</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 13, 2016, at 12:31 PM, Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">No. The wildcard match does not require a dot prefix.</div><div class=""><br class=""></div><div class="">-- E</div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 13, 2016, at 10:40 AM, Paul Ossenbruggen via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I am assuming there would be no dot in front of _? <div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="" style="font-size: 17px;">switch value {</div><div class="" style="font-size: 17px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>case .A: “A”</div><div class="" style="font-size: 17px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>case .B: “B”</div><div class="" style="font-size: 17px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>case ._:”D” // this is not correct?</div><div class="" style="font-size: 17px;">}</div></div><div class="" style="font-size: 17px;"><br class=""></div><div class="" style="font-size: 17px;"><br class=""></div><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 13, 2016, at 9:18 AM, Joseph Lord via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="auto" class=""><div class=""></div><div class="">+1</div><div class=""><br class=""></div><div class="">Didn't even know it was legal. Definitely increases consistency and simplifies the language. </div><div class=""><br class=""></div><div class="">J</div><div class=""><br class="">On Feb 12, 2016, at 3:00 AM, Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><a href="https://gist.github.com/erica/e0b8a3a22ab716a19db4" class="">https://gist.github.com/erica/e0b8a3a22ab716a19db4</a><div class=""><br class=""></div><div class=""><h1 class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;">Requiring Leading Dot Prefixes for Enum Instance Member Implementations</h1><ul class="" style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);"><li class="" style="box-sizing: border-box;"><br class=""></li></ul></div></div></blockquote></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class="" style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></body></html>