Re: Using unsafe blocks in let expressions

2021-07-23 Thread Philip Herron
On 22/07/2021 00:09, Mark Wielaard wrote: > On Wed, Jul 21, 2021 at 11:09:38PM +0200, Mark Wielaard wrote: >> + Location locus; >> + if (!pratt_parse) >> +{ >> + Location locus = lexer.peek_token ()->get_locus (); > Oops, shadowed locus. Fixed patch attached, and also at > https://code

Re: Using unsafe blocks in let expressions

2021-07-21 Thread Mark Wielaard
On Wed, Jul 21, 2021 at 11:09:38PM +0200, Mark Wielaard wrote: > + Location locus; > + if (!pratt_parse) > +{ > + Location locus = lexer.peek_token ()->get_locus (); Oops, shadowed locus. Fixed patch attached, and also at https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=let-uns

Using unsafe blocks in let expressions

2021-07-21 Thread Mark Wielaard
Hi, I wanted to use an unsafe block in a let expression, which wasn't accepted. The attached patch implements this. I did want to add a testcase, but I couldn't come up with a test that is correct and passes the type checker. The following works, but is not correctly typed: pub fn main () { le