You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
String [Arguments] for IParsable types fail under Native AOT #7760
Under Native AOT, a string [Arguments] value for an IParsable<T> parameter type other than DateTime fails at run time with InvalidCastException. The same tests pass in source-gen (JIT) and reflection modes. The analyzer accepts these arguments, so they compile without any warning.
InvalidCastException: Cannot convert from 'System.String' to 'System.Guid' in Native AOT mode. No AOT converter was found in the AotConverterRegistry.
DateTime passes because it goes through IConvertible.
The string is passed through unchanged and converted at binding time by CastHelper.TryParseFromString (src/TUnit.Core/Helpers/CastHelper.cs:282), which finds Parse by reflection. Under AOT that reflection path doesn't find a usable Parse method. The T.Parse(...) emission in TypedConstantFormatter only covers attributes read from metadata, not the normal syntax path. A fix could follow #7759: have AotConverterGenerator register a string -> T converter that calls T.Parse(value, CultureInfo.InvariantCulture) directly.
Activity
fix: convert string [Arguments] to IParsable types under Native AOT
+semver:minor - fix: convert string [Arguments] to IParsable types un…