Browse Source

Prevented any change of access for inherited virtual properties.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/512/merge
Dimitar Dobrev 10 years ago
parent
commit
25f2b4a1f9
  1. 7
      tests/Basic/Basic.Tests.cs
  2. 18
      tests/Basic/Basic.cpp
  3. 14
      tests/Basic/Basic.h

7
tests/Basic/Basic.Tests.cs

@ -4,8 +4,15 @@ using NUnit.Framework; @@ -4,8 +4,15 @@ using NUnit.Framework;
using BasicTest;
using Enum = BasicTest.Enum;
[TestFixture]
public class BasicTests : GeneratorTestFixture
{
[Test]
public void TestUncompilableCode()
{
Assert.That(new ChangedAccessOfInheritedProperty().Property, Is.EqualTo(2));
}
[Test]
public void TestHello()
{

18
tests/Basic/Basic.cpp

@ -407,3 +407,21 @@ bool DifferentConstOverloads::operator ==(int number) const @@ -407,3 +407,21 @@ bool DifferentConstOverloads::operator ==(int number) const
{
return false;
}
int HasVirtualProperty::getProperty()
{
return 1;
}
void HasVirtualProperty::setProperty(int value)
{
}
int ChangedAccessOfInheritedProperty::getProperty()
{
return 2;
}
void ChangedAccessOfInheritedProperty::setProperty(int value)
{
}

14
tests/Basic/Basic.h

@ -750,3 +750,17 @@ struct CS_VALUE_TYPE ValueTypeArrays @@ -750,3 +750,17 @@ struct CS_VALUE_TYPE ValueTypeArrays
char thirdValueTypeArray[ARRAY_LENGTH];
size_t size;
};
class DLL_API HasVirtualProperty
{
public:
virtual int getProperty();
virtual void setProperty(int value);
};
class DLL_API ChangedAccessOfInheritedProperty : public HasVirtualProperty
{
protected:
int getProperty();
void setProperty(int value);
};

Loading…
Cancel
Save