未验证 提交 46d4a16e 编写于 作者: F Florian Verdonck 提交者: GitHub

Don't add struct attribute for type aliases of primitives (#13365)

上级 f9c5b42c
......@@ -1680,7 +1680,7 @@ module TastDefinitionPrinting =
let ty = generalizedTyconRef g tcref
let start, tagger =
if isStructTy g ty then
if isStructTy g ty && not tycon.TypeAbbrev.IsSome then
// Always show [<Struct>] whether verbose or not
Some "struct", tagStruct
elif isInterfaceTy g ty then
......
namespace Foo
type A = bool
type B = sbyte
type C = byte
type D = int16
type E = uint16
type F = int
type G = uint
type H = nativeint
type I = unativeint
type J = int64
type K = single
type L = float32
type M = float
type N = double
type O = bigint
type P = decimal
type Q = System.Char
type R = System.String
type S = System.Byte
type T = unit
\ No newline at end of file
......@@ -3373,6 +3373,9 @@ module GeneratedSignatureTests =
[<Test>]
let ``typeAugmentation-FSC_NETFX_TEST_GENERATED_SIGNATURE`` () = singleTestBuildAndRun "core/typeAugmentation" FSC_NETFX_TEST_GENERATED_SIGNATURE
[<Test>]
let ``typeAliasPrimitives-FSC_NETFX_TEST_GENERATED_SIGNATURE`` () = singleTestBuildAndRun "core/typeAliasPrimitives" FSC_NETFX_TEST_GENERATED_SIGNATURE
#endif
#if !NETCOREAPP
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册