Skip to content

Commit 7fa0e8e

Browse files
committed
test: add unit test vector to show repeated type constraints
1 parent cffad1b commit 7fa0e8e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

testdata/union/union.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ package union
33
type UnionConstraint[T string | int64] struct {
44
Value T
55
}
6+
7+
// Repeated constraints are redundant
8+
// TODO: Write a mutation to remove redundant constraints
9+
type Repeated[T string | string | int64 | uint64] struct {
10+
Value T
11+
}

testdata/union/union.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
// Code generated by 'guts'. DO NOT EDIT.
22

3+
// From union/union.go
4+
export interface Repeated<T extends string | string | number | number> {
5+
readonly Value: T;
6+
}
7+
38
// From union/union.go
49
export interface UnionConstraint<T extends string | number> {
510
readonly Value: T;

0 commit comments

Comments
 (0)