Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Although RDL and
windows-rsin general supports both Win32 and WinRT types and they share the same ECMA-335 format for metadata definitions, WinRT types are distinct and must be identifiable as they conform to the stricter type system understood by WinRT language projections. In ECMA-335 this is represented by theWindowsRuntimetype attribute in theTypeDeftable.This update adds the ability (and requirement) that types are unambiguously defined as either WinRT or Win32. Eventually, I'll add validation to ensure that WinRT types only refer to other WinRT types, while Win32 types can refer to both WinRT and Win32 types as needed. For now, this is just a big upgrade to the RDL reader and writer to accommodate this distinction.
Each type must have either a
winrtorwin32attribute as follows:This will produce the following metadata:
Alternatively, types can inherit this attribute from the surrounding module for convenience:
In this case, both types will be defined as Win32 types. This default can also be overriden:
In this,
Ainherits thewin32attribute whileBoverrides this default.This work builds on #3861.