Closed samhanes closed 5 years ago
@samhanes Hmmm.... it feels like there must be something wrong with the TP if an mscorlib type is being generated when targeting NetCoreApp. I'll take a look
THe bug in TPSDK is here:
let ctor = typeof<System.Runtime.InteropServices.OptionalAttribute>.GetConstructor([||])
let ca = mkILCustomAttribMethRef (transCtorSpec ctor, [], [], [])
pb.SetCustomAttribute ca
The type OptionalAttribute
is not being remapped to the target platform. WIll fix
@samhanes fixed in master
Terrific, thanks!
Description
While working on this PR for SqlClient, I'm seeing an issue with generated types that contain an optional provided parameter. (i.e., where
optionalValue
isSome
) at compile-time:The TP appears to be working correctly at design time.
Note that the components are targeting:
Repro steps
Build the TP in this branch and try to compile SqlClient.Tests.NetCoreApp. The provider is called
TestGenerativeProvider
.Or, create a generative TP that produces a type with a method that contains an optional parameter, with a net461 DTC and a netstandard2.0 RTC. Reference a generated type from a netcore application and attempt to compile.
Expected behavior
Consuming application should compile and types should work as expected at runtime.
Actual behavior
Compile-time error as described above.
Known workarounds
Switching to erased types also solves this issue.