-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add signature tests showing the wrong generation for array values whe…
…n inferring dictionaries in json
- Loading branch information
Showing
10 changed files
with
1,020 additions
and
1 deletion.
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
108 changes: 108 additions & 0 deletions
108
...ected/Json,DictionaryInference-arrays.json,False,,,True,False,BackwardCompatible.expected
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,108 @@ | ||
class JsonProvider : obj | ||
static member AsyncGetSample: () -> JsonProvider+Root async | ||
let f = new Func<_,_>(fun (t:TextReader) -> JsonDocument.Create(t)) | ||
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "JSON" "" "DictionaryInference-arrays.json"), f) | ||
|
||
static member AsyncLoad: uri:string -> JsonProvider+Root async | ||
let f = new Func<_,_>(fun (t:TextReader) -> JsonDocument.Create(t)) | ||
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "JSON" "" uri), f) | ||
|
||
static member GetSample: () -> JsonProvider+Root | ||
JsonDocument.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "JSON" "" "DictionaryInference-arrays.json"))) | ||
|
||
static member Load: stream:System.IO.Stream -> JsonProvider+Root | ||
JsonDocument.Create(((new StreamReader(stream)) :> TextReader)) | ||
|
||
static member Load: reader:System.IO.TextReader -> JsonProvider+Root | ||
JsonDocument.Create(reader) | ||
|
||
static member Load: uri:string -> JsonProvider+Root | ||
JsonDocument.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "JSON" "" uri))) | ||
|
||
static member Load: value:JsonValue -> JsonProvider+Root | ||
JsonDocument.Create(value, "") | ||
|
||
static member Parse: text:string -> JsonProvider+Root | ||
JsonDocument.Create(((new StringReader(text)) :> TextReader)) | ||
|
||
static member ParseList: text:string -> JsonProvider+JsonProvider+Root[] | ||
JsonDocument.CreateList(((new StringReader(text)) :> TextReader)) | ||
|
||
|
||
class JsonProvider+Root : FDR.BaseTypes.IJsonDocument | ||
new : mappings:JsonProvider+Mappings -> JsonProvider+Root | ||
JsonRuntime.CreateRecord([| ("Mappings", | ||
(mappings :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+Root | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member Mappings: JsonProvider+Mappings with get | ||
JsonRuntime.GetPropertyPacked(this, "Mappings") | ||
|
||
|
||
class JsonProvider+Mappings : FDR.BaseTypes.IJsonDocument | ||
new : 123:JsonProvider+JsonProvider+123[] -> 456:JsonProvider+JsonProvider+123[] -> 789:JsonProvider+JsonProvider+789[] -> JsonProvider+Mappings | ||
JsonRuntime.CreateRecord([| ("123", | ||
(123 :> obj)) | ||
("456", | ||
(456 :> obj)) | ||
("789", | ||
(789 :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+Mappings | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member 123: JsonProvider+JsonProvider+123[] with get | ||
JsonRuntime.ConvertArray(JsonRuntime.GetPropertyPackedOrNull(this, "123"), new Func<_,_>(id))) | ||
|
||
member 456: JsonProvider+JsonProvider+123[] with get | ||
JsonRuntime.ConvertArray(JsonRuntime.GetPropertyPackedOrNull(this, "456"), new Func<_,_>(id))) | ||
|
||
member 789: JsonProvider+JsonProvider+789[] with get | ||
JsonRuntime.ConvertArray(JsonRuntime.GetPropertyPackedOrNull(this, "789"), new Func<_,_>(id))) | ||
|
||
|
||
class JsonProvider+123 : FDR.BaseTypes.IJsonDocument | ||
new : groupId:int -> canDelete:bool -> JsonProvider+123 | ||
JsonRuntime.CreateRecord([| ("GroupId", | ||
(groupId :> obj)) | ||
("CanDelete", | ||
(canDelete :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+123 | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member CanDelete: bool with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "CanDelete") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertBoolean(value.JsonOpt), value.JsonOpt) | ||
|
||
member GroupId: int with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "GroupId") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertInteger("", value.JsonOpt), value.JsonOpt) | ||
|
||
|
||
class JsonProvider+789 : FDR.BaseTypes.IJsonDocument | ||
new : groupId:int -> canDelete:bool -> errorMessage:string option -> JsonProvider+789 | ||
JsonRuntime.CreateRecord([| ("GroupId", | ||
(groupId :> obj)) | ||
("CanDelete", | ||
(canDelete :> obj)) | ||
("ErrorMessage", | ||
(errorMessage :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+789 | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member CanDelete: bool with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "CanDelete") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertBoolean(value.JsonOpt), value.JsonOpt) | ||
|
||
member ErrorMessage: string option with get | ||
JsonRuntime.ConvertString("", JsonRuntime.TryGetPropertyUnpacked(this, "ErrorMessage")) | ||
|
||
member GroupId: int with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "GroupId") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertInteger("", value.JsonOpt), value.JsonOpt) | ||
|
||
|
108 changes: 108 additions & 0 deletions
108
...n,DictionaryInference-arrays.json,False,,,True,False,ValuesAndInlineSchemasHints.expected
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,108 @@ | ||
class JsonProvider : obj | ||
static member AsyncGetSample: () -> JsonProvider+Root async | ||
let f = new Func<_,_>(fun (t:TextReader) -> JsonDocument.Create(t)) | ||
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "JSON" "" "DictionaryInference-arrays.json"), f) | ||
|
||
static member AsyncLoad: uri:string -> JsonProvider+Root async | ||
let f = new Func<_,_>(fun (t:TextReader) -> JsonDocument.Create(t)) | ||
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "JSON" "" uri), f) | ||
|
||
static member GetSample: () -> JsonProvider+Root | ||
JsonDocument.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "JSON" "" "DictionaryInference-arrays.json"))) | ||
|
||
static member Load: stream:System.IO.Stream -> JsonProvider+Root | ||
JsonDocument.Create(((new StreamReader(stream)) :> TextReader)) | ||
|
||
static member Load: reader:System.IO.TextReader -> JsonProvider+Root | ||
JsonDocument.Create(reader) | ||
|
||
static member Load: uri:string -> JsonProvider+Root | ||
JsonDocument.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "JSON" "" uri))) | ||
|
||
static member Load: value:JsonValue -> JsonProvider+Root | ||
JsonDocument.Create(value, "") | ||
|
||
static member Parse: text:string -> JsonProvider+Root | ||
JsonDocument.Create(((new StringReader(text)) :> TextReader)) | ||
|
||
static member ParseList: text:string -> JsonProvider+JsonProvider+Root[] | ||
JsonDocument.CreateList(((new StringReader(text)) :> TextReader)) | ||
|
||
|
||
class JsonProvider+Root : FDR.BaseTypes.IJsonDocument | ||
new : mappings:JsonProvider+Mappings -> JsonProvider+Root | ||
JsonRuntime.CreateRecord([| ("Mappings", | ||
(mappings :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+Root | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member Mappings: JsonProvider+Mappings with get | ||
JsonRuntime.GetPropertyPacked(this, "Mappings") | ||
|
||
|
||
class JsonProvider+Mappings : FDR.BaseTypes.IJsonDocument | ||
new : 123:JsonProvider+JsonProvider+123[] -> 456:JsonProvider+JsonProvider+123[] -> 789:JsonProvider+JsonProvider+789[] -> JsonProvider+Mappings | ||
JsonRuntime.CreateRecord([| ("123", | ||
(123 :> obj)) | ||
("456", | ||
(456 :> obj)) | ||
("789", | ||
(789 :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+Mappings | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member 123: JsonProvider+JsonProvider+123[] with get | ||
JsonRuntime.ConvertArray(JsonRuntime.GetPropertyPackedOrNull(this, "123"), new Func<_,_>(id))) | ||
|
||
member 456: JsonProvider+JsonProvider+123[] with get | ||
JsonRuntime.ConvertArray(JsonRuntime.GetPropertyPackedOrNull(this, "456"), new Func<_,_>(id))) | ||
|
||
member 789: JsonProvider+JsonProvider+789[] with get | ||
JsonRuntime.ConvertArray(JsonRuntime.GetPropertyPackedOrNull(this, "789"), new Func<_,_>(id))) | ||
|
||
|
||
class JsonProvider+123 : FDR.BaseTypes.IJsonDocument | ||
new : groupId:int -> canDelete:bool -> JsonProvider+123 | ||
JsonRuntime.CreateRecord([| ("GroupId", | ||
(groupId :> obj)) | ||
("CanDelete", | ||
(canDelete :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+123 | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member CanDelete: bool with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "CanDelete") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertBoolean(value.JsonOpt), value.JsonOpt) | ||
|
||
member GroupId: int with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "GroupId") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertInteger("", value.JsonOpt), value.JsonOpt) | ||
|
||
|
||
class JsonProvider+789 : FDR.BaseTypes.IJsonDocument | ||
new : groupId:int -> canDelete:bool -> errorMessage:string option -> JsonProvider+789 | ||
JsonRuntime.CreateRecord([| ("GroupId", | ||
(groupId :> obj)) | ||
("CanDelete", | ||
(canDelete :> obj)) | ||
("ErrorMessage", | ||
(errorMessage :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+789 | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member CanDelete: bool with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "CanDelete") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertBoolean(value.JsonOpt), value.JsonOpt) | ||
|
||
member ErrorMessage: string option with get | ||
JsonRuntime.ConvertString("", JsonRuntime.TryGetPropertyUnpacked(this, "ErrorMessage")) | ||
|
||
member GroupId: int with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "GroupId") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertInteger("", value.JsonOpt), value.JsonOpt) | ||
|
||
|
108 changes: 108 additions & 0 deletions
108
...ctionaryInference-arrays.json,False,,,True,False,ValuesAndInlineSchemasOverrides.expected
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,108 @@ | ||
class JsonProvider : obj | ||
static member AsyncGetSample: () -> JsonProvider+Root async | ||
let f = new Func<_,_>(fun (t:TextReader) -> JsonDocument.Create(t)) | ||
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "JSON" "" "DictionaryInference-arrays.json"), f) | ||
|
||
static member AsyncLoad: uri:string -> JsonProvider+Root async | ||
let f = new Func<_,_>(fun (t:TextReader) -> JsonDocument.Create(t)) | ||
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "JSON" "" uri), f) | ||
|
||
static member GetSample: () -> JsonProvider+Root | ||
JsonDocument.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "JSON" "" "DictionaryInference-arrays.json"))) | ||
|
||
static member Load: stream:System.IO.Stream -> JsonProvider+Root | ||
JsonDocument.Create(((new StreamReader(stream)) :> TextReader)) | ||
|
||
static member Load: reader:System.IO.TextReader -> JsonProvider+Root | ||
JsonDocument.Create(reader) | ||
|
||
static member Load: uri:string -> JsonProvider+Root | ||
JsonDocument.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "JSON" "" uri))) | ||
|
||
static member Load: value:JsonValue -> JsonProvider+Root | ||
JsonDocument.Create(value, "") | ||
|
||
static member Parse: text:string -> JsonProvider+Root | ||
JsonDocument.Create(((new StringReader(text)) :> TextReader)) | ||
|
||
static member ParseList: text:string -> JsonProvider+JsonProvider+Root[] | ||
JsonDocument.CreateList(((new StringReader(text)) :> TextReader)) | ||
|
||
|
||
class JsonProvider+Root : FDR.BaseTypes.IJsonDocument | ||
new : mappings:JsonProvider+Mappings -> JsonProvider+Root | ||
JsonRuntime.CreateRecord([| ("Mappings", | ||
(mappings :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+Root | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member Mappings: JsonProvider+Mappings with get | ||
JsonRuntime.GetPropertyPacked(this, "Mappings") | ||
|
||
|
||
class JsonProvider+Mappings : FDR.BaseTypes.IJsonDocument | ||
new : 123:JsonProvider+JsonProvider+123[] -> 456:JsonProvider+JsonProvider+123[] -> 789:JsonProvider+JsonProvider+789[] -> JsonProvider+Mappings | ||
JsonRuntime.CreateRecord([| ("123", | ||
(123 :> obj)) | ||
("456", | ||
(456 :> obj)) | ||
("789", | ||
(789 :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+Mappings | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member 123: JsonProvider+JsonProvider+123[] with get | ||
JsonRuntime.ConvertArray(JsonRuntime.GetPropertyPackedOrNull(this, "123"), new Func<_,_>(id))) | ||
|
||
member 456: JsonProvider+JsonProvider+123[] with get | ||
JsonRuntime.ConvertArray(JsonRuntime.GetPropertyPackedOrNull(this, "456"), new Func<_,_>(id))) | ||
|
||
member 789: JsonProvider+JsonProvider+789[] with get | ||
JsonRuntime.ConvertArray(JsonRuntime.GetPropertyPackedOrNull(this, "789"), new Func<_,_>(id))) | ||
|
||
|
||
class JsonProvider+123 : FDR.BaseTypes.IJsonDocument | ||
new : groupId:int -> canDelete:bool -> JsonProvider+123 | ||
JsonRuntime.CreateRecord([| ("GroupId", | ||
(groupId :> obj)) | ||
("CanDelete", | ||
(canDelete :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+123 | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member CanDelete: bool with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "CanDelete") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertBoolean(value.JsonOpt), value.JsonOpt) | ||
|
||
member GroupId: int with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "GroupId") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertInteger("", value.JsonOpt), value.JsonOpt) | ||
|
||
|
||
class JsonProvider+789 : FDR.BaseTypes.IJsonDocument | ||
new : groupId:int -> canDelete:bool -> errorMessage:string option -> JsonProvider+789 | ||
JsonRuntime.CreateRecord([| ("GroupId", | ||
(groupId :> obj)) | ||
("CanDelete", | ||
(canDelete :> obj)) | ||
("ErrorMessage", | ||
(errorMessage :> obj)) |], "") | ||
|
||
new : jsonValue:JsonValue -> JsonProvider+789 | ||
JsonDocument.Create(jsonValue, "") | ||
|
||
member CanDelete: bool with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "CanDelete") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertBoolean(value.JsonOpt), value.JsonOpt) | ||
|
||
member ErrorMessage: string option with get | ||
JsonRuntime.ConvertString("", JsonRuntime.TryGetPropertyUnpacked(this, "ErrorMessage")) | ||
|
||
member GroupId: int with get | ||
let value = JsonRuntime.TryGetPropertyUnpackedWithPath(this, "GroupId") | ||
JsonRuntime.GetNonOptionalValue(value.Path, JsonRuntime.ConvertInteger("", value.JsonOpt), value.JsonOpt) | ||
|
||
|
Oops, something went wrong.