<div dir="ltr">This problem seems to occur when using an initializer with some default argument values. The following code also exhibits the issue:<div><br></div><div><div>struct Bar {</div><div> init(x: Int, y: Int? = 42) { }</div><div>}</div><div><br></div><div>class Foo {</div><div> lazy var myQ = Bar(x: 3)</div><div>}</div></div><div><br></div><div><br></div><div>I'd recommend filing a bug at <a href="http://bugs.swift.org">bugs.swift.org</a>.</div><div class="gmail_extra">
<br><div class="gmail_quote">On Sun, Sep 11, 2016 at 10:19 PM, Rick Mann via swift-users <span dir="ltr"><<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I get this error in the following code: "Type of expression is ambiguous without more context", on the DispatchQueue. But only if I mark it as "lazy", and not if I don't. I'm not sure why.<br>
<br>
class<br>
myClass<br>
{<br>
lazy var myQ = DispatchQueue(label: "Op", attributes: .concurrent) // <-- ERROR<br>
^Type of expression is ambiguous without more context<br>
}<br>
<br>
Would someone please explain? Thank you.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Rick Mann<br>
<a href="mailto:rmann@latencyzero.com">rmann@latencyzero.com</a><br>
<br>
<br>
______________________________<wbr>_________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
</font></span></blockquote></div><br></div></div>