Referencing Generated Types from Erased Types

Viewed 69

While building an F# Type Provider, I came across a situation where I needed to generate both generative and erasing types.

The generated types are just simple enums (they are generated so that I can use the FlagsAttribute, which erasing enums does not seem to support.)

All other types are erasing, so that I can use Units of Measure (it seems that generated types do not support UoM.)

The problem: I need the erased types to reference the generated types. Is this possible?

The excellent examples on GitHub all seem to demonstrate creating generated and erased types from the same type provider assembly, but do not show if it's possible to reference one from the other.

When I've attempted to merge the two (by placing all erased types in the Executing Assembly and generated types in a Provided Assembly), I get the following error at design-time: The target type <generated type> utilized by a type provider was not found in the design-time assembly set. Is something like this even possible?

0 Answers
Related