Re: [Vala] Invalid cast Warnings





----- Original Message -----

From: Daniel Brendle <grindhold skarphed org>
Sent: Sunday, 5 February 2017, 16:09
Subject: [Vala] Invalid cast Warnings

At the moment I deal with a series of warnings like these:

(process:3325): GLib-GObject-WARNING **: invalid cast from 'OParlSystem'
to 'System'

I compiled a minimum example to trigger the issue here:


https://0bin.net/paste/J0sgx2b2NJp6lTj8#QBfz-GUhWagsfGsF7nUqEn/8XneAiL9NhYNIdo8GRt6


A simpler example is:

void main () {
    var a = new TestBase ();
    TestSubType b = (TestSubType)a;
}

class TestBase {
}

class TestSubType:TestBase {
}

The offending line in the resulting C code is:

_tmp1_ = _test_base_ref0 (G_TYPE_CHECK_INSTANCE_CAST (a, TYPE_TEST_SUB_TYPE, TestSubType));

It is G_TYPE_CHECK_INSTANCE_CAST (a, TYPE_TEST_SUB_TYPE, TestSubType) that is
generating the warning. 


It needs further investigation as to why it's failing the check.

Hopefully someone else will chip in with an answer.

Al


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]