diff options
author | Marek Safar <marek.safar@gmail.com> | 2017-05-30 00:55:47 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-05-30 00:57:00 +0300 |
commit | 1782b291f89dd8f8b95cd3caeca5264672457cb8 (patch) | |
tree | 25cb950db5b5935a0012e826375f79c5c0a7430f /mcs/errors | |
parent | 7b51e84dc54d1b846e712d5f0a41dadda766aa5a (diff) |
[mcs] New property/indexer cannot have accessors implementing an interface in base type. Fixes #56627
Diffstat (limited to 'mcs/errors')
-rw-r--r-- | mcs/errors/cs0535-7.cs | 40 | ||||
-rw-r--r-- | mcs/errors/cs0535-8.cs | 40 |
2 files changed, 80 insertions, 0 deletions
diff --git a/mcs/errors/cs0535-7.cs b/mcs/errors/cs0535-7.cs new file mode 100644 index 00000000000..11a7670bc1b --- /dev/null +++ b/mcs/errors/cs0535-7.cs @@ -0,0 +1,40 @@ +// CS0535: `CC' does not implement interface member `IA.Coordinate.set' +// Line: 33 + +using System; + +public interface IA +{ + object Coordinate { + get; + set; + } +} + +public abstract class CA : IA +{ + public abstract object Coordinate { + get; + set; + } +} + +public partial class CB : CA +{ + public override object Coordinate { + get { + throw new NotImplementedException (); + } + set { + } + } +} + +public class CC : CB, IA +{ + public new object Coordinate { + get { + throw new NotImplementedException (); + } + } +} diff --git a/mcs/errors/cs0535-8.cs b/mcs/errors/cs0535-8.cs new file mode 100644 index 00000000000..853794ee31d --- /dev/null +++ b/mcs/errors/cs0535-8.cs @@ -0,0 +1,40 @@ +// CS0535: `CC' does not implement interface member `IA.this[int].set' +// Line: 33 + +using System; + +public interface IA +{ + object this[int arg] { + get; + set; + } +} + +public abstract class CA : IA +{ + public abstract object this[int arg] { + get; + set; + } +} + +public partial class CB : CA +{ + public override object this[int arg] { + get { + throw new NotImplementedException (); + } + set { + } + } +} + +public class CC : CB, IA +{ + public new object this[int arg] { + get { + throw new NotImplementedException (); + } + } +} |