gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Typecheck const generics

Open CohenArthur opened this issue 3 years ago • 0 comments

  • [ ] #1360
  • [ ] Type check default expressions
  • [ ] Report errors when default expressions are used in const functions or other restricted items #1310
  • [ ] Type check const arguments against const generic arguments
  • [ ] #1303

I don't think const generic parameters should be typechecked during top-level. They do not "declare" a type, but they use one (const N: usize). So they should only be typechecked when items are typechecked. This should be the first change, as generic parameters for items are not used after the TypeCheckTopLevel resolver phase (in functions for example).

Afterwards, once we are sure that the type they reference exists and has been declared, we must check that it is a valid "const generic type" (#1303)

CohenArthur avatar Jun 30 '22 17:06 CohenArthur