<div dir="ltr">In 0.95, this fails:<div>---<br>type file;<br><br>(float result) pow (float x, float y)<br>{<br> result = java("java.lang.Math", "pow", x, y);<br>}<br><br>float f = pow(2.0, 2.0);<br>tracef("%f\n", f);<br>
---</div><div><br></div><div>But when I replace java() with @java() it works for me...</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 6, 2014 at 6:20 PM, Michael Wilde <span dir="ltr"><<a href="mailto:wilde@anl.gov" target="_blank">wilde@anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm dusting off some old Swift code and running into errors which seem<br>
to stem from changes in type checking and/or casting.<br>
<br>
This used to work in a prior release (will need to track down which):<br>
<br>
(float result) pow (float x, float y)<br>
{<br>
result = java("java.lang.Math", "pow", x, y);<br>
}<br>
<br>
In trunk, it now gives:<br>
<br>
Swift trunk swift-r7759 cog-r3890<br>
RunID: run007<br>
Could not start execution:<br>
Compile error in procedure invocation at line 50:<br>
You cannot assign value of type any to a variable of type float<br>
<br>
(50 is line before result=...)<br>
<br>
Any thoughts on why?<br>
<br>
A similar error occurs on string results.<br>
<br>
I'll file a ticket.<br>
<br>
Thanks,<br>
<br>
- Mike<br>
<br>
_______________________________________________<br>
Swift-devel mailing list<br>
<a href="mailto:Swift-devel@ci.uchicago.edu">Swift-devel@ci.uchicago.edu</a><br>
<a href="https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel" target="_blank">https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel</a><br>
</blockquote></div><br></div>