gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
17.92k stars 747 forks source link

Allow spreading const records in type constructors for consts #3695

Open TheOnlyTails opened 3 weeks ago

TheOnlyTails commented 3 weeks ago

Currently, const declarations do not support spreading records:

const a = Foo(1, 2)
const b = Foo(..a, 3)

I propose that if the spread record is also a const, it should be allowed.

lpil commented 3 weeks ago

Sounds good!