<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/diagnostics/enum-implicit-conversion.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-04-01T22:56:02+00:00</updated>
<entry>
<title>Allow bit operators on enum types. (#3862)</title>
<updated>2024-04-01T22:56:02+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2024-04-01T22:56:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2c4f9810327d58023e9ec44f579cd78adf56317b'/>
<id>urn:sha1:2c4f9810327d58023e9ec44f579cd78adf56317b</id>
<content type='text'>
* Allow bit operators on enum types.

* Fix.</content>
</entry>
<entry>
<title>Feature/test improvements (#934)</title>
<updated>2019-04-02T13:22:13+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2019-04-02T13:22:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2896aa39a529a00673a30ef4a9c3ebe76f401fea'/>
<id>urn:sha1:2896aa39a529a00673a30ef4a9c3ebe76f401fea</id>
<content type='text'>
* First pass extract the test information by 'running tests'.

* * Checking renderer availablilty
* Using TestInfo to determine which tests are run and synthesized
* Display if test is synthesized and what render api it's targetting

* * Improved comments
* Removed some dead code

* Display ignored tests.

* TestInfo -&gt; TestRequirements

* * Added DIAGNOSTIC_TEST type - test always runs (ie has no requirements).
* Made diagnostic tests use DIAGNOSTIC_TEST
* TestInfo -&gt; TestRequirements
* TestDetails holds TestRequirements and TestOptions

* Fix debug typo.
</content>
</entry>
<entry>
<title>Overhaul the core routines for implicit conversion (#927)</title>
<updated>2019-03-27T14:50:46+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2019-03-27T14:50:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=047adbd4dd3dd6e3098adcb63a8ac475ae06d20d'/>
<id>urn:sha1:047adbd4dd3dd6e3098adcb63a8ac475ae06d20d</id>
<content type='text'>
* Overhaul the core routines for implicit conversion

The main user-visible change is that we have fixed the bug where conversions that should only be allowed explicitly were being allowed implicitly. This might be seen as a regression by users, so we'll have to be careful when rolling out the fix.

The core of that fix involves checking whether an `init` declaration that will be invoked as an implicit conversion actually supports implicit conversions.

The main visible change in the code is some renamings to try and help make the core type-coercion routines better fit our naming conventions.

The main cleanup is to enforce the invariant that any of the implicit-conversion core routines will always emit a diagnostic (or have a subroutine it calls do so) when conversion fails and the `outToExpr` parameter is non-null. This is a small change, but should improve the user experience if an implicit conversion fails in the context of a single element of an initializer list (the error should point at the line in question, and not at the whole list).

The big thing that is impacted by removing the ability to use explicit conversions implicitly is conversion of `enum` types to integers. This was intended to be explicit (a la `enum class` in C++), but the bug made it so that implicit conversion was allowed.

Closing up that gap meant that some of the checking around user-defined attributes got wonky, because we attempt to check that the attribute argument is an integer constant expression, but an `enum` case can't possible be an integer constant - it is a value of the `enum` type. I added code to work around that issue by having a parallel path for checking compile-time-constant expressions of `enum` type, but it is clear that a more general solution is needed eventually.

* fixup: test case needs explicit cast
</content>
</entry>
</feed>
