aardappel / lobster

The Lobster Programming Language
http://strlen.com/lobster
2.24k stars 121 forks source link

Assertion in debug version of lobster with maybe incorrect code. #234

Closed MortimerSnerd closed 1 year ago

MortimerSnerd commented 1 year ago

I'm at commit 764661230bf8524b48c62248fc2ed41803c675ea.

This isn't the assert I mentioned in discord, but another I ran into when trying to minimize a reproduction.

Here's the assertion:

Assertion failed: false, file C:\src\lobster\dev\src\lobster\codegen.h, line 189

The code that reproduces it.

class brush_area:
   clusters = []

private let py_triggers = [] :: brush_area

Just giving clusters a type makes the assertion go away. Or adding code that uses clusters in a way that resolves the type, which is why my original file doesn't see that assert.

Something about the py_triggers line contributes. If I replace that with a print(brush_area{}) or some other use of the type, there's no assertion.

aardappel commented 1 year ago

Thanks, will look at it soon. Its unhappy that the vector doesn't have a type only if it never gets constructed..

aardappel commented 1 year ago

Fixed in https://github.com/aardappel/lobster/commit/3ab1f58a385ec8a8716e030c8277b82c8176fedc