diff options
author | Marek Safar <marek.safar@gmail.com> | 2017-05-23 09:35:58 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-05-23 09:41:04 +0300 |
commit | a0fc3f4dcf571edc997f53066c09671650e96670 (patch) | |
tree | a6b0e207eafd02b0c6c4b094e2a54f4968e179df /mcs/errors | |
parent | 872976e6c680c0547e4f9681300907a6cd510a23 (diff) |
[mcs] When setting struct empty layout consider compiler generated fields. Fixes #55604
Diffstat (limited to 'mcs/errors')
-rw-r--r-- | mcs/errors/cs0208-19.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mcs/errors/cs0208-19.cs b/mcs/errors/cs0208-19.cs new file mode 100644 index 00000000000..82b0f4395e3 --- /dev/null +++ b/mcs/errors/cs0208-19.cs @@ -0,0 +1,20 @@ +// CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type `CS208.Foo' +// Line: 17 +// Compiler options: -unsafe + +namespace CS208 +{ + public struct Foo + { + public string PP { get; set; } + } + + public class Bar + { + unsafe static void Main () + { + Foo f = new Foo (); + void *s = &f; + } + } +} |