I am playing around with the new type checker plugins using the current development branch of GHC. When I supply the plugin module to GHC through the command line I get a cyclic import error message, which I think is false. If I supply the same plugin module using a pragma I do not get an error message.

Note

Using -fplugin=MyPlugin vs. -fplugin MyPlugin does not make a difference.

The command line example behaves the same independent of whether I supply the -dynamic flag or not.

I had to add the -dynamic flag, because otherwise GHC will complain that:

<no location info>: cannot find normal object file ‘./MyPlugin.dyn_o’ while linking an interpreted expression
This might be a long shot, but maybe using the -fplugin option should imply the -dynamic flag?