Closed nodakai closed 1 year ago
That would be useful, but unfortunately that is not possible with a type provider either. The TP receives its static parameters as already resolved values, it can't inspect the expression.
Hmm right, I think I had some confusions on how typeof
is implemented vs nameof
, restrictions on TP parameters, and so on. Sorry for the noise.
Background: https://stackoverflow.com/a/40856014/
The proposed trick only applies to C# (whose "constant expressions" include concatenations like
nameof(Namespace) + "." + nameof(Namespace.Class)
) Sadly we can't do the same with F# when you want some fully qualified type name to feed to e.g.[<assembly:AutoOpen(...)>]
If it's straightforward to add such a functionality to your Literal Providers suite, it would be awesome.