-
Notifications
You must be signed in to change notification settings - Fork 16
Newtype optimisation broken in the REPL #196
Comments
bbb303c disables newtype opt in the repl but we still need to address it. |
Of course a possible solution is just stating that newtype optimisation isn't guaranteed to run. |
Yeah, this is something I've been thinking about for a while - if we ever start running the optimiser before linking modules together (which we should), then we need to think about this. I think the only correct thing to do here is to implement the optimisation as part of lowering. Unlike other optimisations, it actually changes the signature (and sometimes semantics) of the module, so I think this is our only option. We'd then effectively store a "type representation" flag within the This is obviously going to make pattern lowering even more ugly, but I think it's the best solution. |
- Introduce the concept of "type representations". These are a concrete part of the (core) module signature, rather than provided by an optimisation. - Lower is now guided by these type representations. We will emit method calls instead of constructor invocations for type wrappers, and the pattern compiler will also generate the appropriate code. Closes #196
- Introduce the concept of "type representations". These are a concrete part of the (core) module signature, rather than provided by an optimisation. - Lower is now guided by these type representations. We will emit method calls instead of constructor invocations for type wrappers, and the pattern compiler will also generate the appropriate code. Closes #196
- Introduce the concept of "type representations". These are a concrete part of the (core) module signature, rather than provided by an optimisation. - Lower is now guided by these type representations. We will emit method calls instead of constructor invocations for type wrappers, and the pattern compiler will also generate the appropriate code. Closes #196
Load this file then try matching on
x
—You can't. The pattern won't be lowered to a cast and we'll try to index a string.The text was updated successfully, but these errors were encountered: