diff options
| author | Yong He <yonghe@outlook.com> | 2025-06-04 13:05:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-04 13:05:58 -0700 |
| commit | 812e478989e27983b8dea7ab11964de751654ba2 (patch) | |
| tree | e6db6def9c7896ee48c5fe42926856644e81c0e6 /source/slang/core.meta.slang | |
| parent | b9dc21d362f65f22bc707bede733a9537b80460a (diff) | |
Make interface types non c-style in Slang2026. (#7260)
* Make interface types non c-style.
* Make Optional<T> work with autodiff and existential types.
* Fix.
* patch behind slang 2026.
* Fix warnings.
* cleanup.
* Fix tests.
* Fix.
* Fix com interface lowering.
* Add comment to test.
* regenerate command line reference
* Add test for passing `none` to autodiff function.
* Fix recording of `getDynamicObjectRTTIBytes`.
* Fix nested Optional types.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/slang/core.meta.slang')
| -rw-r--r-- | source/slang/core.meta.slang | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang index 140c9ba16..484f51bfc 100644 --- a/source/slang/core.meta.slang +++ b/source/slang/core.meta.slang @@ -1463,7 +1463,7 @@ typealias __Addr<T> = Ptr<T, $( (uint64_t)AddressSpace::Generic)ULL>; __generic<T> __magic_type(OptionalType) __intrinsic_type($(kIROp_OptionalType)) -struct Optional +struct Optional : IDefaultInitializable { /// Return `true` iff this `Optional` contains a value of type `T` property bool hasValue @@ -1482,6 +1482,9 @@ struct Optional __implicit_conversion($(kConversionCost_ValToOptional)) __intrinsic_op($(kIROp_MakeOptionalValue)) __init(T val); + + [__unsafeForceInlineEarly] + __init() { this = none; } }; //@hidden: |
