nim-works / nimskull

An in development statically typed systems programming language; with sustainability at its core. We, the community of users, maintain it.
https://nim-works.github.io/nimskull/index.html
Other
280 stars 39 forks source link

fix wrong hooks being picked for tuple types #1402

Closed zerbina closed 3 months ago

zerbina commented 3 months ago

Summary

Details

zerbina commented 3 months ago

Prior to #1382, sighashes.hashType was also used by the C code generator for merging types, which meant that:

var x: (int, (int, int))
var y: (int, (int,), int)
y[2] = 1

resulted in a C compiler error, due to y using the same C type as x, which is:

struct tyTuple__xxx1 {
  NI Field0;
  NI Field1;
};
struct tyTuple__xxx2 {
  NI Field0;
  tyTuple__xxx1 Field1;
};
saem commented 3 months ago

/merge

github-actions[bot] commented 3 months ago

Merge requested by: @saem

Contents after the first section break of the PR description has been removed and preserved below:


## Notes for Reviewers * a severe, long-standing issue * discovered while investigating the test failures from #1400