Skip to content

Commit

Permalink
Support ByRefLike types as Generic parameters (#67783)
Browse files Browse the repository at this point in the history
* Add flag for ByRefLike generic constraint

* Update ILAsm/ILDasm to support byreflike keyword

* Runtime and Libraries tests

* Cast defined int constant until managed API is approved.
  • Loading branch information
AaronRobinsonMSFT authored Apr 18, 2022
1 parent 9a139b3 commit 6be799e
Show file tree
Hide file tree
Showing 32 changed files with 3,526 additions and 2,683 deletions.
2 changes: 1 addition & 1 deletion eng/pipelines/common/templates/runtimes/build-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- ${{ each variable in parameters.variables }}:
- ${{ variable }}
- name: liveRuntimeBuildParams
value: 'libs.sfx+libs.oob /p:RefOnly=true -c Release -ci'
value: 'libs.sfx+libs.oob+clr.iltools /p:RefOnly=true -c Release -ci'
- name: compilerArg
value: ''
- ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc')) }}:
Expand Down
4 changes: 3 additions & 1 deletion src/coreclr/ilasm/asmparse.y
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
%token UINT_ UINT8_ UINT16_ UINT32_ UINT64_ FLAGS_ CALLCONV_ MDTOKEN_
%token OBJECT_ STRING_ NULLREF_
/* misc keywords */
%token DEFAULT_ CDECL_ VARARG_ STDCALL_ THISCALL_ FASTCALL_ CLASS_
%token DEFAULT_ CDECL_ VARARG_ STDCALL_ THISCALL_ FASTCALL_ CLASS_ BYREFLIKE_
%token TYPEDREF_ UNMANAGED_ FINALLY_ HANDLER_ CATCH_ FILTER_ FAULT_
%token EXTENDS_ IMPLEMENTS_ TO_ AT_ TLS_ TRUE_ FALSE_ _INTERFACEIMPL

Expand Down Expand Up @@ -486,7 +486,9 @@ typarAttrib : '+' { $$ = gpCovariant;
| '-' { $$ = gpContravariant; }
| CLASS_ { $$ = gpReferenceTypeConstraint; }
| VALUETYPE_ { $$ = gpNotNullableValueTypeConstraint; }
| BYREFLIKE_ { $$ = gpAcceptByRefLike; }
| _CTOR { $$ = gpDefaultConstructorConstraint; }
| FLAGS_ '(' int32 ')' { $$ = (CorGenericParamAttr)$3; }
;

typarAttribs : /* EMPTY */ { $$ = 0; }
Expand Down
Loading

0 comments on commit 6be799e

Please sign in to comment.