There does appear to be a difference in the KiCad source code for handling GetCornerPosition(). In the master branch (i.e. nightly), the return type is VECTOR2I&, while in the 4.0 branch the return type is wxPoint&
Here are some excerpts of code from master and 4.0 branch:
include/math/vector2d.h (both 4.0 and master)
typedef VECTOR2<int> VECTOR2I;
4.0/pcbnew/class_zone.h
const wxPoint& GetCornerPosition( int aCornerIndex ) const
{
return m_Poly->GetPos( aCornerIndex );
}
const VECTOR2I& GetCornerPosition( int aCornerIndex ) const
{
SHAPE_POLY_SET::VERTEX_INDEX index;
// Convert global to relative indices
if( !m_Poly->GetRelativeIndices( aCornerIndex, &index ) )
throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
return m_Poly->CVertex( index );
}
master/pcbnew/class_zone.h
typedef union {
wxPoint wx;
VECTOR2I vector;
} WX_VECTOR_CONVERTER;
So in terms of memory structure, VECTOR2I and wxPoint are identical. The master branch has a convenience union of WX_VECTOR_CONVERTOR to help with translating.
One thing to try is to see if you can index the return value of GetCornerPosition (i.e. value[0] and value[1]). Otherwise, I think this is a problem with swig automatically determining the return type.
There is surely a lot more subtlety than I can glean from the source code, but it seems pretty clear this is the source of the problem (hehe, get it? source). I don’t know if the answer is in defining something different in the code or in defining something in the swig files (*.i files). Sorry I can’t help further.
I know this doesn’t necessarily help your issue at the moment, but maybe this will point the way to fixing the nightlies. Have you tried the latest nightly?
If nothing helps, perhaps filing a bug and pointing to (or copying) this explanation may help point a developer to the right location.