<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Thanks Dmitri,<div><br></div><div>Does the first statements I posted without .value compile at this time?</div><div>Or give a better error than I was receiving?</div></div><div dir="ltr"><div><br></div><div>Adam</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 4, 2016 at 3:46 PM Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Mar 3, 2016 at 7:54 PM, Adam Campbell via swift-users<br>
<<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:<br>
> Discovered this when trying to answer a stackoverflow question about setting<br>
> character values in a CCString array.<br>
><br>
> The following code produces an ambiguous error:<br>
> var buff = [CChar](count: 5, repeatedValue: 0)<br>
> buff[0] = "A".utf8.first!.value // Error - Cannot assign value of type<br>
> 'Int8' to type 'CChar' (aka 'Int8')<br>
><br>
> I can easily get around this by changing the second line to:<br>
> buff[0].value = "A".utf8.first!.value<br>
><br>
> Can someone explain what is happening here? As well as the significance of<br>
> Int8.value?<br>
<br>
The 'var value' property used to be a property of type Builtin.Int8,<br>
which maps directly to LLVM's i8. This is a part of the integers<br>
implementation, and it was renamed to 'var _value' a while ago.<br>
Please don't use this property. The code that you posted (that<br>
accesses '.value') does not compile anymore.<br>
<br>
Dmitri<br>
<br>
--<br>
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>>*/<br>
</blockquote></div></div></div>