| 
3228 | 3228 | <a href="#3227" id="3227">3227</a>  | 
3229 | 3229 | <a href="#3228" id="3228">3228</a>  | 
3230 | 3230 | <a href="#3229" id="3229">3229</a>  | 
 | 3231 | +<a href="#3230" id="3230">3230</a>  | 
 | 3232 | +<a href="#3231" id="3231">3231</a>  | 
 | 3233 | +<a href="#3232" id="3232">3232</a>  | 
 | 3234 | +<a href="#3233" id="3233">3233</a>  | 
 | 3235 | +<a href="#3234" id="3234">3234</a>  | 
 | 3236 | +<a href="#3235" id="3235">3235</a>  | 
 | 3237 | +<a href="#3236" id="3236">3236</a>  | 
 | 3238 | +<a href="#3237" id="3237">3237</a>  | 
 | 3239 | +<a href="#3238" id="3238">3238</a>  | 
 | 3240 | +<a href="#3239" id="3239">3239</a>  | 
 | 3241 | +<a href="#3240" id="3240">3240</a>  | 
 | 3242 | +<a href="#3241" id="3241">3241</a>  | 
 | 3243 | +<a href="#3242" id="3242">3242</a>  | 
 | 3244 | +<a href="#3243" id="3243">3243</a>  | 
 | 3245 | +<a href="#3244" id="3244">3244</a>  | 
 | 3246 | +<a href="#3245" id="3245">3245</a>  | 
 | 3247 | +<a href="#3246" id="3246">3246</a>  | 
 | 3248 | +<a href="#3247" id="3247">3247</a>  | 
3231 | 3249 | </pre></div><pre class="rust"><code><span class="kw">use </span>std::num::NonZeroU32;  | 
3232 | 3250 | 
 
  | 
3233 | 3251 | <span class="kw">use </span><span class="kw">crate</span>::front::wgsl::error::{Error, ExpectedToken, InvalidAssignmentType};  | 
 | 
5414 | 5432 |             <span class="prelude-val">Some</span>(<span class="kw-2">&</span>LoweredGlobalDecl::Function(function)) => {  | 
5415 | 5433 |                 <span class="kw">let </span>arguments = arguments  | 
5416 | 5434 |                     .iter()  | 
5417 |  | -                    .map(|<span class="kw-2">&</span>arg| <span class="self">self</span>.expression(arg, ctx))  | 
 | 5435 | +                    .enumerate()  | 
 | 5436 | +                    .map(|(i, <span class="kw-2">&</span>arg)| {  | 
 | 5437 | +                        <span class="comment">// Try to convert abstract values to the known argument types  | 
 | 5438 | +                        </span><span class="kw">let </span><span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="kw">crate</span>::FunctionArgument {  | 
 | 5439 | +                            ty: parameter_ty, ..  | 
 | 5440 | +                        }) = ctx.module.functions[function].arguments.get(i)  | 
 | 5441 | +                        <span class="kw">else </span>{  | 
 | 5442 | +                            <span class="comment">// Wrong number of arguments... just concretize the type here  | 
 | 5443 | +                            // and let the validator report the error.  | 
 | 5444 | +                            </span><span class="kw">return </span><span class="self">self</span>.expression(arg, ctx);  | 
 | 5445 | +                        };  | 
 | 5446 | + | 
 | 5447 | +                        <span class="kw">let </span>expr = <span class="self">self</span>.expression_for_abstract(arg, ctx)<span class="question-mark">?</span>;  | 
 | 5448 | +                        ctx.try_automatic_conversions(  | 
 | 5449 | +                            expr,  | 
 | 5450 | +                            <span class="kw-2">&</span><span class="kw">crate</span>::proc::TypeResolution::Handle(parameter_ty),  | 
 | 5451 | +                            ctx.ast_expressions.get_span(arg),  | 
 | 5452 | +                        )  | 
 | 5453 | +                    })  | 
5418 | 5454 |                     .collect::<<span class="prelude-ty">Result</span><Vec<<span class="kw">_</span>>, <span class="kw">_</span>>>()<span class="question-mark">?</span>;  | 
5419 | 5455 | 
 
  | 
5420 | 5456 |                 <span class="kw">let </span>has_result = ctx.module.functions[function].result.is_some();  | 
 | 
0 commit comments