<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/language-feature/generics/partial-generic-argument-inference.slang, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2024-06-10T20:28:36+00:00</updated>
<entry>
<title>enable more metal tests (#4326)</title>
<updated>2024-06-10T20:28:36+00:00</updated>
<author>
<name>skallweitNV</name>
<email>64953474+skallweitNV@users.noreply.github.com</email>
</author>
<published>2024-06-10T20:28:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=712ce653d4c3d7284dd71389f31540d0da7f144e'/>
<id>urn:sha1:712ce653d4c3d7284dd71389f31540d0da7f144e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Metal compute tests (#4292)</title>
<updated>2024-06-07T07:28:16+00:00</updated>
<author>
<name>skallweitNV</name>
<email>64953474+skallweitNV@users.noreply.github.com</email>
</author>
<published>2024-06-07T07:28:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=004fe27a52b7952111ad7e749397aeff499de7ed'/>
<id>urn:sha1:004fe27a52b7952111ad7e749397aeff499de7ed</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Support partial inference of generic arguments (#2404)</title>
<updated>2022-09-20T19:37:33+00:00</updated>
<author>
<name>Theresa Foley</name>
<email>10618364+tangent-vector@users.noreply.github.com</email>
</author>
<published>2022-09-20T19:37:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=5ac7ba2c6d3405f1a59f4350c753ec990af8f6dc'/>
<id>urn:sha1:5ac7ba2c6d3405f1a59f4350c753ec990af8f6dc</id>
<content type='text'>
A commonly requested feature is to be able to supply only some
of the arguments to a generic explicitly, while allowing the rest
to be inferred. A common example is a function that performs some
kind of conversion:

    To convert&lt;To, From&gt;( From fromValue ) { .... }

A user would like to be able to call this operation like:

    int i = convert&lt;int&gt;( 1.0f );

but the current Slang type checker requires all or none of the generic
arguments be supplied. Supplying all of the arguments is tedious:

    int i = convert&lt;int, float&gt;( 1.0f );

In this case, the `float` type argument is redundant and could be
inferred from context. However, if the user tries to omit the generic
argument list:

    int i = convert( 1.0f );

The current type-checker cannot infer the `int` type argument (even if
one might claim it *should* infer based on the desired result type).

This change adds support for the `convert&lt;int&gt;(...)` case, by allowing
a generic to be applied to a prefix of its explicit arguments, and then
inferring the remaining arguments from contextual information when that
"partially applied" generic is applied to value-level arguments.

Most of the changes are just plumbing: adding the notion of a partially
applied generic and then supporting them during overload resolution.

A single test case is included that covers the `convert`-style use case.
It is likely that more testing is needed to cover failure modes of this
feature.</content>
</entry>
</feed>
