Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More thorough check for managed type parameters. Fixes #14347
- Loading branch information
1 parent
17e5901
commit 0e31ea6
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type `T' | ||
// Line: 7 | ||
// Compiler options: -unsafe | ||
|
||
unsafe class Foo<T> where T : struct | ||
{ | ||
public T* Elements { | ||
get { | ||
return null; | ||
} | ||
} | ||
} |
This file contains 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