Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test plan for "using aliases for any types" #56323

Closed
36 of 37 tasks
jcouv opened this issue Sep 10, 2021 · 3 comments
Closed
36 of 37 tasks

Test plan for "using aliases for any types" #56323

jcouv opened this issue Sep 10, 2021 · 3 comments

Comments

@jcouv
Copy link
Member

jcouv commented Sep 10, 2021

Championed proposal: dotnet/csharplang#4284
Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-12.0/using-alias-types.md

Note this doesn't include support for generic aliases (draft spec dotnet/csharplang#4452)

Compiler

  • LangVer (tests with RegularNext or CSharpNext)
  • spec: https://github.com/dotnet/csharplang/blob/main/proposals/using-alias-types.md
    • Consider documenting rule that unsafe aliases are also checked at usage point
  • LDM: using unsafe or unsafe using? LDM decision 2/1/2023. using unsafe. This keeps all the using forms consistent that they start with using (or global using).
  • Various types:
    • tuples (need positive test)
    • built-in types: int, nint, ...
    • array types
    • pointer and function pointer
    • ref type (StaticUsingDirectiveRefType)
    • dynamic
    • nullable reference types (disallowed: using X = object?;, using X = Y?; where Y is another alias) (AliasUsingNullableReferenceType)
  • unsafe requires proper compilation flag
  • using unsafe in a non-alias using (see UsingUnsafeNonAlias)
  • global alias (with and without unsafe) (see GlobalAliasToType...)
  • duplicate alias (ERR_DuplicateAlias)
  • semantic model: GetTypeInfo on the RHS, IAliasSymbol.Target, GetAliasInfo
  • SyntaxNormalizer (using unsafe x = ..., using x = (one, two);, ...)
  • Obsolete: using X = (ObsoleteType, ObsoleteType);, using X = ObsoleteType[];
  • EnC: Yes. Needs tests. See TopLevelEditingTests.Using_Global_Insert
  • using T = dynamic; where a dynamic type already exists. AliasUsingDirectiveDynamic4 and AliasUsingDirectiveDynamic4.
  • using unsafe X = int; then use X in safe context (no diagnostic). TestUnsafeAlias14_A, TestUnsafeAlias14_B
  • using X = scoped R;. TestScopedType1-4
  • using X = ref readonly R; AliasUsingDirectiveRefReadonlyType
  • using X = __makeref(...);. TestMakeRef
  • using X = __arglist();. TestArgList
  • review public API changes. Done: API proposal for "Using Alias to any Type" #66913
  • inspect the syntactic pointer type detection logic in compiler (is there a circularity issue?). Have made the change to no longer do things syntactically. Added tests to ensure no issue (TestStructWithReferenceToItselfThroughAliasPointer1/2). But need eyes on this.
  • debugger support (using X = dynamic; inspect a value of type X). Added in Update PDB behavior for 'using alias to type', and add EE and PDB tests. #67105
  • add an EE test. Added in Update PDB behavior for 'using alias to type', and add EE and PDB tests. #67105.
  • LDM: should we allow unsafe on using static? (using static C<int*[]>; is already legal, warning wave?)

Productivity

  • Completion
  • Completion on dynamic
  • Classification
  • QuickInfo
  • Formatting
  • Rename tracking
@jcouv jcouv added this to the Compiler.Next milestone Sep 10, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 10, 2021
@tmat
Copy link
Member

tmat commented Sep 10, 2021

Note this will need a design and updated spec of custom debug information for PDBs - at least for Portable PDBs. We can decide to not make this available in EEs when Windows PDBs are used. If we support Windows PDBs the CDIs need to be designed for Windows PDBs as well. The format for Windows PDBs is different than Portable.

@jcouv
Copy link
Member Author

jcouv commented Mar 7, 2023

Checked the test plan and it can be marked as completed now. Any further issues should be tracked by individual issues. Thanks

@jcouv jcouv closed this as completed Mar 7, 2023
@CyrusNajmabadi
Copy link
Member

Thanks julien :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants