Compile time detection of experimental compiler feature

2022-07-15 Thread dxb
Thank you @araq. FYI the module did use the experiemental pragma but importing and using the module requires sprinkling other modules with `{.experimental: "views".}` or enable `--experimental:views` globally so I switched to detecting if views were enabled globally when importing the module. I

Compile time detection of experimental compiler feature

2022-07-15 Thread Araq
Your module should use `{.experimental: "views".}`.

Compile time detection of experimental compiler feature

2022-07-15 Thread dxb
Hi! I have a module that depends on `--experimental:views` and would like to be able to reliably detect and fail if `views` are not enabled. I currently do: when not compiles(block: var x: openArray[int]): {.fatal: "--experimental:views is required for this module