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: Fwd: Value of given type cannot be case to its own type.
Date: Wed, 10 Feb 2021 08:50:24 -0800	[thread overview]
Message-ID: <ddcbd26e-e48c-84f4-4838-92f5d48961b9@bothner.com> (raw)
In-Reply-To: <CAE8gMz0jb=4L=ZUpyz=jUrcyfWEEEepSqePQaZ8prbqxk4sBdw@mail.gmail.com>

On 2/10/21 8:38 AM, J. Vincent Toups via Kawa wrote:
> The issue was that I had defined a class called mecs in lib and there
> was also a library called mecs in lib. So there were two classes lying
> around called lib.mecs.
> 
> It makes sense in retrospect but I wonder if it might not also make
> sense to indicate in the class name of a library that it is produced
> by a define-library form rather than a class definition to prevent
> such classes in most cases.

This is covered in moderate detail here:
https://www.gnu.org/software/kawa/Module-classes.html

It is convenient and flexible to compile both a library (lib mecs)
and a class mecs in package lib to the class lib.mecs.  Sometimes
(as you saw) there can be a clash, but I think the convenience
makes up for it.  Furthermore, changing it at this point might break things.

Kawa should catch this situation if both classes are produced by the same
invocation of the kawa command.  (If not, that is arguably a bug.)
However, if they're produced at different times, then it's harder to catch.

Also, if Kawa is confused by an existing incompatible lib.mecs class while it is
generating lib.mecs, that is also a bug.  I've run into some problems like that in the past,
and I've tried to fix them.  If you have a reproducible simple test-case I can take a look.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

      reply	other threads:[~2021-02-10 16:50 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
     [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 [this message]

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=ddcbd26e-e48c-84f4-4838-92f5d48961b9@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).