Skip to content

Commit

Permalink
Fix #4: reading of generic null (::) embedded in lists
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejlach committed Sep 11, 2014
1 parent d234cff commit a589c07
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
------------------------------------------------------------------------------
qSharp 2.0.6 [2014.09.11]
------------------------------------------------------------------------------

- Fix: reading of generic null (::) embedded in lists

------------------------------------------------------------------------------
qSharp 2.0.5 [2014.09.01]
------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions qSharp/src/QReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ private object ReadObject()
case QType.GeneralList:
return ReadGeneralList();
case QType.NullItem:
reader.ReadSByte(); // ignore
return null;
case QType.Error:
return ReadError();
Expand Down
2 changes: 2 additions & 0 deletions qSharp/test/QExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ internal class QExpressions
{"3.233 6.46", new Double[] {3.233, 6.46}},

{"(1;`bcd;\"0bc\";5.5e)", new object[] {1, "bcd", "0bc".ToCharArray(), (float) 5.5}},
{"(42;::;`foo)", new object[] { 42, null, "foo" }},
{"(enlist 1h; 2; enlist 3j)", new object[] {new short[] {1}, 2, new long[] {3}}},
{"(2;`bcd;\"0bc\";5.5e)", new object[] {1, "bcd", "0bc".ToCharArray(), (Single) 5.5}},
{"(enlist 2h; 2; enlist 3j)", new object[] {new Int16[] {1}, 2, new long[] {3}}},
Expand Down Expand Up @@ -281,6 +282,7 @@ internal class QExpressions
{"3.233 6.46", new Double[] {3.233, 6.46}},

{"(1;`bcd;\"0bc\";5.5e)", new object[] {(long) 1, "bcd", "0bc".ToCharArray(), (float) 5.5}},
{"(42;::;`foo)", new object[] { 42L, null, "foo" }},
{"(enlist 1h; 2; enlist 3j)", new object[] {new short[] {1}, (long) 2, new long[] {3}}},
{"(2;`bcd;\"0bc\";5.5e)", new object[] {1, "bcd", "0bc".ToCharArray(), (Single) 5.5}},
{"(enlist 2h; 2; enlist 3j)", new object[] {new Int16[] {1}, 2, new long[] {3}}},
Expand Down
2 changes: 2 additions & 0 deletions qSharp/test/QExpressions.3.out
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ ED00000080
090002000000D7A3703D0AD70940D7A3703D0AD71940
(1;`bcd;"0bc";5.5e)
000004000000F90100000000000000F5626364000A0003000000306263F80000B040
(42;::;`foo)
000003000000f92a000000000000006500f5666f6f00
(enlist 1h; 2; enlist 3j)
0000030000000500010000000100F902000000000000000700010000000300000000000000
`the`quick`brown`fox
Expand Down
2 changes: 2 additions & 0 deletions qSharp/test/QExpressions.out
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ ED00000080
090002000000D7A3703D0AD70940D7A3703D0AD71940
(1;`bcd;"0bc";5.5e)
000004000000FA01000000F5626364000A0003000000306263F80000B040
(42;::;`foo)
000003000000fa2a0000006500f5666f6f00
(enlist 1h; 2; enlist 3j)
0000030000000500010000000100FA020000000700010000000300000000000000
`the`quick`brown`fox
Expand Down

0 comments on commit a589c07

Please sign in to comment.