Recursive Datatype made Generic

vl

#1

Hello

I’ve been playing with new features of the VL typesystem, looks pretty cool!

A minor thing I noticed: When I make a recursive datatype Node that stores another Node, and I don’t uncheck the Generic box, the type is a generic type Node for no good reason, like so:

Goes away when I uncheck the Generic box, no problem there.


#2

Ah, hehe, when I turn off Generics I get the error ‘Recursive patches are not supported yet’

I also got crashes when trying it, seems like you’re allowing stuff that’s not supported yet ;)


#3

Ooh I was excited for this, I thought this little bug would allow me to create a recursive datatype, but it doesn’t work it’s just a bug. Look:

Recursive.zip (7.4 KB)


#4

Here’s the simplest example I could make:

Recursive.vl (19.3 KB)

It’s about the Class Rec in there, note how this is apparently storing another Rec which is impossible (also has this additional generic type which I believe the field is actually annotated to).

Took me a few times because VL crashed when I tried to annotate the type of the Input, but when annotating the type of the Pad it ‘works’ (as in lets me create this ill defined datatype Rec)


#5

Hey Dominik, thanks for reporting this. Indeed this is not how it was supposed to work. System should simply mark those fields as red with the error that recursive data types are not yet supported - problem is that later stages in the compiler don’t expect it either so makes sense that you see crashes - which is of course very unfortunate. Will report back once the situation got tackled.