public inbox for
 help / color / mirror / Atom feed
From: Mark Wielaard <>
To: Philip Herron <>
Subject: Re: Cleanup some StructExpr related classes
Date: Mon, 6 Sep 2021 00:47:43 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Philip,

On Thu, Sep 02, 2021 at 02:23:33PM +0100, Philip Herron wrote:
> I've been reviewing your branch a bit and noticed this commit
> which I really like. I wasn't sure what was the best way to interact with
> the AST which contained unique_ptr's to things so I initially added little
> lambda's but these don't really help anything at all other than make it
> more confusing to work with. So feel free to create patches to remove those.

I wasn't sure whether to replicate this for the HIR classes, so at
first I did it with a lambda, but found that not very nice. So instead
I added simple accessors for the fields vector which are the used in
in a simple for loop using get () on the elements. If you also like
that better I can change the AST classes to do the same thing.

> I also noticed quite a few test cases already are these compiling?

Yes, but they are all "negative" tests. I mean, that they check for
errors. After resolving we can check for unused enum item
warnings. After lowering we can detect bad visibility and duplicate
fields in struct variants. And after typechecking (not finished yet)
we can check the denominators of fieldless enums are unique (and
aren't too big).

> you have to add much to the wrapper for the enum type?

I am still stuck at the type check pass. So haven't actually gotten to
that part.

I'll sent the parser, resolve and hit lowering bits, which include the
test cases.

These patches are also on



  reply	other threads:[~2021-09-05 22:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  0:15 Mark Wielaard
2021-09-01  0:15 ` [PATCH 1/3] StructExprTuple doesn't really exist Mark Wielaard
2021-09-01  0:15 ` [PATCH 2/3] StructExprUnit " Mark Wielaard
2021-09-01  0:15 ` [PATCH 3/3] Remove Enumaration Expression, EnumExpr, classes Mark Wielaard
2021-09-01 10:11 ` Cleanup some StructExpr related classes Philip Herron
2021-09-01 19:23   ` Mark Wielaard
2021-09-02 13:23     ` Philip Herron
2021-09-05 22:47       ` Mark Wielaard [this message]
2021-09-06 16:55         ` Philip Herron

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:

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

  git send-email \ \ \ \ \

* 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).