public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: "J. Vincent Toups" <vincent.toups@gmail.com>, kawa@sourceware.org
Subject: Re: Value of given type cannot be case to its own type.
Date: Wed, 10 Feb 2021 07:35:57 -0800	[thread overview]
Message-ID: <9a702bae-a8f6-1dbf-dc27-b5c0702f4219@bothner.com> (raw)
In-Reply-To: <CAE8gMz1t3y0wr_yKe6WtABUiYfL2vfbDo6vHj6OZi7fLED10LA@mail.gmail.com>

On 2/10/21 7:12 AM, J. Vincent Toups via Kawa wrote:
> I'm seeing this error:
> 
> Value 'lib.mecs@131a7516' for variable 'm' has wrong type (lib.mecs)
> (lib.mecs cannot be cast to lib.mecs)
> 
> Which on the face of things is kind of flabbergasting. The specific
> line of code which causes the issue suggests that it is indeed the
> case that the value lib.mecs@etc... is a lib.mecs instance and its
> being used as a lib.mecs instance.

We cannot possibly diagnose this without a test-case.

There are various possibilities.  The one that first comes to mind is a
class-loader problem: There are two classes named lib.mecs, loaded using
two different classloaders, and thus they are incompatible.  Though that
would be more likely to show up at run-time rather than compile-time.

It is also possible that one of the "lib.mecs" is not a reference to
an instance of the lib.mecs class (which would normally be the case), but
some type that the Kawa compiler displays as lib.mecs. Off-hand I can't
think of what that could be, but I would not be surprised to see that.
This could be a Kawa bug, of course.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

  reply	other threads:[~2021-02-10 15:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 15:12 J. Vincent Toups
2021-02-10 15:35 ` Per Bothner [this message]
     [not found]   ` <CAE8gMz2Bvb6XbCaL8cwEbbR-WMNYA+Eei91MPzJv_HAO_5fPMQ@mail.gmail.com>
2021-02-10 16:38     ` Fwd: " J. Vincent Toups
2021-02-10 16:50       ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a702bae-a8f6-1dbf-dc27-b5c0702f4219@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    --cc=vincent.toups@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).