This project has moved. For the latest updates, please go here.
1
Vote

Add check of getter return value

description

Following snippet should raise a warning. Since InjectionCop currently does not support annotating getters and setters separately, Properties should behave like fields (field qualified => setting only valid when value is of respective type => getting the respective type is guaranteed).
[CustomType]
public object ComplexCustomTypeProperty
{
  get
  {
    // unsafe: returning empty type qualifier
    return new object();
  }
  set { }
}

comments