-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix type information lost from nested decoder types, closes #479
- Loading branch information
Showing
26 changed files
with
198 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as _ from '../../src/Codec' | ||
|
||
// $ExpectType Codec<{ a: string; b: { c: number; }; }, { a: string; b: { c: number; }; }> | ||
_.type({ | ||
a: _.string, | ||
b: _.type({ | ||
c: _.number | ||
}) | ||
}) | ||
|
||
// $ExpectType Codec<Partial<{ a: string; b: Partial<{ c: number; }>; }>, Partial<{ a: string; b: Partial<{ c: number; }>; }>> | ||
_.partial({ | ||
a: _.string, | ||
b: _.partial({ | ||
c: _.number | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as _ from '../../src/Decoder' | ||
|
||
// $ExpectType Decoder<{ a: string; b: { c: number; }; }> | ||
_.type({ | ||
a: _.string, | ||
b: _.type({ | ||
c: _.number | ||
}) | ||
}) | ||
|
||
// $ExpectType Decoder<Partial<{ a: string; b: Partial<{ c: number; }>; }>> | ||
_.partial({ | ||
a: _.string, | ||
b: _.partial({ | ||
c: _.number | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as _ from '../../src/Eq' | ||
|
||
// $ExpectType Eq<{ a: string; b: { c: number; }; }> | ||
_.type({ | ||
a: _.string, | ||
b: _.type({ | ||
c: _.number | ||
}) | ||
}) | ||
|
||
// $ExpectType Eq<Partial<{ a: string; b: Partial<{ c: number; }>; }>> | ||
_.partial({ | ||
a: _.string, | ||
b: _.partial({ | ||
c: _.number | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as _ from '../../src/Guard' | ||
|
||
// $ExpectType Guard<{ a: string; b: { c: number; }; }> | ||
_.type({ | ||
a: _.string, | ||
b: _.type({ | ||
c: _.number | ||
}) | ||
}) | ||
|
||
// $ExpectType Guard<Partial<{ a: string; b: Partial<{ c: number; }>; }>> | ||
_.partial({ | ||
a: _.string, | ||
b: _.partial({ | ||
c: _.number | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as _ from '../../src/JsonCodec' | ||
|
||
// $ExpectType JsonCodec<{ a: string; b: { c: number; }; }> | ||
_.type({ | ||
a: _.string, | ||
b: _.type({ | ||
c: _.number | ||
}) | ||
}) | ||
|
||
// $ExpectType JsonCodec<Partial<{ a: string; b: Partial<{ c: number; }>; }>> | ||
_.partial({ | ||
a: _.string, | ||
b: _.partial({ | ||
c: _.number | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as _ from '../../src/JsonEncoder' | ||
|
||
// $ExpectType JsonEncoder<{ a: string; b: { c: number; }; }> | ||
_.type({ | ||
a: _.id<string>(), | ||
b: _.type({ | ||
c: _.id<number>() | ||
}) | ||
}) | ||
|
||
// $ExpectType JsonEncoder<Partial<{ a: string; b: Partial<{ c: number; }>; }>> | ||
_.partial({ | ||
a: _.id<string>(), | ||
b: _.partial({ | ||
c: _.id<number>() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as _ from '../../src/Type' | ||
|
||
// $ExpectType Type<{ a: string; b: { c: number; }; }> | ||
_.type({ | ||
a: _.string, | ||
b: _.type({ | ||
c: _.number | ||
}) | ||
}) | ||
|
||
// $ExpectType Type<Partial<{ a: string; b: Partial<{ c: number; }>; }>> | ||
_.partial({ | ||
a: _.string, | ||
b: _.partial({ | ||
c: _.number | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.