org
stringclasses
3 values
repo
stringclasses
3 values
number
int64
637
4.6k
state
stringclasses
1 value
title
stringlengths
6
114
body
stringlengths
9
3.59k
base
stringlengths
90
96
resolved_issues
listlengths
1
2
fix_patch
stringlengths
413
131k
test_patch
stringlengths
387
120k
fixed_tests
stringlengths
61
151k
p2p_tests
stringlengths
1.1k
165k
⌀
f2p_tests
stringlengths
61
3.26k
⌀
s2p_tests
stringclasses
0 values
n2p_tests
stringlengths
55
151k
⌀
run_result
stringlengths
130
74.6k
test_patch_result
stringlengths
119
74.6k
fix_patch_result
stringlengths
130
74.7k
instance_id
stringlengths
15
20
ponylang
ponyc
4,595
closed
Fix compiler crash from `match` with extra parens around `let` in tuple
Fixes #4412 The compiler would crash if an extra set of parens were added to a single element tuple match of a union type. For example, if `type Foo is (I32 | (I32, I32))` is being matched, then a match clause like `| (123, (let x: I32)) => x` would crash the compiler. This was caused by the codegen for the match no...
{"label": "ponylang:main", "ref": "main", "sha": "f8a2feebba3aea298bde89d445ad35ca48602ca7"}
[ { "body": "`ponyc` segfaults when trying to use `match` with a single element tuple destructure form. As expected, it works when you don't use the tuple syntax in the match and with multi-element tuples.\r\n\r\n_Use Case:_\r\n\r\nI understand that using a single-element tuple is strange since it's effectively t...
diff --git a/.release-notes/4595.md b/.release-notes/4595.md new file mode 100644 index 0000000000..3741e30c62 --- /dev/null +++ b/.release-notes/4595.md @@ -0,0 +1,13 @@ +## Fix compiler crash from `match` with extra parens around `let` in tuple + +When matching on a tuple element within a union type, the compiler wou...
diff --git a/test/full-program-tests/regression-4412/expected-exit-code.txt b/test/full-program-tests/regression-4412/expected-exit-code.txt new file mode 100644 index 0000000000..d81cc0710e --- /dev/null +++ b/test/full-program-tests/regression-4412/expected-exit-code.txt @@ -0,0 +1,1 @@ +42 diff --git a/test/full-pro...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "shrink/min_unic...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"regression-4412": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "shrink/min_unic...
{"passed_count": 1890, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1550, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1891, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4595
ponylang
ponyc
4,593
closed
Apply default options for a CLI parent command when a sub command is parsed
Prior to this fix, parsing a sub-command proceeded before assigning defaults to the parent's options. This fix factors out the default processing so it can occur before parsing a sub command. Fixes #4580
{"label": "ponylang:main", "ref": "main", "sha": "ff61416da46dd4a0712d330c59c25d6e8fbf36af"}
[ { "body": "Consider the following setup,\r\n\r\n```pony\r\nuse \"cli\"\r\n\r\nactor Main\r\n new create(env: Env) =>\r\n let spec = try make_spec()? else return end\r\n let cmd =\r\n match CommandParser(spec).parse(env.args, env.vars)\r\n | let c: Command => c\r\n else return\r\n end\...
diff --git a/.release-notes/4593.md b/.release-notes/4593.md new file mode 100644 index 0000000000..44becdec2e --- /dev/null +++ b/.release-notes/4593.md @@ -0,0 +1,3 @@ +## Apply default options for a CLI parent command when a sub command is parsed + +In the CLI package's parser, a default option for a parent command ...
diff --git a/packages/cli/_test.pony b/packages/cli/_test.pony index 9fd121c6a9..5c00372bc8 100644 --- a/packages/cli/_test.pony +++ b/packages/cli/_test.pony @@ -10,6 +10,7 @@ actor \nodoc\ Main is TestList test(_TestBools) test(_TestChat) test(_TestDefaults) + test(_TestDefaultWithSub) test(_Te...
{"372": {"run": "NONE", "test": "NONE", "fix": "PASS"}, "cli/default_with_sub": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catc...
{"cli/default_with_sub": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"372": {"run": "NONE", "test": "NONE", "fix": "PASS"}}
{"passed_count": 1889, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1889, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1890, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4593
ponylang
ponyc
4,588
closed
Fix soundness problem when matching `iso` variables
Closes #4579
{"label": "ponylang:main", "ref": "main", "sha": "e5398b7ab793e2b11f930aa375b9212887614b03"}
[ { "body": "I don't think a field should be consumable, but [this code](https://playground.ponylang.io/?gist=8851afb5cabae5df91a979048f765601) compiles and gives rise to arbitrarily many copies of an iso reference to one object, breaking the isolation guarantees.\r\n\r\nThe particular function that should be cau...
diff --git a/.release-notes/4588.md b/.release-notes/4588.md new file mode 100644 index 0000000000..581a340d4d --- /dev/null +++ b/.release-notes/4588.md @@ -0,0 +1,23 @@ +## Fix soundness problem when matching `iso` variables + +We previously switched our underlying type system model. In the process, a +soundness hole...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index aea3dd268e..0067780068 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -1306,9 +1306,42 @@ TEST_F(BadPonyTest, NotSafeToWrite) const char* errs[] = {"not safe to write right side to left side", NULL}; c...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "if...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"BadPonyTest.MatchIsoFieldWithoutConsume": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "BadPonyTest.MatchIsoLetWithoutConsume": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "MatchTypeTest.Capabilities": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "if...
{"passed_count": 1889, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1411, "failed_count": 3, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1891, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4588
ponylang
ponyc
4,583
closed
Make sure scheduler threads don't ACK the quiescence protocol CNF messages if they have an actor waiting to be run
Make sure scheduler threads don't `ACK` the quiescence protocol `CNF` messages if they have an actor waiting to be run. Resolves #4582
{"label": "ponylang:main", "ref": "main", "sha": "115143f6bc5a90ff19c3af2bee68f3077fc5f1a3"}
[ { "body": "The expectation when we merged actor pinning was that it worked the same for quiescence as a program without pinning. However that isn't the case at the moment. Given the quiescence rules, we would expect the following program to never end as the `Main` actor will always have a message in its queue.\...
diff --git a/.release-notes/4583.md b/.release-notes/4583.md new file mode 100644 index 0000000000..7636516237 --- /dev/null +++ b/.release-notes/4583.md @@ -0,0 +1,3 @@ +## Make sure scheduler threads don't ACK the quiescence protocol CNF messages if they have an actor waiting to be run + +Prior to this, the pinned ac...
diff --git a/test/full-program-tests/regression-4582/expected-exit-code.txt b/test/full-program-tests/regression-4582/expected-exit-code.txt new file mode 100644 index 0000000000..105d7d9ad3 --- /dev/null +++ b/test/full-program-tests/regression-4582/expected-exit-code.txt @@ -0,0 +1,1 @@ +100 \ No newline at end of fi...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "shrink/min_unic...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"regression-4582": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "shrink/min_unic...
{"passed_count": 1888, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1549, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1889, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4583
ponylang
ponyc
4,506
closed
Fix generation of invalid LLVM IR
Fix #4475 Before this change, `LLVM` reported an error during module verification when trying to compile the code referenced in issue #4475: ```pony class Foo new create(a: U32) ? => error actor Main new create(env: Env) => try let f = Foo(1)? end ``` This bug was caused by the f...
{"label": "ponylang:main", "ref": "main", "sha": "cb2f814b6c182f7d469d5007aa52885cf24fad34"}
[ { "body": "```pony\r\nclass Foo\r\n new create(a: U32) ? =>\r\n error\r\n\r\nactor Main\r\n new create(env: Env) =>\r\n try\r\n let f = Foo(1)?\r\n end\r\n```\r\n\r\nResults in:\r\n\r\n```\r\nTerminator found in the middle of a basic block!\r\nlabel %entry\r\nError:\r\nModule verification failed...
diff --git a/.release-notes/4506.md b/.release-notes/4506.md new file mode 100644 index 0000000000..d3218dbc61 --- /dev/null +++ b/.release-notes/4506.md @@ -0,0 +1,15 @@ +## Fix generation of invalid LLVM IR + +Previously, this code failed at LLVM module verification. Now, with this change, it's fixed by stopping the ...
diff --git a/test/full-program-tests/issue-4475-case-1/main.pony b/test/full-program-tests/issue-4475-case-1/main.pony new file mode 100644 index 0000000000..616ecfce37 --- /dev/null +++ b/test/full-program-tests/issue-4475-case-1/main.pony @@ -0,0 +1,32 @@ +""" +Before issue #4475 was fixed, LLVM module checking faile...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "shrink/min_unic...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"issue-4475-case-1": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "shrink/min_unic...
{"passed_count": 1883, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1545, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1885, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4506
ponylang
ponyc
4,505
closed
Fix compiler crash
Fix #4477 Before this PR this code didn't work and cause segmentation fault as reported in issue #4477: ```pony struct FFIBytes var ptr: Pointer[U8 val] = Pointer[U8].create() var length: USize = 0 fun iso string(): String val => recover String.from_cpointer(consume FFIBytes.ptr, consum...
{"label": "ponylang:main", "ref": "main", "sha": "be1000c459a714e164c52b677c492fc9af385ffe"}
[ { "body": "I've been told multiple times that this looks like a compiler bug, and I agree, so I'm posting this here. The following code causes a segfault in the compiler:\r\n\r\n```pony\r\nstruct FFIBytes\r\n var ptr: Pointer[U8 val] = Pointer[U8].create()\r\n var length: USize = 0\r\n\r\n fun iso stri...
diff --git a/.release-notes/4505.md b/.release-notes/4505.md new file mode 100644 index 0000000000..f894d2c700 --- /dev/null +++ b/.release-notes/4505.md @@ -0,0 +1,16 @@ +## Fix compiler crash + +Previously the following code would cause the compiler to crash. Now it will display a helpful error message: + +```pony +s...
diff --git a/test/libponyc/refer.cc b/test/libponyc/refer.cc index 89581d403e..e0ee127588 100644 --- a/test/libponyc/refer.cc +++ b/test/libponyc/refer.cc @@ -18,6 +18,10 @@ { const char* errs[] = {err1, err2, err3, NULL}; \ DO(test_expected_errors(src, "refer", errs)); } +#define TEST_ERRORS_4(src, err1, err...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PA...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
null
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PA...
{"passed_count": 1882, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1265, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1883, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4505
ponylang
ponyc
4,458
closed
Fix compiler bug that allows an unsafe data access pattern
Last November, Gordon identified that the compiler was allowing code to recover a `val` from a `box` field. This is unsafe and very "doh". After investigation, it was determined that this bug has existed since Sylvan introduced viewpoint adaptation to the compiler almost a decade ago. I came up with a fix, but af...
{"label": "ponylang:main", "ref": "main", "sha": "e86d34aef1fd6abff7d8e777817f09be36509668"}
[ { "body": "In the following code\r\n\r\n```pony\r\nclass Foo\r\n let s: String box\r\n \r\n new create(s': String box) =>\r\n s = s'\r\n \r\n fun get_s(): String val =>\r\n recover val s end\r\n\r\nactor Main\r\n new create(env: Env) =>\r\n let s = String\r\n s.append(\"world\")\r\n let foo...
diff --git a/.release-notes/issue-4244.md b/.release-notes/issue-4244.md new file mode 100644 index 0000000000..19e4514eb4 --- /dev/null +++ b/.release-notes/issue-4244.md @@ -0,0 +1,28 @@ +## Fix compiler bug that allows an unsafe data access pattern + +In November of last year, core team member Gordon Tisher identifi...
diff --git a/test/libponyc/recover.cc b/test/libponyc/recover.cc index 54d80e4c76..8cd51df7a0 100644 --- a/test/libponyc/recover.cc +++ b/test/libponyc/recover.cc @@ -293,6 +293,49 @@ TEST_F(RecoverTest, CantAccess_NonSendableField) TEST_ERRORS_1(src, "can't access non-sendable field of non-sendable object"); } +...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "if...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"RecoverTest.CantRecover_BoxFieldToVal_V2": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "RecoverTest.CantRecover_BoxFieldToVal_V1": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "if...
{"passed_count": 1871, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1408, "failed_count": 2, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1874, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4458
ponylang
ponyc
4,299
closed
Remove ambiguity from "not safe to write" compiler error message
Fixes #4290 With this change, the error becomes: ``` Error: /Users/jairocaro-accinoviciana/issues-pony-4290/demo.pony:10:11: not safe to write right side to left side x.foo = foo ^ Info: /Users/jairocaro-accinoviciana/issues-pony-4290/demo.pony:9:14: right side type: Foo ref ...
{"label": "ponylang:main", "ref": "main", "sha": "2e4e9e27dc9bb935c4319f4b1dcd4fe54bbca81d"}
[ { "body": "Currently, when it is not safe to write, the error message only talks about the right side, not the left side, nor the reason for the failure of safety. This is confusing to new users, as in: https://ponylang.zulipchat.com/#narrow/stream/189985-beginner-help/topic/not.20safe.20to.20write\r\n\r\nFor e...
diff --git a/.release-notes/4299.md b/.release-notes/4299.md new file mode 100644 index 0000000000..1e75b2ae79 --- /dev/null +++ b/.release-notes/4299.md @@ -0,0 +1,31 @@ +## Remove ambiguity from "not safe to write" compiler error message + +Previously, when displaying the "not safe to write" error message, the inform...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index 3699733bd8..aea3dd268e 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -1287,3 +1287,28 @@ TEST_F(BadPonyTest, CantAssignErrorExpression) TEST_ERRORS_1(src, "right side must be something that can be assigned") } + +T...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "if...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"BadPonyTest.NotSafeToWrite": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "if...
{"passed_count": 1883, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1406, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1884, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4299
ponylang
ponyc
4,294
closed
Fix runtime segfault
When I implemented turning off the unsafe "don't trace immutable objects" optimization in PR #4256, I incorrectly caused opaque objects to be traced in a couple of scenarios. Tracing opaque objects will result in a segfault like the one discovered by Gordon. Fixes #4284
{"label": "ponylang:main", "ref": "main", "sha": "c026193ed8e70bad5ba6fdc2f0da23879ddec9ce"}
[ { "body": "I am encountering a null pointer dereference in libponyrt; it happens in `pony_traceunknown()` (https://github.com/ponylang/ponyc/blob/main/src/libponyrt/gc/trace.c#L120; `p` is null at this point).\r\n\r\nThe stack trace in LLDB looks like:\r\n\r\n```\r\n* thread #4, name = 'test', stop reason = sig...
diff --git a/.release-notes/fix-4284.md b/.release-notes/fix-4284.md new file mode 100644 index 0000000000..77465a82c1 --- /dev/null +++ b/.release-notes/fix-4284.md @@ -0,0 +1,5 @@ +## Fix runtime segfault + +A segfault was introduced in ["Fix segfault caused by unsafe garbage collection optimization"](https://github....
diff --git a/test/libponyc-run/regression-4284/main.pony b/test/libponyc-run/regression-4284/main.pony new file mode 100644 index 0000000000..602bafad93 --- /dev/null +++ b/test/libponyc-run/regression-4284/main.pony @@ -0,0 +1,45 @@ +use "pony_test" + + +// As long as #4284 is fixed, this program will run to completio...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"regression-4284": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"passed_count": 1882, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1532, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1883, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4294
ponylang
ponyc
4,288
closed
Fix compiler crash introduced in #4283
Fixes a missed case in #4283 (arrow types). Instead of displaying an error message, the user who was attempting to do an unsafe mutation of a val was greeted by a compiler crash. Fixes #4287
{"label": "ponylang:main", "ref": "main", "sha": "d9a01b50be50dcc4570cfceaa675aefc0225002a"}
[ { "body": "program:\r\n\r\n```pony\r\nactor Main\r\n var niclas:String = \"Niclas\"\r\n \r\n new create(env: Env) =>\r\n start()\r\n \r\n be start() =>\r\n _start()\r\n \r\n fun _start() =>\r\n niclas = \"Hedhman\"\r\n```\r\n\r\nbacktrace:\r\n\r\n```\r\n* thread #1, name = 'ponyc', stop reas...
diff --git a/.release-notes/4287.md b/.release-notes/4287.md new file mode 100644 index 0000000000..9fcd123e6d --- /dev/null +++ b/.release-notes/4287.md @@ -0,0 +1,5 @@ +## Fix compiler crash when attempting to mutate a val field + +In Pony 0.52.4 we fixed an unsoundness bug that had been introduced over the summer. W...
diff --git a/test/libponyc/cap_safety.cc b/test/libponyc/cap_safety.cc index 0c1b5e282a..7d94e8c466 100644 --- a/test/libponyc/cap_safety.cc +++ b/test/libponyc/cap_safety.cc @@ -181,3 +181,16 @@ TEST_F(CapSafetyTest, WriteValToIso) TEST_COMPILE(src); } + +TEST_F(CapSafetyTest, NoWriteArrow) +{ + const char* src...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catc...
{"SugarTest.TryWithoutElse": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ArrayTest.InferFromArrayBoxNeedNotRecovered": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarTest.ClassWithoutFieldOrCreate": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarTest.LambdaTypeParamsAndReturn": {"run": "PASS", "test"...
null
null
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catc...
{"passed_count": 1881, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 195, "failed_count": 0, "skipped_count": 0, "passed_tests": ["Pool.LargeAlloc", "SugarTest.LambdaTypeFunTypeParams", "LiteralLimitTest.I16Max", "SugarTest.ForWithElse", "SugarTest.ActorWithInitializedFieldAndManyConstructors", "ArrayTest.EmptyArrayLiteral", "ErrorTest.PonyTry", "SugarTest.Xor", "SugarT...
{"passed_count": 1882, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4288
ponylang
ponyc
4,263
closed
Fix crash when calling `(this.)create()`
This PR removes a superfluous receiver cap check when trying to autorecover a create expression in an assignment. That check could assert when calling `create()` (with implicit `this`). Fixes #4259
{"label": "ponylang:main", "ref": "main", "sha": "9f75e9eefcc118e65439bd609218cb9aace84ae6"}
[ { "body": "```pony\r\nactor Main\r\n new create(env: Env) =>\r\n A.create().f()\r\n\r\nclass A\r\n fun f() =>\r\n create() // fine\r\n let a = create() // compiler crash\r\n let b = A.create() // fine\r\n```\r\nBoth default and defined `create` crash. Not storing the result removes the crash.\r\n\...
diff --git a/.release-notes/4263.md b/.release-notes/4263.md new file mode 100644 index 0000000000..1977415bec --- /dev/null +++ b/.release-notes/4263.md @@ -0,0 +1,3 @@ +## Fix compiler crash when calling (this.)create() + +Fixed a crash when calling `.create()` (with an implicit `this`). diff --git a/src/libponyc/exp...
diff --git a/test/libponyc-run/ctor-autorecover-this/main.pony b/test/libponyc-run/ctor-autorecover-this/main.pony new file mode 100644 index 0000000000..c6901b0d9b --- /dev/null +++ b/test/libponyc-run/ctor-autorecover-this/main.pony @@ -0,0 +1,7 @@ +actor Main + new create(env: Env) => + A.create().f() + +class A...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"ctor-autorecover-this": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"passed_count": 1866, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1516, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1867, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4263
ponylang
ponyc
4,182
closed
Fix identity comparison check with desugared creations
While identity comparison with new objects was correctly catched by the compiler as always false when using sugared syntax, it wasn't using desugared one. This patch makes the compiler in the latter case. This example is now failing: ```pony class C actor Main new create(env: Env) => env.out.prin...
{"label": "ponylang:main", "ref": "main", "sha": "ac7a441dfb7c6d390dd8d78e8d46670b2faad1cb"}
[ { "body": "Consider the following program:\r\n```pony\r\nclass C\r\n\r\nprimitive P\r\n\r\nactor Main\r\n new create(env: Env) =>\r\n env.out.print(if C is C then \"C is C\" else \"C is NOT C\" end)\r\n env.out.print(if P is P then \"P is P\" else \"P is NOT P\" end)\r\n```\r\n\r\nAs expected, it fails w...
diff --git a/.release-notes/4182.md b/.release-notes/4182.md new file mode 100644 index 0000000000..49338608fe --- /dev/null +++ b/.release-notes/4182.md @@ -0,0 +1,25 @@ +## Enhance checking for identity comparison with new objects + +Consider the following program: + +```pony +class C + +actor Main + new create(env:...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index 0dba544bb5..3699733bd8 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -1059,11 +1059,13 @@ TEST_F(BadPonyTest, IsComparingCreateSugar) const char* src = "primitive P\n" "class C\n" + "actor A\n" "actor...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "if...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"BadPonyTest.IsComparingNamedConstructor": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "BadPonyTest.IsComparingCreate": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "if...
{"passed_count": 1864, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1391, "failed_count": 2, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1866, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4182
ponylang
ponyc
4,132
closed
Fix String.f32 and String.f64 errors with non null terminated strings
These methods rely on strof/strod, which require null-terminated strings. We were passing our pointer to C without first checking if our string was null-terminated, which means that C would be able to read past our memory allocation. This fixes #1445
{"label": "ponylang:main", "ref": "main", "sha": "7b07d4d3545632369b4ea5106770cbb57b74a6dc"}
[ { "body": "The string-to-float conversions in builtin/string.pony are done by a call to C library routines that expect null terminated strings. But the code there is still passing _ptr. There may be other places where this happens.", "number": 1445, "title": "strtof and related functions need cstring...
diff --git a/.release-notes/4132.md b/.release-notes/4132.md new file mode 100644 index 0000000000..61a67389be --- /dev/null +++ b/.release-notes/4132.md @@ -0,0 +1,3 @@ +## Fix String.f32 and String.f64 errors with non null terminated strings + +Until now, the `String.f32` and `String.f64` methods required null-termin...
diff --git a/packages/builtin_test/_test.pony b/packages/builtin_test/_test.pony index 4887f0667f..5ac260fd8d 100644 --- a/packages/builtin_test/_test.pony +++ b/packages/builtin_test/_test.pony @@ -306,6 +306,27 @@ class \nodoc\ iso _TestStringToFloat is UnitTest h.assert_true("+INFINITY".f64()?.infinite()) ...
{"builtin/String.float": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "382": {"run": "PASS", "test": "NONE", "fix": "PASS"}}
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catc...
{"builtin/String.float": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"382": {"run": "PASS", "test": "NONE", "fix": "PASS"}}
{"passed_count": 1848, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1847, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1848, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4132
ponylang
ponyc
4,087
closed
Fix compiler assertion on FFI call
Fixes #4086, forgot to check the case where the call happens outside of a method
{"label": "ponylang:main", "ref": "main", "sha": "c3b03ecdce07da8e0f867fd784a9e4aac9e45659"}
[ { "body": "nightly-20220403 successfully compiles the following:\r\n\r\n```pony\r\nuse @thing_alloc[Pointer[None]]()\r\n\r\nactor Main\r\n let _thing: Pointer[None]\r\n new create(env:Env) => \r\n env.out.print(\"test\")\r\n _thing = @thing_alloc()\r\n```\r\n\r\nnightly-20220403 crashes if given the fol...
diff --git a/src/libponyc/pass/syntax.c b/src/libponyc/pass/syntax.c index 2f4a8c9f2b..0938496314 100644 --- a/src/libponyc/pass/syntax.c +++ b/src/libponyc/pass/syntax.c @@ -646,8 +646,9 @@ static ast_result_t syntax_ffi_call(pass_opt_t* opt, ast_t* ast) pony_assert(ast_id(ast) == TK_FFICALL); ast_result_t r = A...
diff --git a/test/libponyc-run/ffi-call-in-initializer/additional.c b/test/libponyc-run/ffi-call-in-initializer/additional.c new file mode 100644 index 0000000000..bd9d7ce114 --- /dev/null +++ b/test/libponyc-run/ffi-call-in-initializer/additional.c @@ -0,0 +1,10 @@ +#ifdef _MSC_VER +# define EXPORT_SYMBOL __declspec(...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"ffi-call-in-initializer": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"passed_count": 1847, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
{"passed_count": 1497, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultInterfaceBe", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.Infer...
{"passed_count": 1848, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "BadPonyTest.FFICallInDefaultIn...
ponylang__ponyc_4087
ponylang
ponyc
4,067
closed
Fix compiler crash in HeapToStack optimization pass
This is a good one. One the March 22, 2022 development sync, we collectively debugged issue #4059. We finally arrived at the conclusion that our call graph usage was incorrect. Originally during the call, Joe realized that while we were using, we weren't doing it correctly. The initial assumption was that the in...
{"label": "ponylang:main", "ref": "main", "sha": "95581106d93b1f16aad6269f12d6f02684f8dd8c"}
[ { "body": "My offending code is in the following playground link: https://playground.ponylang.io/?gist=6e4fdaad3b062b9e8a1bffe457e5e422\r\n\r\nIt compiles when I call ponyc with the ```-d``` option. The compiler crashes (SEGV) when the ```-d``` is absent.\r\n\r\nHere is the output from the compiler:\r\n```\r\...
diff --git a/.release-notes/4059.md b/.release-notes/4059.md new file mode 100644 index 0000000000..20c53f7053 --- /dev/null +++ b/.release-notes/4059.md @@ -0,0 +1,3 @@ +## Fixed bug that caused the compiler to crash + +We've fixed a [bug](https://github.com/ponylang/ponyc/issues/4059) that caused a compiler crash. di...
diff --git a/test/libponyc-run/regression-4059/main.pony b/test/libponyc-run/regression-4059/main.pony new file mode 100644 index 0000000000..ad8e3acea9 --- /dev/null +++ b/test/libponyc-run/regression-4059/main.pony @@ -0,0 +1,13 @@ +actor Main + new create(env: Env) => + let p: HtmlNode = P + p.apply() + +clas...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"regression-4059": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"passed_count": 1837, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAss...
{"passed_count": 1487, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBoxNeedNotRecovered", "SubTypeTest...
{"passed_count": 1838, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAss...
ponylang__ponyc_4067
ponylang
ponyc
4,061
closed
Fix parameter names not being checked
In 2018, when we [removed case functions](https://github.com/ponylang/ponyc/pull/2542) from Pony, we also removed the checking to make sure that parameters names were valid. We've added checking of parameter names to make sure they match the naming rules for parameters in Pony. Fixes #4054
{"label": "ponylang:main", "ref": "main", "sha": "65e2cfc70fc900976ea5e93fc500f39a6844ae73"}
[ { "body": "According to the [Naming Rules in the tutorial](https://tutorial.ponylang.io/types/classes.html#naming-rules):\r\n\r\n> After an underscore for private or special methods (behaviors, constructors, and functions), any method or variable, including parameters and fields, must start with a lowercase let...
diff --git a/.release-notes/4054.md b/.release-notes/4054.md new file mode 100644 index 0000000000..f19a356462 --- /dev/null +++ b/.release-notes/4054.md @@ -0,0 +1,5 @@ +## Fixed parameter names not being checked + +In 2018, when we [removed case functions](https://github.com/ponylang/ponyc/pull/2542) from Pony, we al...
diff --git a/test/libponyc/sugar.cc b/test/libponyc/sugar.cc index e60432391d..f8b4c70446 100644 --- a/test/libponyc/sugar.cc +++ b/test/libponyc/sugar.cc @@ -553,7 +553,7 @@ TEST_F(SugarTest, FunctionNoReturnBody) } -TEST_F(SugarTest, FunctionParamMustBeId) +TEST_F(SugarTest, MethodParamMustBeId) { const char...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "if...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"SugarTest.MethodParamMustBeId": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "if...
{"passed_count": 1837, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAss...
{"passed_count": 1371, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBoxNeedNotRecovered", "SubTypeTest...
{"passed_count": 1837, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAss...
ponylang__ponyc_4061
ponylang
ponyc
4,057
closed
Fix crash with exhaustive match and generics
We previously had a compiler crash caused by trying to jump to a next block in a match that might not exist because it had been removed from the particular reification of a generic. Fixes #3447
{"label": "ponylang:main", "ref": "main", "sha": "bc0d988f909d6bb2698b836bb5f592aa567f6fb6"}
[ { "body": "The following code causes the compiler to segfault during the \"Functions\" step:\r\n\r\n```pony\r\nactor Main\r\n new create(env: Env) =>\r\n Dealer.from[U8](0)\r\n // Dealer(0) // -- does not cause any segfault\r\n\r\nclass Dealer\r\n new from[U: (U8 | Dealer val)](u: U val) =>\r\n // No...
diff --git a/.release-notes/3447.md b/.release-notes/3447.md new file mode 100644 index 0000000000..1e810f4ec7 --- /dev/null +++ b/.release-notes/3447.md @@ -0,0 +1,3 @@ +## Fix compiler crash with exhaustive match in generics + +Previously, there was an interesting edge case in our handling of exhaustive match with ge...
diff --git a/test/libponyc-run/regression-3447/main.pony b/test/libponyc-run/regression-3447/main.pony new file mode 100644 index 0000000000..d41d6b4667 --- /dev/null +++ b/test/libponyc-run/regression-3447/main.pony @@ -0,0 +1,10 @@ +actor Main + new create(env: Env) => + Dealer.from[U8](0) + +class Dealer + new ...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"regression-3447": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"passed_count": 1836, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAss...
{"passed_count": 1486, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBoxNeedNotRecovered", "SubTypeTest...
{"passed_count": 1837, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAss...
ponylang__ponyc_4057
ponylang
ponyc
4,034
closed
Add PonyCheck to standard library
Closes #4029
{"label": "ponylang:main", "ref": "main", "sha": "bafd65652fb97068271a5c462066bcc1a433f82f"}
[ { "body": "Add [ponycheck](https://github.com/ponylang/ponycheck) to the Pony standard library.\r\n\r\nhttps://github.com/ponylang/rfcs/blob/main/text/0073-add-ponycheck-to-stdlib.md", "number": 4029, "title": "RFC 73: Add ponycheck to the standard library" } ]
diff --git a/.cirrus.yml b/.cirrus.yml index 2dadd0e2d8..0ac9951f49 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -52,7 +52,7 @@ task: arm_container: image: ponylang/ponyc-ci-aarch64-unknown-linux-ubuntu20.04-builder:20211003 cpu: 8 - memory: 4 + memory: 6 environment: IMAGE: ponylang/ponyc...
diff --git a/packages/pony_check/_test.pony b/packages/pony_check/_test.pony new file mode 100644 index 0000000000..d65d7d7f7b --- /dev/null +++ b/packages/pony_check/_test.pony @@ -0,0 +1,1415 @@ +use "ponytest" + +use "collections" +use "itertools" +use "random" +use "time" + +actor \nodoc\ Main is TestList + new cr...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "NONE", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
null
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "property_runner/infinite_shrink": {"run": "NONE", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.roo...
{"passed_count": 1744, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
{"passed_count": 1466, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBoxNeedNotRecovered", "SubTypeTest...
{"passed_count": 1816, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "property_runner/infinite_shrink", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAss...
ponylang__ponyc_4034
ponylang
ponyc
4,024
closed
Reimplement `with`
The `with` keyword has been little used in most Pony programs. `with` was implemented as "sugar" over the `try/else/then` construct. Over the course of time, this became problematic as changes were made to make `try` more friendly. However, these `try` changes negatively impacted `with`. Prior to this change, `...
{"label": "ponylang:main", "ref": "main", "sha": "073bad675760bfd1d6a7e1a7c37fdb56744b7a14"}
[ { "body": "[The tutorial mentions](https://tutorial.ponylang.io/expressions/errors.html#with-blocks) that the return type of a `with` block is \"_the value of the last expression in the block, or of the last expression in the else block if there is one and an error occurred._\"\r\n\r\nHowever, the above is inco...
diff --git a/.release-notes/4024.md b/.release-notes/4024.md new file mode 100644 index 0000000000..5e289e57e4 --- /dev/null +++ b/.release-notes/4024.md @@ -0,0 +1,67 @@ +## Reimplement `with` + +The `with` keyword has been little used in most Pony programs. `with` was implemented as "sugar" over the `try/else/then` c...
diff --git a/test/libponyc-run/with-as-expression/expected-exit-code.txt b/test/libponyc-run/with-as-expression/expected-exit-code.txt new file mode 100644 index 0000000000..f599e28b8a --- /dev/null +++ b/test/libponyc-run/with-as-expression/expected-exit-code.txt @@ -0,0 +1,1 @@ +10 diff --git a/test/libponyc-run/with...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS",...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"with-error-from-function": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "with-error-in-block": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "with-as-expression": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS",...
{"passed_count": 1743, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
{"passed_count": 1461, "failed_count": 3, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBoxNeedNotRecovered", "SubTypeTest...
{"passed_count": 1747, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
ponylang__ponyc_4024
ponylang
ponyc
4,017
closed
Fix compiler crash related to using tuples in a union as a generic constraint
Tuple types aren't legal constraints on generics in Pony and we have a check in an early compiler pass to detect and report that error. However, it was previously possible to "sneak" a tuple type as a generic constraint past the earlier check in the compiler by "smuggling" it in a type union in a type alias. The...
{"label": "ponylang:main", "ref": "main", "sha": "10f8a8bc0810b80e0f7ab3aa09fafba98e9f2227"}
[ { "body": "```pony\r\ntype Blocksize is (None | (U8, U32))\r\nclass Block[T: Blocksize]\r\n```\r\n\r\nwill crash the compiler. \r\n\r\n#4005 fixed part of the issue, but what is needed now is to take the fix code from there, move it to its own function so that we can also iterate over a typeunion as a constrain...
diff --git a/.release-notes/tuples-in-unions-constraint.md b/.release-notes/tuples-in-unions-constraint.md new file mode 100644 index 0000000000..efffcd7a4f --- /dev/null +++ b/.release-notes/tuples-in-unions-constraint.md @@ -0,0 +1,12 @@ +## Fix compiler crash related to using tuples in a union as a generic constrain...
diff --git a/test/libponyc/flatten.cc b/test/libponyc/flatten.cc index 8b980d5375..628c278ecc 100644 --- a/test/libponyc/flatten.cc +++ b/test/libponyc/flatten.cc @@ -80,7 +80,7 @@ TEST_F(FlattenTest, SendableParamConstructor) } // regression for #3655 -TEST_F(FlattenTest, TupleConstraintInUnion) +TEST_F(FlattenTes...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catc...
{"ListTest.InitializeList": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SuggestAltNameTest.SuggestAltName_DifferentCaseVariable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "BuildFlagSetTest.UserFlagDefined": {"run": "PASS...
null
null
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catc...
{"passed_count": 1741, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
{"passed_count": 57, "failed_count": 0, "skipped_count": 0, "passed_tests": ["Pool.LargeAlloc", "HashMapTest.TryGetNonExistent", "Pool.Index", "HashMapTest.HashMapSize", "DsFunTest.NumbersToNextPow", "ListTest.ListLength", "HashMapTest.Serialisation", "DsFunTest.PowersOfTwoAreNotRounded", "ErrorTest.PonyTry", "ListTest...
{"passed_count": 1743, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
ponylang__ponyc_4017
ponylang
ponyc
4,006
closed
Take exhaustive match into account when checking for field initialization
Previously, exhaustive matches were handled after we verified that an object's fields were initialized. This lead to the code such as the following not passing compiler checks: ```pony primitive Foo fun apply() : (U32 | None) => 1 type Bar is (U32 | None) actor Main let bar : Bar new create(env :...
{"label": "ponylang:main", "ref": "main", "sha": "d330436df984eb3000c64ced4c2b5b308c296019"}
[ { "body": "```Pony\r\nprimitive Foo\r\n fun apply() : (U32 | None) => 1\r\n\r\ntype Bar is (U32 | None)\r\n\r\nactor Main\r\n let bar : Bar\r\n\r\n new create(env : Env) =>\r\n match Foo()\r\n | let result : U32 =>\r\n bar = result\r\n | None =>\r\n bar = 0\r\...
diff --git a/.release-notes/issue-3616.md b/.release-notes/issue-3616.md new file mode 100644 index 0000000000..31d926c325 --- /dev/null +++ b/.release-notes/issue-3616.md @@ -0,0 +1,23 @@ +## Take exhaustive match into account when checking for field initialization + +Previously, exhaustive matches were handled after ...
diff --git a/test/libponyc-run/regression-3615/main.pony b/test/libponyc-run/regression-3615/main.pony new file mode 100644 index 0000000000..fe3f85bafe --- /dev/null +++ b/test/libponyc-run/regression-3615/main.pony @@ -0,0 +1,15 @@ +primitive Foo + fun apply() : (U32 | None) => 1 + +type Bar is (U32 | None) + +actor...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS",...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"regression-3615": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS",...
{"passed_count": 1723, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
{"passed_count": 1445, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBoxNeedNotRecovered", "SubTypeTest...
{"passed_count": 1724, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
ponylang__ponyc_4006
ponylang
ponyc
4,005
closed
Fix compiler crash related to using tuples as a generic constraint
Tuple types aren't legal constraints on generics in Pony and we have a check in the syntax pass to detect and report that error. However, it was previously possible to sneak a tuple type as a generic constraint past the syntax check by smuggling it in a type alias. Type aliases aren't flattened into their various...
{"label": "ponylang:main", "ref": "main", "sha": "91c59d376f8515153c67a9460dec6f701ca129df"}
[ { "body": "Hi! Really new Pony user here.\r\nFound an issue with the AST parser:\r\n\r\n```pony\r\ntype Blocksize is (U8, U32)\r\nclass Block[T: Blocksize]\r\n```\r\nI understand the type should actually be `(U8 | U32)`.\r\nBut the compiler produces on current master (59dddb6) and on last release:\r\n```\r\n/tm...
diff --git a/.release-notes/fix-3655.md b/.release-notes/fix-3655.md new file mode 100644 index 0000000000..9dbc7eae9a --- /dev/null +++ b/.release-notes/fix-3655.md @@ -0,0 +1,12 @@ +## Fix compiler crash related to using tuples as a generic constraint + +Tuple types aren't legal constraints on generics in Pony and we...
diff --git a/test/libponyc/flatten.cc b/test/libponyc/flatten.cc index 8cb0054d16..8b980d5375 100644 --- a/test/libponyc/flatten.cc +++ b/test/libponyc/flatten.cc @@ -58,6 +58,7 @@ TEST_F(FlattenTest, TypeparamCap) TEST_ERROR(src); } + TEST_F(FlattenTest, SendableParamConstructor) { const char* src = @@ -77,...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catc...
{"SugarTest.TryWithoutElse": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ArrayTest.InferFromArrayBoxNeedNotRecovered": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "VerifyTest.ConsumeEmbedFieldVarSubfieldReassignTrySameExpression": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "VerifyTest.ConsumeVarFieldReass...
null
null
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catc...
{"passed_count": 1743, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
{"passed_count": 610, "failed_count": 0, "skipped_count": 0, "passed_tests": ["VerifyTest.ConsumeVarLocalVarSubfieldReassignTry", "VerifyTest.ConsumeEmbedFieldVarSubfieldReassignSameExpressionPartial", "SugarTest.ActorWithInitializedFieldAndManyConstructors", "BareTest.BareLambda_TypeTypeParameters", "VerifyTest.Consum...
{"passed_count": 1744, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
ponylang__ponyc_4005
ponylang
ponyc
3,991
closed
Add workaround for compiler assertion failure in Promise.flatten_next
This fixes #3856 with only a workaround and explicitly without actually solving the underlying issue, but hey, it's something. Somehow the replaced lambda, or to be exact, the hygienic type created for it, wasn't properly reified and remained as a generic type. The hygienic type generates was: ``` promises_$2$7_...
{"label": "ponylang:main", "ref": "main", "sha": "8ebf87119cf958de07577c0c8b71e2ce63c5986e"}
[ { "body": "OS:\r\nAlpine Linux Stable\r\n\r\nopenssl 1.1.1\r\n\r\nCompiler Version:\r\n```\r\n$ ponyc --version\r\n0.44.0-48084fe4 [release]\r\nCompiled with: LLVM 12.0.1 -- Clang-10.0.0-x86_64\r\nDefaults: pic=true\r\n```\r\n\r\nCompiler Error Message\r\n```\r\ncorral run -- ponyc -Dopenssl_1.1.x\r\n exit: Si...
diff --git a/.release-notes/3991.md b/.release-notes/3991.md new file mode 100644 index 0000000000..c0395de728 --- /dev/null +++ b/.release-notes/3991.md @@ -0,0 +1,5 @@ +## Add workaround for compiler assertion failure in Promise.flatten_next + +Under certain conditions a specific usage of `Promise.flatten_next` and `...
diff --git a/test/libponyc-run/promise-flatten-next-regression-3856/main.pony b/test/libponyc-run/promise-flatten-next-regression-3856/main.pony new file mode 100644 index 0000000000..37059dd73d --- /dev/null +++ b/test/libponyc-run/promise-flatten-next-regression-3856/main.pony @@ -0,0 +1,24 @@ +use "promises" + +acto...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS",...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"promise-flatten-next-regression-3856": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "itertools/Iter.unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS",...
{"passed_count": 1723, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
{"passed_count": 1445, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBoxNeedNotRecovered", "SubTypeTest...
{"passed_count": 1724, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
ponylang__ponyc_3991
ponylang
ponyc
3,973
closed
Don't allow interfaces to have private methods
When Pony allowed interfaces to have private methods, it was possible to use an interface to break encapsulation for objects and access private methods from outside their enclosing package. The following code used to be legal Pony code but will now fail with a compiler error: ```pony actor Main new create(env...
{"label": "ponylang:main", "ref": "main", "sha": "ca368192917b76bb43e0892d4f14cbdf18e1f7d6"}
[ { "body": "Sylvan and Paul have noticed that private methods are accessible across packages through interfaces that define those private methods. If this is does not immediately sound terrifying, here is a gist provided by Sylvan: https://playground.ponylang.io/?gist=7628fd7629fe74344caceabd147b58cc\r\n\r\nEith...
diff --git a/.release-notes/3973.md b/.release-notes/3973.md new file mode 100644 index 0000000000..8d784126fa --- /dev/null +++ b/.release-notes/3973.md @@ -0,0 +1,76 @@ +## Don't allow interfaces to have private methods + +When Pony allowed interfaces to have private methods, it was possible to use an interface to br...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index bba8a70dfe..5a2c178c18 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -1060,11 +1060,11 @@ TEST_F(BadPonyTest, DisallowPointerAndMaybePointerInEmbeddedType) " embed ok: Ok = Ok\n" " embed not_ok: Pointer[None] = ...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "iftype-false": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"BadPonyTest.InterfacesCantHavePrivateMethods": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "iftype-false": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"...
{"passed_count": 1712, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
{"passed_count": 1371, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBoxNeedNotRecovered", "SubTypeTest...
{"passed_count": 1713, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
ponylang__ponyc_3973
ponylang
ponyc
3,971
closed
Fix return checking in behaviours and constructors
Our checks to make sure that the usage of return in behaviours and constructors was overly restrictive. It was checking for any usage of `return` that had a value including when the return wasn't from the method itself. For example: ```pony actor Main new create(env: Env) => let f = {() => if true then r...
{"label": "ponylang:main", "ref": "main", "sha": "8c8306a8b4e1f42afa2b19a6007987901b0864c8"}
[ { "body": "Over on Zulip, Rowland Smith raised the following (abbreviated example):\r\n\r\nThe following program fails to compile with \"A return in a constructor must not have an expression\", even though the `return` happens inside a lambda.\r\n\r\n```pony\r\nactor Main\r\n new create(env: Env) =>\r\n let...
diff --git a/.release-notes/3971.md b/.release-notes/3971.md new file mode 100644 index 0000000000..3fd1e8cce2 --- /dev/null +++ b/.release-notes/3971.md @@ -0,0 +1,14 @@ +## Fix return checking in behaviours and constructors + +Our checks to make sure that the usage of return in behaviours and constructors was overly ...
diff --git a/test/libponyc-run/lambda-with-return-in-behaviour/main.pony b/test/libponyc-run/lambda-with-return-in-behaviour/main.pony new file mode 100644 index 0000000000..b6837ac5d6 --- /dev/null +++ b/test/libponyc-run/lambda-with-return-in-behaviour/main.pony @@ -0,0 +1,6 @@ +actor Main + new create(env: Env) => ...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest...
{"lambda-with-return-in-behaviour": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "lambda-with-return-in-constructor": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"passed_count": 1708, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
{"passed_count": 1438, "failed_count": 2, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBoxNeedNotRecovered", "SubTypeTest...
{"passed_count": 1712, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
ponylang__ponyc_3971
ponylang
ponyc
3,962
closed
Change type of Env.root to AmbientAuth
Implements [RFC #65](https://github.com/ponylang/rfcs/blob/main/text/0065-env-root-not-optional.md). Closes #3557. This is going to break a lot of stuff. No changes needed: - [x] appdirs (no PR needed) - [x] reactive_streams (no PR needed) - [x] regex (no PR needed) - [x] crypto (no PR needed) First ...
{"label": "ponylang:main", "ref": "main", "sha": "12466227bb253b600b7a3ee995b56b442d02b6e2"}
[ { "body": "[`Env.root`](https://stdlib.ponylang.org/builtin-Env#let-root-ambientauth-val-none-val) currently has type `(AmbientAuth | None)` to allow for creation of artificial `Env` instances without `AmbientAuth`. Yet, there is no observable usage of this feature. As it is requires extra work to make use of, ...
diff --git a/.release-notes/env-root-not-optional.md b/.release-notes/env-root-not-optional.md new file mode 100644 index 0000000000..6f27e98df2 --- /dev/null +++ b/.release-notes/env-root-not-optional.md @@ -0,0 +1,21 @@ +## Change type of Env.root to AmbientAuth + +Previously, Env.root currently had the type (Ambient...
diff --git a/packages/files/_test.pony b/packages/files/_test.pony index d9b9c2e80d..0c43f97b27 100644 --- a/packages/files/_test.pony +++ b/packages/files/_test.pony @@ -63,7 +63,7 @@ actor Main is TestList primitive _FileHelper fun make_files(h: TestHelper, files: Array[String]): FilePath ? => - let top = Di...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catc...
null
null
null
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catc...
{"passed_count": 1708, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 1708, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
ponylang__ponyc_3962
ponylang
ponyc
3,953
closed
Ban variables whose capability is unsound to alias
This PR introduces checks around variables and other unaliasing points, to reject programs which attempt to create variables whose capabilities are inherently unsound. The checks about comptability of intersections have been moved to this check after investigation of the origin, as it is not needed for soundness, but t...
{"label": "ponylang:main", "ref": "main", "sha": "c63b8a78be17b5bffcafdd15bb6fbd58be736295"}
[ { "body": "This allows modification of val and sending of mutable data to actors.\r\n\r\nExample:\r\n```pony\r\nuse \"debug\"\r\nuse \"files\"\r\nuse \"collections\"\r\n\r\nactor Main\r\n var env: Env\r\n\r\n new create(env': Env) =>\r\n env = env'\r\n\r\n let map: Map[String, Array[String]] trn^ = reco...
diff --git a/.release-notes/3953.md b/.release-notes/3953.md new file mode 100644 index 0000000000..e7f247c48c --- /dev/null +++ b/.release-notes/3953.md @@ -0,0 +1,11 @@ +## Fix soundness bug introduced + +We previously switched our underlying type system model. In the process, a +soundness hole was introduced where u...
diff --git a/test/libponyc/CMakeLists.txt b/test/libponyc/CMakeLists.txt index 89411ff0e6..484f39c204 100644 --- a/test/libponyc/CMakeLists.txt +++ b/test/libponyc/CMakeLists.txt @@ -38,6 +38,7 @@ add_executable(libponyc.tests refer.cc scope.cc signature.cc + stable_type.cc sugar.cc sugar_ex...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "iftype-false": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"StableTypeTest.IncompatibleIsectReturnShouldCompile": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "StableTypeTest.EphemeralIsoEmbedField": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "StableTypeTest.EphemeralIsoVarField": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "StableTypeTest.EphemeralTrnLet": {"run"...
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "try-block-cant-catch-cpp-exception": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "regression-2976": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "iftype-false": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"...
{"passed_count": 1718, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
{"passed_count": 1378, "failed_count": 11, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBoxNeedNotRecovered", "SubTypeTes...
{"passed_count": 1734, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "RecoverTest.CanAccess_LocalAssigned", "ArrayTest.InferFromArrayBo...
ponylang__ponyc_3953
ponylang
ponyc
3,819
closed
Update FilePath constructors to allow a non-partial way to create a FilePath
Closes #3820 As part of [RFC 70](https://github.com/ponylang/rfcs/blob/main/text/0070-filepath-constructor.md), `FilePath` now has two constructors: `create` and `from`. Where previously `create` was a partial constructor and thus could fail if called with a `FilePath` base, now `create` is a complete constructor an...
{"label": "ponylang:main", "ref": "main", "sha": "c83552c339960a7cf71155081a7a58df4e4a7862"}
[ { "body": "It should be without error to construct a `FilePath` when `AmbientAuth` is available as `FilePath` is a pairing between some path string and capabilities on that path. For capabilities, the current constructor uses a union of `(FilePath | AmbientAuth)`. Insufficient capabilities or access allows the ...
diff --git a/.release-notes/split-filepath.md b/.release-notes/split-filepath.md new file mode 100644 index 0000000000..b7549fe0bd --- /dev/null +++ b/.release-notes/split-filepath.md @@ -0,0 +1,65 @@ +## Split `FilePath` construction into two methods + +`FilePath` previously had only one constructor, the default `crea...
diff --git a/packages/files/_test.pony b/packages/files/_test.pony index decf12b1d6..6683ed9011 100644 --- a/packages/files/_test.pony +++ b/packages/files/_test.pony @@ -18,6 +18,9 @@ actor Main is TestList test(_TestSymlink) end test(_TestWalk) + test(_TestFilePathFileAuth) + test(_TestFilePathFrom...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
null
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"passed_count": 1706, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 1437, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "RecoverTest.CanAccess_LocalAssign...
{"passed_count": 1709, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3819
ponylang
ponyc
3,781
closed
Prevent non-opaque structs from being used as behaviour parameters
When an immutable object is sent across actors, the garbage collector traces its associated object graph, using the type descriptor of the root object. Structs don't have a type descriptor, so the GC can't trace them. An option is to track additional information for objects without type descriptors, but this inc...
{"label": "ponylang:main", "ref": "main", "sha": "df7614f0e919e939ad93fc78595b5ebc3bae474f"}
[ { "body": "It's curious that it doesn't seem to occur on playground, but here's the listing:\r\n\r\n```\r\nuse \"debug\"\r\n\r\nactor Main\r\n new create(env: Env) =>\r\n let a: AA = AA\r\n inspecta(consume a)\r\n\r\n be inspecta(a: AA val) =>\r\n Debug.out(\"in inspecta\")\r\n\r\n\r\nstruct iso AA\r...
diff --git a/.release-notes/3765.md b/.release-notes/3765.md new file mode 100644 index 0000000000..e2ff53357c --- /dev/null +++ b/.release-notes/3765.md @@ -0,0 +1,34 @@ +## Prevent non-opaque structs from being used as behaviour parameters + +When a non-opaque object is sent across actors, its type descriptor is used...
diff --git a/test/libponyc/codegen_trace.cc b/test/libponyc/codegen_trace.cc index 2eb7b3e676..72bd9c42d6 100644 --- a/test/libponyc/codegen_trace.cc +++ b/test/libponyc/codegen_trace.cc @@ -522,14 +522,18 @@ TEST_F(CodegenTraceTest, TraceStructField) "struct Bar\n" " let f: Foo = Foo\n" + "class WrapBa...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"VerifyTest.NonRootStructTupleBehaviourParam": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "VerifyTest.NonRootStructBehaviourParam": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"passed_count": 1700, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 1435, "failed_count": 2, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "RecoverTest.CanAccess_LocalAssign...
{"passed_count": 1702, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3781
ponylang
ponyc
3,777
closed
Fix bug where Flags.remove could set flags in addition to unsetting them
Note - I've written a test-suite to cover 90% of this module but it's dependent on a second PR that I'm about to open. Test coverage is in there.
{"label": "ponylang:main", "ref": "main", "sha": "89b03703acfebf6ee6d1b92298f6b671ce14d556"}
[ { "body": "```\r\n t = set0011.clone() //0b0011\r\n t.remove(set0101) //0b0101\r\n h.assert_true(t == _TestFlagsFlags(0b0010))\r\n```\r\n\r\nThe test fails as it's mutating to 0b0110.\r\n\r\nPR incoming.", "number": 3776, "title": "Flags.remove mutating to an incorre...
diff --git a/.release-notes/3777.md b/.release-notes/3777.md new file mode 100644 index 0000000000..91d1e7a8e6 --- /dev/null +++ b/.release-notes/3777.md @@ -0,0 +1,4 @@ +## Fix bug where Flags.remove could set flags in addition to unsetting them + +Flags.remove when given a flag to remove that wasn't currently present...
diff --git a/packages/collections/_test.pony b/packages/collections/_test.pony index 42a914716e..a7d7a8eb07 100644 --- a/packages/collections/_test.pony +++ b/packages/collections/_test.pony @@ -31,6 +31,7 @@ actor Main is TestList test(_TestSort) test(_TestRange) test(_TestHeap) + test(_TestFlags) ...
{"collections/Flags": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "293": {"run": "NONE", "test": "NONE", "fix": "PASS"}}
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.Parti...
{"collections/Flags": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"293": {"run": "NONE", "test": "NONE", "fix": "PASS"}}
{"passed_count": 1699, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 1699, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 1700, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3777
ponylang
ponyc
3,763
closed
Fix "iftype" expressions not being usable in lambdas or object literals
Fixes #3762, but paging @jemc just in case he thinks if this should be fixed somewhere else in the compiler
{"label": "ponylang:main", "ref": "main", "sha": "847c83430e8dfa645ba753a84754004134a9ca60"}
[ { "body": "This code:\r\n\r\n```pony\r\nactor Main\r\n new create(env: Env) => None\r\n\r\n fun test[T: (U8 | I8)](arg: T) =>\r\n let do_it = {(v: T): T =>\r\n iftype T <: U8 then\r\n v\r\n else\r\n v\r\n end\r\n }\r\n do_it(arg)\r\n```\r\n\r\nProduces the following error...
diff --git a/.release-notes/3763.md b/.release-notes/3763.md new file mode 100644 index 0000000000..385a06a7aa --- /dev/null +++ b/.release-notes/3763.md @@ -0,0 +1,3 @@ +## Fix "iftype" expressions not being usable in lambdas or object literals + +This release fixes an issue where the compiler would hit an assertion e...
diff --git a/test/libponyc/iftype.cc b/test/libponyc/iftype.cc index 287b16cd49..c12abfb34e 100644 --- a/test/libponyc/iftype.cc +++ b/test/libponyc/iftype.cc @@ -368,3 +368,24 @@ TEST_F(IftypeTest, ReplaceTypeargs) " new create(env: Env) => None"; TEST_COMPILE(src); } + +TEST_F(IftypeTest, InsideLambda) +{ +...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SubTypeTest.IsSubTypeNosupertypeInterface": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DontcareT...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTes...
null
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SubTypeTest.IsSubTypeNosupertypeInterface": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DontcareT...
{"passed_count": 1698, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 1142, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "VerifyTest.ConsumeVarLocalVarSubfieldReassignTry", "ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "VerifyTest.Cons...
{"passed_count": 1699, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3763
ponylang
ponyc
3,758
closed
Fix NullablePointer type constraint check being omitted in FFI declarations
We're only interested in ignoring the "guard" part of a use command, but we still want to go through the arguments to check for any possible errors during the expr pass. In particular, we're interested in the NullablePointer constraint check. ---- 043dbb1ede410ab6432ef6d16edc73c7cebcaf82 added the original cod...
{"label": "ponylang:main", "ref": "main", "sha": "3bdad0dac9b51a03b50609d37027aea587243e0e"}
[ { "body": "This bug also affected version 0.40.0, but the FFI changes in 0.41.0 have made this more visible. On previous releases, the following code:\r\n\r\n```pony\r\ntype LibT is (U64, U64)\r\n\r\nactor Main\r\n new create(env: Env) =>\r\n var s' = @make_lib_t[NullablePointer[LibT]]()\r\n try var s: ...
diff --git a/.release-notes/3758.md b/.release-notes/3758.md new file mode 100644 index 0000000000..36e46bc716 --- /dev/null +++ b/.release-notes/3758.md @@ -0,0 +1,3 @@ +## Fix type constraint check against NullablePointer being omitted in FFI declarations + +This release fixes an issue where the compiler would not pe...
diff --git a/test/libponyc/ffi.cc b/test/libponyc/ffi.cc index eef4c75ad4..2bb89bcf4b 100644 --- a/test/libponyc/ffi.cc +++ b/test/libponyc/ffi.cc @@ -5,6 +5,11 @@ // FFI type checking tests #define TEST_ERROR(src) DO(test_error(src, "expr")) + +#define TEST_ERRORS_2(src, err1, err2) \ + { const char* errs[] = {er...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"FFITest.DeclarationWithNullablePointer": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"passed_count": 1697, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 1433, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "RecoverTest.CanAccess_LocalAssign...
{"passed_count": 1698, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3758
ponylang
ponyc
3,746
closed
Improve error message for match on structs
Since a struct doesn't have a type descriptor, it's impossible to match against it, unless it's exactly the same struct type. Before, the return type of matchtype.c:is_matchtype didn't convey enough information to the caller about the reason why two types couldn't match. In most cases, this is due to reference capa...
{"label": "ponylang:main", "ref": "main", "sha": "151a2f50d35db7745e8a55d00e91c756b97f3dc0"}
[ { "body": "I assume that pattern matching on a struct is not possible at runtime. However the error message given to the user is very unhelpful.\r\n\r\n```pony\r\nstruct Rect\r\n\r\nactor Main\r\n new create(env: Env) => None\r\n\r\n fun ptr(a: (Rect | None)) =>\r\n match a\r\n | let a': Rect => None\r\...
diff --git a/.release-notes/3746.md b/.release-notes/3746.md new file mode 100644 index 0000000000..d23ca99e1a --- /dev/null +++ b/.release-notes/3746.md @@ -0,0 +1,55 @@ +## Improve error messages when matching on struct types + +A struct type doesn't have a type descriptor, which means that they cannot be used in mat...
diff --git a/test/libponyc/matchtype.cc b/test/libponyc/matchtype.cc index 014e034d01..65b4821e0e 100644 --- a/test/libponyc/matchtype.cc +++ b/test/libponyc/matchtype.cc @@ -58,6 +58,23 @@ TEST_F(MatchTypeTest, SimpleTypes) } +TEST_F(MatchTypeTest, Structs) +{ + const char* src = + "struct S1\n" + + "inter...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.Parti...
null
null
null
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.Parti...
{"passed_count": 1705, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 1706, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3746
ponylang
ponyc
3,739
closed
RFC 68: Mandatory FFI declarations
Changes related to the implementation of [RFC 68](https://github.com/ponylang/rfcs/blob/main/text/0068-force-declaration-of-ffi-functions.md). --- Opening the PR now although it's not ready, to ask for feedback, etc Tasks: - [x] Add FFI declarations for all Pony libraries under the ponylang org - [x] Add F...
{"label": "ponylang:main", "ref": "main", "sha": "19cd02f1dc5852c199148f0aebbfce2f8e8ad81e"}
[ { "body": "This proposal aims to make mandatory the declaration of all C-FFI (Foreign Function Interface) functions through `use` statements, such that the compiler is able to distinguish variadic functions from regular functions. In addition, it also aims to remove from the language the ability to specify the ...
diff --git a/.release-notes/3739.md b/.release-notes/3739.md new file mode 100644 index 0000000000..ea3184a2d2 --- /dev/null +++ b/.release-notes/3739.md @@ -0,0 +1,33 @@ +## Make FFI declarations mandatory (RFC 68) + +This release introduces a breaking change for code that uses the C-FFI (Foreign Function Interface). ...
diff --git a/packages/builtin_test/_test.pony b/packages/builtin_test/_test.pony index d60680d3cf..8d36a59983 100644 --- a/packages/builtin_test/_test.pony +++ b/packages/builtin_test/_test.pony @@ -5,6 +5,14 @@ This package contains the unit tests for the `builtin` package. These are here so `builtin` doesn't have to...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"CodegenTest.StringSerialization": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "CodegenTest.CustomSerialization": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "SignatureTest.SerialiseSignature": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"passed_count": 1697, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 1421, "failed_count": 3, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "RecoverTest.CanAccess_LocalAssign...
{"passed_count": 1686, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3739
ponylang
ponyc
3,725
closed
Fix compiler crash related to type parameter references
This fixes a bug in rescoping. Rescoping happens after a method was copied from a trait/interface to another type. It starts with a fresh scope, visits all of the method's AST nodes and adds the visited symbols to the method's symbol table. This includes type parameters. If a type parameter reference is visited, th...
{"label": "ponylang:main", "ref": "main", "sha": "22df673d577367dffdc8f31ecf67fce963ac777a"}
[ { "body": "Compiling [this](https://playground.ponylang.io/?gist=1968aa68d9a6deb291f708f4f2546c97) causes the compiler to crash. Removing the default implementations from the interface makes the compiler happy again (and removing the defaults for just `varint` and `svarint` works). The stack trace was:\r\n\r\n`...
diff --git a/.release-notes/fix-param-type-reference-crash.md b/.release-notes/fix-param-type-reference-crash.md new file mode 100644 index 0000000000..2a2dcbb62d --- /dev/null +++ b/.release-notes/fix-param-type-reference-crash.md @@ -0,0 +1,5 @@ +## Fix compiler crash related to type parameter references + +Previousl...
diff --git a/test/libponyc/traits.cc b/test/libponyc/traits.cc index 724428c505..c2efe23623 100644 --- a/test/libponyc/traits.cc +++ b/test/libponyc/traits.cc @@ -722,3 +722,15 @@ TEST_F(TraitsTest, TypeargInFunction2) // Tests typearg reification in methods inherited from parameterised traits. DO(test_compile(sr...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SubTypeTest.IsSubTypeNosupertypeInterface": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "VerifyTest.ConsumeEmbedFieldVarSubfieldReassignTrySameEx...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllC...
null
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SubTypeTest.IsSubTypeNosupertypeInterface": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "VerifyTest.ConsumeEmbedFieldVarSubfieldReassignTrySameEx...
{"passed_count": 1695, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 872, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStr...
{"passed_count": 1696, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3725
ponylang
ponyc
3,723
closed
Fix tuple related compiler segfaults
It's possible that the method body returns a subtype of the return type. For example, a return value with type `((U32, U32) | (U32, None))` is legal for a method with return type `(U32, (U32 | None))`, but it requires a cast. 071db1051b01b02a1224867c5bdbae3983634231 changed that methods returning a tuple always u...
{"label": "ponylang:main", "ref": "main", "sha": "dd0583dda3b7e6568ce592033dd63e0b364fecab"}
[ { "body": "The segfault occurs regardless of the --debug flag.\r\nCompiler version: `0.21.3-98ce091 [release]`\r\n * (native windows binary) `llvm 3.9.1 -- msvc-15-x64`\r\n * (windows 10 WSL) ` llvm 3.9.1 -- gcc (Ubuntu/Linaro 6.3.0-18ubuntu2~14.04) 6.3.0 20170519`\r\n### The bugged code:\r\n```pony\r\nactor ...
diff --git a/.release-notes/3723.md b/.release-notes/3723.md new file mode 100644 index 0000000000..00380897f5 --- /dev/null +++ b/.release-notes/3723.md @@ -0,0 +1,3 @@ +## Fix tuple related compiler segfaults + +Andreas Stührk indentified and fixed the source of two different open issues with tuple handling that caus...
diff --git a/test/libponyc/codegen.cc b/test/libponyc/codegen.cc index 6df5dc7049..a4b7b23420 100644 --- a/test/libponyc/codegen.cc +++ b/test/libponyc/codegen.cc @@ -989,3 +989,21 @@ TEST_F(CodegenTest, IfBlockEndingWithDontCareAssign) int exit_code = 0; ASSERT_TRUE(run_program(&exit_code)); } + +TEST_F(Codegen...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
null
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"passed_count": 1694, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 1405, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "RecoverTest.CanAccess_LocalAssign...
{"passed_count": 1695, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3723
ponylang
ponyc
3,675
closed
Fix memory safety problem with Array.from_cpointer
Fixes #3668. String already checked for a potential null pointer before constructing, so it was safe. Also added a test case to check this.
{"label": "ponylang:master", "ref": "master", "sha": "eb6fbbb16600249e1d90cd3e6674ebe75fecc5b0"}
[ { "body": "Array's methods and Array.from_cpointer basically trust the user outright; but we can make a null pointer publicly with Pointer.create, and generally blow up\r\n\r\nhttps://stdlib.ponylang.org/builtin-Pointer/#create\r\nhttps://stdlib.ponylang.org/builtin-Array/#from_cpointer\r\n```\r\nactor Main\r\n...
diff --git a/.release-notes/3675.md b/.release-notes/3675.md new file mode 100644 index 0000000000..100657a487 --- /dev/null +++ b/.release-notes/3675.md @@ -0,0 +1,3 @@ +## Fix memory safety problem with Array.from_cpointer + +Previously, the `from_cpointer` method in arrays would trust the user to pass a valid pointe...
diff --git a/packages/builtin_test/_test.pony b/packages/builtin_test/_test.pony index b1278f3109..f6afe85b40 100644 --- a/packages/builtin_test/_test.pony +++ b/packages/builtin_test/_test.pony @@ -54,6 +54,7 @@ actor Main is TestList test(_TestStringUnchop) test(_TestStringRepeatStr) test(_TestStringCo...
{"builtin/Array.from_cpointer": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "283": {"run": "NONE", "test": "NONE", "fix": "PASS"}}
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.Parti...
{"builtin/Array.from_cpointer": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"283": {"run": "NONE", "test": "NONE", "fix": "PASS"}}
{"passed_count": 1691, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 1692, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 1693, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3675
ponylang
ponyc
3,650
closed
Prevent compiler crashes on certain `consume` expressions
* `consume (consume variable).field` must result in similar compilation error as `consume (consume variable)`. * `consume f().field` must result in similar compilation error as `consume f()` * `(consume c).field` must not result in a crash. Fixes #3463, #3567 (and #3453)
{"label": "ponylang:master", "ref": "master", "sha": "9668981264707da16f62625b15488d8b39e6e499"}
[ { "body": "I was experimenting with how Pony handles paths on the LHS of an assignment which have side-effects, and I managed to trip over this compiler bug.\r\n\r\n## System\r\n\r\n```\r\nLinux 5.4.2-gnu-1 #1 SMP PREEMPT Fri, 06 Dec 2019 00:53:00 +0000 unknown GNU/Linux\r\n```\r\nThe distribution is Parabola, ...
diff --git a/.release-notes/3650.md b/.release-notes/3650.md new file mode 100644 index 0000000000..6f6922dfd2 --- /dev/null +++ b/.release-notes/3650.md @@ -0,0 +1,5 @@ +## Handling compiler crashes in some `consume` expressions + +Previously an expression of the form `consume (consume variable).field` resulted in th...
diff --git a/test/libponyc/refer.cc b/test/libponyc/refer.cc index 8c4267ba87..2ebe2b0e41 100644 --- a/test/libponyc/refer.cc +++ b/test/libponyc/refer.cc @@ -841,12 +841,62 @@ TEST_F(ReferTest, ConsumeParamVarSubfieldReassignSameExpressionReuse) TEST_F(ReferTest, ConsumeTupleAccessorOfFunctionValResult) { - con...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.Parti...
{"LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CapTest.Sub": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "BareTest.BareMethod_PartialApplicationTypeArguments": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.StringEscapedSlashAtEnd": {"run": "PASS", "test": "PASS", "fix": "PASS"}, ...
null
null
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.Parti...
{"passed_count": 1686, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 490, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "LexerTest.EmptyStringAtEndOfSource", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "LexerTest.IntHex", "BareTest.BareLambda_TypeTypeP...
{"passed_count": 1689, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3650
ponylang
ponyc
3,647
closed
Consistent handling of function calls in consume expressions
Function calls in `consume` are deemed invalid by the syntax checker. However, they seep in via field accessors on the function call expressions. This change fixes #3453.
{"label": "ponylang:master", "ref": "master", "sha": "9d976fea89155a27732f04088556834811eeed72"}
[ { "body": "The [following code](https://playground.ponylang.io/?gist=d687e4cb60cef47817ac11f38370a348) triggers an assertion fail:\r\n\r\n```pony\r\nactor Main\r\n new create(env: Env) =>\r\n let a = \"I am a string\"\r\n // commenting both lines or swapping the consume for a valid recover X ... end fixe...
diff --git a/.release-notes/3467.md b/.release-notes/3467.md new file mode 100644 index 0000000000..0408998ef5 --- /dev/null +++ b/.release-notes/3467.md @@ -0,0 +1,20 @@ +## Fix function calls in consume expressions + +Function calls are not allowed in `consume` expressions. However, if the expression being `consume`d...
diff --git a/test/libponyc/refer.cc b/test/libponyc/refer.cc index c926954aa7..8c4267ba87 100644 --- a/test/libponyc/refer.cc +++ b/test/libponyc/refer.cc @@ -838,3 +838,15 @@ TEST_F(ReferTest, ConsumeParamVarSubfieldReassignSameExpressionReuse) TEST_ERRORS_1(src, "can't use a consumed local or field in an expr...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NON...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CapTest.Sub":...
null
null
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NON...
{"passed_count": 1685, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
{"passed_count": 399, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseExprTest.ExpressionNotAllowedBeforeCompileError", "SugarExprTest.PartialMemberAccessFail", "FFITest.NoDeclarationNoReturn", "FFITest.DeclarationEllipsisNotLast", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "BareTest....
{"passed_count": 1686, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "R...
ponylang__ponyc_3647
ponylang
ponyc
3,603
closed
Implement RFC 66: Iter maybe
Closes #3593
{"label": "ponylang:master", "ref": "master", "sha": "0d5185441afd4fed1017430e7af89128969ebdc2"}
[ { "body": "This RFC suggests adding functionality inspired by the [maybe](https://github.com/mfelsche/pony-maybe) library to the Pony stdlib via the itertools package. This provides an alternative API to work with optional types, that is union types with `None`: `( T | None)`. Its goal is to facilitate the usag...
diff --git a/packages/itertools/iter.pony b/packages/itertools/iter.pony index c0e8d47859..a7749c0d41 100644 --- a/packages/itertools/iter.pony +++ b/packages/itertools/iter.pony @@ -15,6 +15,16 @@ class Iter[A] is Iterator[A] fun ref next(): A ? => _iter.next()? + new maybe(value: (A | None)) => + _iter ...
diff --git a/packages/itertools/_test.pony b/packages/itertools/_test.pony index 2776161b8a..42bc1acdb1 100644 --- a/packages/itertools/_test.pony +++ b/packages/itertools/_test.pony @@ -22,6 +22,7 @@ actor Main is TestList test(_TestIterFold) test(_TestIterLast) test(_TestIterMap) + test(_TestIterNex...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
null
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"passed_count": 1674, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "A...
{"passed_count": 1415, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "ArrayTest.InferFromArrayBoxNeedNo...
{"passed_count": 1675, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "A...
ponylang__ponyc_3603
ponylang
ponyc
3,586
closed
Fix with expressions using tuple destructuring.
A with expression like the following caused the compiler to abort: ```pony with (a, b) = some_tuple do error end ``` This PR fixes those cases and adds some test coverage for desugaring with expressions in general. Fixes #3581
{"label": "ponylang:master", "ref": "master", "sha": "a84d28a29ffd6a6c1a660d3fe1d0eb845d095d7b"}
[ { "body": "The following code causes the compiler to abort:\r\n```\r\nactor Main\r\n new create(env: Env) =>\r\n with (a,b) = (1,2) do\r\n None\r\n end\r\n\r\n```\r\nI think it's the (a,b) on the LHS. The output:\r\n```\r\n$ ~/src/ponyc/build/debug/ponyc \r\nBuilding builtin -> /Users/anacrolix/src/...
diff --git a/src/libponyc/pass/sugar.c b/src/libponyc/pass/sugar.c index 6633c8cd20..8e0346ee34 100644 --- a/src/libponyc/pass/sugar.c +++ b/src/libponyc/pass/sugar.c @@ -542,7 +542,11 @@ static void build_with_dispose(ast_t* dispose_clause, ast_t* idseq) pony_assert(ast_id(idseq) == TK_TUPLE); for(ast_t* p = a...
diff --git a/test/libponyc/sugar.cc b/test/libponyc/sugar.cc index e60432391d..f5e553bad5 100644 --- a/test/libponyc/sugar.cc +++ b/test/libponyc/sugar.cc @@ -1933,3 +1933,141 @@ TEST_F(SugarTest, AsOperatorWithLambdaType) TEST_COMPILE(short_form); } + +TEST_F(SugarTest, WithExpr) +{ + const char* short_form = +...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.Parti...
{"ReferTest.ConsumeVarTry": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ListTest.InitializeList": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ReferTest.ConsumeLetLocalVarSubfieldReassignSameExpressionReuse": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS"...
null
null
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.Parti...
{"passed_count": 1667, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "A...
{"passed_count": 87, "failed_count": 0, "skipped_count": 0, "passed_tests": ["Pool.LargeAlloc", "ReferTest.ConsumeVarFieldReassign", "SugarTest.ForWithElse", "SugarTest.ActorWithInitializedFieldAndManyConstructors", "ReferTest.ConsumeEmbedFieldVarSubfieldReassignSameExpressionReuse", "ErrorTest.PonyTry", "Pagemap.SetAn...
{"passed_count": 1670, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "A...
ponylang__ponyc_3586
ponylang
ponyc
3,442
closed
fix cli issue when providing --help=false.
Fixes #3439
{"label": "ponylang:master", "ref": "master", "sha": "764110c805d8020f5202c60ffed2b2570caf792a"}
[ { "body": "I noticed this with ponyup. @cquinn says it is a command parser bug.\r\n\r\n-h and --help are boolean. and the default is `false` so\r\n\r\n--help=false shouldn't display the help.\r\n\r\nhowever, it always does. It is ignoring the `=false`.\r\n\r\n", "number": 3439, "title": "`--help` handl...
diff --git a/packages/cli/command_parser.pony b/packages/cli/command_parser.pony index 1e66255c97..fff33ccdfb 100644 --- a/packages/cli/command_parser.pony +++ b/packages/cli/command_parser.pony @@ -120,13 +120,16 @@ class CommandParser end // If it's a help option, return a general or specific CommandHelp....
diff --git a/packages/cli/_test.pony b/packages/cli/_test.pony index 81ece53608..c4ca02f7ca 100644 --- a/packages/cli/_test.pony +++ b/packages/cli/_test.pony @@ -26,6 +26,7 @@ actor Main is TestList test(_TestChat) test(_TestMustBeLeaf) test(_TestHelp) + test(_TestHelpFalse) test(_TestHelpMultip...
{"ponycli/help-false": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "271": {"run": "NONE", "test": "NONE", "fix": "PASS"}}
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "builtin/String.trim_in_place": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.Parti...
{"ponycli/help-false": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"271": {"run": "NONE", "test": "NONE", "fix": "PASS"}}
{"passed_count": 1654, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "A...
{"passed_count": 1654, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "A...
{"passed_count": 1655, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "A...
ponylang__ponyc_3442
ponylang
ponyc
3,293
closed
Rename MaybePointer to NullablePointer
Resolves #3273 as of [RFC 63](https://github.com/ponylang/rfcs/blob/master/text/0063-rename-maybe-pointer.md) According to my research all the changes in files relates to MaybePointer and only MaybePointer. Excerps from the old code follows as a proof of thought: codegen.h ``` typedef struct compile_t { ...
{"label": "ponylang:master", "ref": "master", "sha": "bcfc15fdc61ddd5925a7e3ddc28f3fc1fc3679d4"}
[ { "body": "[RFC 63](https://github.com/ponylang/rfcs/blob/master/text/0063-rename-maybe-pointer.md)", "number": 3273, "title": "RFC 63: Rename MaybePointer to NullablePointer" } ]
diff --git a/CHANGELOG.md b/CHANGELOG.md index d8038c4753..1b1eb20887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to the Pony compiler and standard library will be documented ### Changed +- Rename MaybePointer to NullablePointer ([PR #3293](https://github.com/ponylang/ponyc/p...
diff --git a/packages/builtin_test/_test.pony b/packages/builtin_test/_test.pony index 475e1887f8..b1278f3109 100644 --- a/packages/builtin_test/_test.pony +++ b/packages/builtin_test/_test.pony @@ -83,7 +83,7 @@ actor Main is TestList test(_TestUnsignedPartialArithmetic) test(_TestNextPow2) test(_TestNu...
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"BadPonyTest.DisallowPointerAndMaybePointerInEmbeddedType": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"builtin/String.trim_in_place": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "JSON/parse.array": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "files/Path.root": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ponycli/help": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "logger/info": {"run": "PASS", "test": "...
{"passed_count": 1443, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "A...
{"passed_count": 1151, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 1443, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "builtin/String.trim_in_place", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple", "A...
ponylang__ponyc_3293
ponylang
ponyc
3,006
closed
Reject Pointer and MaybePointer from being embedded
Hi there folks 👋 After reading this tweet https://twitter.com/ponylang/status/1095373775288393729 I took the liberty to take over this PR: #2648. > This should indeed result in a compiler error. In `pass_flatten` in `pass/flatten.c`, instead of accepting all embedded structs, we should check whether the struct ...
{"label": "ponylang:master", "ref": "master", "sha": "3aa1a4167d23f435897bf006c1a6baf9c9b54609"}
[ { "body": "While it's reasonable to disallow types like Pointer and MaybePointer from being embedded in something, it currently causes a failed assertion rather than an error in the compiler. It might be worth making this sort of limitation clearer with an error message for those who might be exploring the lang...
diff --git a/src/libponyc/pass/flatten.c b/src/libponyc/pass/flatten.c index c6c6114d53..a0cfdc5b6d 100644 --- a/src/libponyc/pass/flatten.c +++ b/src/libponyc/pass/flatten.c @@ -308,7 +308,7 @@ ast_result_t pass_flatten(ast_t** astp, pass_opt_t* options) AST_GET_CHILDREN(ast, id, type, init); bool ok = t...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index 212d171745..2f4164f3e0 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -1031,3 +1031,23 @@ TEST_F(BadPonyTest, ThisViewpointWithIsoReceiver) TEST_ERRORS_1(src, "argument not a subtype of parameter"); } + +TEST_F(BadPony...
{"SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.ClassWithoutFieldOrCreate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.LambdaTypeParamsAndReturn": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PA...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
null
null
{"SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.ClassWithoutFieldOrCreate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.LambdaTypeParamsAndReturn": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PA...
{"passed_count": 1143, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 926, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource...
{"passed_count": 1144, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
ponylang__ponyc_3006
ponylang
ponyc
2,950
closed
[RFC 60] Add binary heaps
This PR adds binary heaps to the standard collections package. This includes both minimum and maximum priority heaps through the `MinHeap` and `MaxHeap` classes. closes #2948
{"label": "ponylang:master", "ref": "master", "sha": "5fc1b04ca78b050cdf6d5f7a630d878a705a5710"}
[ { "body": "Add Priority queues to the collections package of the standard library.\r\n\r\n[RFC 60](https://github.com/ponylang/rfcs/blob/master/text/0060-binary-heaps.md)", "number": 2948, "title": "RFC 60: Binary Heaps" } ]
diff --git a/packages/collections/heap.pony b/packages/collections/heap.pony new file mode 100644 index 0000000000..a7cfcdd83f --- /dev/null +++ b/packages/collections/heap.pony @@ -0,0 +1,145 @@ + +type MinHeap[A: Comparable[A] #read] is BinaryHeap[A, MinHeapPriority[A]] +type MaxHeap[A: Comparable[A] #read] is Binary...
diff --git a/packages/collections/_test.pony b/packages/collections/_test.pony index 6150605981..0c6c054b84 100644 --- a/packages/collections/_test.pony +++ b/packages/collections/_test.pony @@ -1,4 +1,6 @@ use "ponytest" +use "random" +use "time" actor Main is TestList new create(env: Env) => PonyTest(env, this...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"CodegenTest.StringSerialization": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "CodegenTest.CustomSerialization": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "SignatureTest.SerialiseSignature": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1139, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 1094, "failed_count": 3, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 1139, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
ponylang__ponyc_2950
ponylang
ponyc
2,865
closed
[RFC 58] Add partial arithmetic for integer types
This PR adds partial arithmetic functions and operators to all integer types. Normal classes can also provide partial arithmetic operators, like `+?`, `-?`, `*?`, etc. by implementing `add_partial`, `sub_partial`, `mul_partial` etc. the same way the normal operators work on classes. I limited this PR to `+?`, `-?...
{"label": "ponylang:master", "ref": "master", "sha": "8823316c0666ae776a4aa523ad094e2d8ee10b90"}
[ { "body": "This RFC suggests adding partial versions of basic Integer arithmetic operators (`+`, `-`, `*`, `/`, ...)\r\nthat error on overflow or underflow or division by zero. These new operator should combine the base-operators with a `?`:\r\n`+?`, `-?`, `*?`, `/?`, ...\r\n\r\n[RFC 58](https://github.com/pony...
diff --git a/packages/builtin/_partial_arithmetic.pony b/packages/builtin/_partial_arithmetic.pony new file mode 100644 index 0000000000..0b3ba3809f --- /dev/null +++ b/packages/builtin/_partial_arithmetic.pony @@ -0,0 +1,65 @@ + +trait _PartialArithmetic + fun add_partial[T: (Integer[T] val & Int)](x: T, y: T): T? =>...
diff --git a/packages/builtin_test/_test.pony b/packages/builtin_test/_test.pony index d62c2b6eb1..bbb8fcf3b1 100644 --- a/packages/builtin_test/_test.pony +++ b/packages/builtin_test/_test.pony @@ -70,6 +70,8 @@ actor Main is TestList test(_TestAddc) test(_TestSubc) test(_TestMulc) + test(_TestSigned...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"VerifyTest.PartialSugaredBinaryOperatorCall": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1133, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 1091, "failed_count": 1, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 1134, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
ponylang__ponyc_2865
ponylang
ponyc
2,853
closed
Fix skipped try-then clauses on return, break and continue statements
`then` clauses could be skipped if the containing `try` expression was within a loop and the body or else clause contained a `continue` or `break` statements. Also if the `try` was somehow nested into another `try` and the body or else clause contained a `return` the `then` clause was skipped. This has been solved b...
{"label": "ponylang:master", "ref": "master", "sha": "419d8bd72e02f96c3a7c1c8ac0ae5294e7f59e94"}
[ { "body": "Minimal example:\r\n\r\n```pony\r\nactor Main\r\n new create(e: Env) =>\r\n try\r\n try\r\n if I32(1) > I32(2) then error end\r\n e.out.print(\"try\")\r\n return\r\n end\r\n if I32(1) > I32(2) then error end\r\n else\r\n e.out.print(\"else\")\r\n the...
diff --git a/src/libponyc/ast/ast.c b/src/libponyc/ast/ast.c index 94a99f2ee1..2dd43f8a8f 100644 --- a/src/libponyc/ast/ast.c +++ b/src/libponyc/ast/ast.c @@ -957,6 +957,12 @@ ast_t* ast_try_clause(ast_t* ast, size_t* clause) *clause = ast_index(last); return ast; } + case TK_NEW: + c...
diff --git a/test/libponyc/codegen.cc b/test/libponyc/codegen.cc index 13a50c1520..4de246ed5b 100644 --- a/test/libponyc/codegen.cc +++ b/test/libponyc/codegen.cc @@ -810,3 +810,140 @@ TEST_F(CodegenTest, CycleDetector) ASSERT_TRUE(run_program(&exit_code)); ASSERT_EQ(exit_code, 0); } + +TEST_F(CodegenTest, TryTh...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"CodegenTest.TryThenClauseBreakNested": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "CodegenTest.TryThenClauseReturnNested": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "CodegenTest.TryThenClauseContinue": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "CodegenTest.TryThenClauseContinueNested": {"run": "NONE"...
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1120, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 1079, "failed_count": 5, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 1126, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
ponylang__ponyc_2853
ponylang
ponyc
2,664
closed
Fix code generation crash with variable declarations in nested tuples
Closes #2662.
{"label": "ponylang:master", "ref": "master", "sha": "02f6db76b30bc839e1a2c2d7a329127f15972039"}
[ { "body": "The following Pony snippet crashes the compiler with an unexpected `GEN_NOTNEEDED` value during code generation for a `for` loop with nested tuples in its captures:\r\n\r\n```pony\r\nactor Main\r\n new create(env: Env) =>\r\n let array = Array[((U8, U8), U8)]\r\n for ((a, b), c) in array.value...
diff --git a/src/libponyc/codegen/genreference.c b/src/libponyc/codegen/genreference.c index 36bbbfde08..4df715ce2d 100644 --- a/src/libponyc/codegen/genreference.c +++ b/src/libponyc/codegen/genreference.c @@ -213,7 +213,7 @@ LLVMValueRef gen_tuple(compile_t* c, ast_t* ast) if(value == GEN_NOVALUE) { ...
diff --git a/test/libponyc/codegen.cc b/test/libponyc/codegen.cc index b667e751af..98413b2c7d 100644 --- a/test/libponyc/codegen.cc +++ b/test/libponyc/codegen.cc @@ -599,3 +599,17 @@ TEST_F(CodegenTest, RecoverCast) TEST_COMPILE(src); } + +TEST_F(CodegenTest, VariableDeclNestedTuple) +{ + // From issue #2662 + ...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DontcareTest.CannotUseDontcareAsArgumentInCaseExpression": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.ClassWithoutFieldOrC...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDo...
null
null
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DontcareTest.CannotUseDontcareAsArgumentInCaseExpression": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.ClassWithoutFieldOrC...
{"passed_count": 1098, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 517, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "L...
{"passed_count": 1099, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
ponylang__ponyc_2664
ponylang
ponyc
2,660
closed
Fix unsafe cases in capability subtyping implementation
This fixes a bug in the capability subtyping implementation where capabilities were being treated as subtypes of themselves, and adds exhaustive tests for capability subtyping. Closes #2601.
{"label": "ponylang:master", "ref": "master", "sha": "02f6db76b30bc839e1a2c2d7a329127f15972039"}
[ { "body": "The rule for capability subtyping is supposed to be \"every possible instantiation of the subcap is a subtype of every possible instantiation of the supercap\", according to the documentation of `is_cap_sub_cap`.\r\n\r\nHowever, the function implementation assumes that every capability is a subtype o...
diff --git a/packages/collections/map.pony b/packages/collections/map.pony index 499a7d6053..c37d2989d0 100644 --- a/packages/collections/map.pony +++ b/packages/collections/map.pony @@ -63,12 +63,7 @@ class HashMap[K, V, H: HashFunction[K] val] try (let i, let found) = _search(key) - let k = if foun...
diff --git a/test/libponyc/cap.cc b/test/libponyc/cap.cc new file mode 100644 index 0000000000..fa8fb9dc5d --- /dev/null +++ b/test/libponyc/cap.cc @@ -0,0 +1,660 @@ +#include <gtest/gtest.h> +#include <platform.h> + +#include <type/cap.h> + +class CapTest : public testing::Test +{ +protected: + static const token_id ...
{"CapTest.Sub": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAnd...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"CapTest.Sub": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "CapTest.Compat": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1098, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 1058, "failed_count": 2, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
{"passed_count": 1102, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "AnnotationsTest.StandardAnnotationLocationGood", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSourc...
ponylang__ponyc_2660
ponylang
ponyc
2,586
closed
Fix extracting docstring from constructors
from classes or actors with initialized fields by executing `sugar_docstring` on the constructors before adding the initializers. This will actually execute `sugar_docstring` twice on such constructors, but as it is idempotent, there is no danger here. The docstrings have been inlined into the constructor body be...
{"label": "ponylang:master", "ref": "master", "sha": "3ed6c09a5f410351cb0eb9eb545eae9114cbb065"}
[ { "body": "This leads to unnecessary expressions in the generated code and to swallowing informative docstrings e.g. for [FilePath](https://stdlib.ponylang.org/files-FilePath/#constructors).\r\n\r\nMinimal example:\r\n\r\n```pony\r\nactor Main\r\n let x: U8 = 1\r\n new create(env: Env) =>\r\n \"\"\"i wanna...
diff --git a/src/libponyc/pass/sugar.c b/src/libponyc/pass/sugar.c index 26c0b15658..11151f98cf 100644 --- a/src/libponyc/pass/sugar.c +++ b/src/libponyc/pass/sugar.c @@ -151,6 +151,30 @@ static ast_result_t sugar_module(pass_opt_t* opt, ast_t* ast) } +static void sugar_docstring(ast_t* ast) +{ + pony_assert(ast ...
diff --git a/test/libponyc/sugar.cc b/test/libponyc/sugar.cc index 726ffe6930..e220a011c3 100644 --- a/test/libponyc/sugar.cc +++ b/test/libponyc/sugar.cc @@ -121,21 +121,182 @@ TEST_F(SugarTest, ClassWithoutDefCap) } -TEST_F(SugarTest, ActorWithInitialisedField) +TEST_F(SugarTest, ClassWithInitializedField) { - ...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest....
{"SugarTest.ActorWithInitializedFieldsAndDocString": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "SugarTest.ClassWithInitializedFieldsAndDocString": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1087, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "Lexe...
{"passed_count": 1048, "failed_count": 2, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "Lexe...
{"passed_count": 1092, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "Lexe...
ponylang__ponyc_2586
ponylang
ponyc
2,532
closed
Allow tuples to match empty interfaces
Closes #2028.
{"label": "ponylang:master", "ref": "master", "sha": "d34dce667accf0797f0afcc5e04fd0605d1ad82e"}
[ { "body": "Initially reported on the mailing list by @sgebbie.\r\n\r\n```pony\r\nactor Main\r\n new create(env: Env) =>\r\n let x: (Any val | (None, None)) = None\r\n match x\r\n | (let n1: None, let n2: None) => None\r\n end\r\n```\r\n\r\nThis code used to compile under the 0.14 version but doesn'...
diff --git a/src/libponyc/codegen/genmatch.c b/src/libponyc/codegen/genmatch.c index 8938e4f71a..c20c55bbc0 100644 --- a/src/libponyc/codegen/genmatch.c +++ b/src/libponyc/codegen/genmatch.c @@ -595,7 +595,10 @@ static bool static_tuple(compile_t* c, LLVMValueRef value, ast_t* type, { case TK_UNIONTYPE: ca...
diff --git a/test/libponyc/matchtype.cc b/test/libponyc/matchtype.cc index 9505823d26..3955b886de 100644 --- a/test/libponyc/matchtype.cc +++ b/test/libponyc/matchtype.cc @@ -305,6 +305,11 @@ TEST_F(MatchTypeTest, BothCompound) TEST_F(MatchTypeTest, Tuples) { const char* src = + "interface I1\n" + + "interfa...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "MatchTypeTest.Tuples": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "HashMapTest....
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"MatchTypeTest.Tuples": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1115, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1072, "failed_count": 1, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1115, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2532
ponylang
ponyc
2,504
closed
Properly report default argument inference errors
Errors for default arguments could leave the AST in an illegal state, which was causing assertions when evaluating default args during TK_CALL evaluation in the expr pass. This PR makes those errors stop compilation immediately, so they are properly reported. This fixes #2496 I did not handle `TK_LITERAL` in...
{"label": "ponylang:master", "ref": "master", "sha": "8b6bb05e2840edc16a14a52509842730109b0d6f"}
[ { "body": "Pony code:\r\n\r\n```\r\nclass Foo[A: Unsigned]\r\n var _field: A\r\n new create(field: A = 0) =>\r\n _field = field\r\n\r\nactor Main\r\n new create(env: Env) =>\r\n let x = Foo[U16]()\r\n```\r\n\r\nHere is what ponyc says on my machine (Max OSX 10.10.15, using MacPorts):\r\n\r\n```\r\n$ po...
diff --git a/src/libponyc/expr/call.c b/src/libponyc/expr/call.c index 376a3e8bd1..c90c48f834 100644 --- a/src/libponyc/expr/call.c +++ b/src/libponyc/expr/call.c @@ -186,7 +186,7 @@ static bool apply_default_arg(pass_opt_t* opt, ast_t* param, ast_t** argp) ast_replace(argp, def_arg); } - if(!expr_seq(opt, *...
diff --git a/test/libponyc/literal_inference.cc b/test/libponyc/literal_inference.cc index f285882dab..413040eb6c 100644 --- a/test/libponyc/literal_inference.cc +++ b/test/libponyc/literal_inference.cc @@ -6,6 +6,9 @@ #define TEST_ERROR(src) DO(test_error(src, "expr")) #define TEST_COMPILE(src) DO(test_compile(src, ...
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "NONE", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest....
{"VerifyTest.TryError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LiteralTest.CantInfer_Let_NoType": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "VerifyTest.PrimitiveNewInit": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "VerifyTest.PrimitiveInitWithParams": {"run": "PASS", "test": "PASS", "fix": "PASS"},...
null
null
{"LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric": {"run": "NONE", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest....
{"passed_count": 1111, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 73, "failed_count": 0, "skipped_count": 0, "passed_tests": ["VerifyTest.TraitNonPartialFunctionError", "VerifyTest.TraitPartialFunctionNoError", "VerifyTest.PartialFunctionError", "VerifyTest.NonPartialSugaredBinaryOperatorCall", "VerifyTest.PartialSugaredBinaryOperatorCall", "LiteralTest.CantInfer_Op_...
{"passed_count": 1112, "failed_count": 0, "skipped_count": 0, "passed_tests": ["LiteralTest.CantInfer_DefaultArg_InsufficientlySpecifiedGeneric", "ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "Lexe...
ponylang__ponyc_2504
ponylang
ponyc
2,342
closed
Fix incorrect detection of exhaustive matches for structural equality comparisons on some primitives.
for primitives that have custom 'eq' methods or implement Equatable[T] where T is a subtype of the primitive. The type was inferred by looking at the type of the full case AST which was inferred from the first argument of the eq method. Now the exhaustive match logic is considering the actual type of the case expr...
{"label": "ponylang:master", "ref": "master", "sha": "df892a1903bcd053198290170aff3e05e348031a"}
[ { "body": "The change e256eed26f3dc9b16c477fd19e92f557a63ca226 has likely introduced a bug in the handling of match expressions that reference (at least primitive) instances.\r\n\r\nMore specifically there seems to be an edge case with exhaustive matches and \"instance\" (versus type) case expressions that is n...
diff --git a/src/libponyc/expr/match.c b/src/libponyc/expr/match.c index 9af82bb39b..ee3ea6256b 100644 --- a/src/libponyc/expr/match.c +++ b/src/libponyc/expr/match.c @@ -111,7 +111,7 @@ static ast_t* is_match_exhaustive(pass_opt_t* opt, ast_t* expr_type, for(ast_t* c = ast_child(cases); c != NULL; c = ast_sibling(c...
diff --git a/test/libponyc/sugar_expr.cc b/test/libponyc/sugar_expr.cc index c8e3cd28c6..836e14d75c 100644 --- a/test/libponyc/sugar_expr.cc +++ b/test/libponyc/sugar_expr.cc @@ -972,6 +972,49 @@ TEST_F(SugarExprTest, MatchExhaustiveUnreachableCases) TEST_ERRORS_1(src, "match contains unreachable cases"); } +TEST...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"SugarExprTest.MatchNonExhaustiveSubsetOfEquatableOfSubType": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "SugarExprTest.MatchExhaustiveEquatableOfSubType": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1104, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1064, "failed_count": 2, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1106, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2342
ponylang
ponyc
2,272
closed
Implement RFC 47 (Serialise signature)
This change implements deterministic package and program signatures based on the contents and dependencies of the packages. Signatures are computed by hashing the serialised package ASTs with the BLAKE2 hash function. This hash function was chosen for its good speed and low collision rate. The signature computation ...
{"label": "ponylang:master", "ref": "master", "sha": "9a12f91bec2d57a23a576d30ad879843657ca020"}
[ { "body": "A `Serialise.signature` method, which returns a unique byte array for the current compiled Pony program.\r\nhttps://github.com/ponylang/rfcs/blob/master/text/0047-serialise-signature.md", "number": 2147, "title": "RFC: serialise-signature" } ]
diff --git a/Makefile b/Makefile index b44106721c..20e44c799d 100644 --- a/Makefile +++ b/Makefile @@ -349,13 +349,16 @@ libgtest.files := $(libgtest.dir)/gtest-all.cc libgbenchmark := $(lib) libgbenchmark.dir := lib/gbenchmark libgbenchmark.files := $(libgbenchmark.dir)/gbenchmark_main.cc $(libgbenchmark.dir)/gbenc...
diff --git a/test/libponyc/compiler_serialisation.cc b/test/libponyc/compiler_serialisation.cc index 172658cc46..3e4044523a 100644 --- a/test/libponyc/compiler_serialisation.cc +++ b/test/libponyc/compiler_serialisation.cc @@ -45,14 +45,6 @@ static void s_throw_fn() throw std::exception{}; } -typedef struct ponyi...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
null
null
null
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"passed_count": 1092, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 1096, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2272
ponylang
ponyc
2,261
closed
Don't verify partial calls for method bodies inherited from a trait.
Resolves #2228.
{"label": "ponylang:master", "ref": "master", "sha": "682b45d3abd7b24381bfc56423da85c3527785c7"}
[ { "body": "The following code won't compile:\r\n```\r\nactor Main\r\n new create(env: Env) =>\r\n let b = B\r\n\r\ntrait A\r\n fun a1() ?\r\n\r\n fun a2() ? =>\r\n a1()?\r\n\r\nclass B is A\r\n fun a1() =>\r\n None\r\n```\r\n\r\nThe problem is `a1()?`. Whether you leave the `?` or remove it, you g...
diff --git a/src/libponyc/verify/call.c b/src/libponyc/verify/call.c index 0f17568a99..8936de3611 100644 --- a/src/libponyc/verify/call.c +++ b/src/libponyc/verify/call.c @@ -33,12 +33,20 @@ static bool check_partial_function_call(pass_opt_t* opt, ast_t* ast) pony_assert(ast_id(method_def) == TK_FUN || ast_id(method...
diff --git a/test/libponyc/verify.cc b/test/libponyc/verify.cc index 933a9943bb..ea835e4a10 100644 --- a/test/libponyc/verify.cc +++ b/test/libponyc/verify.cc @@ -639,6 +639,25 @@ TEST_F(VerifyTest, PartialSugaredBinaryOperatorCall) TEST_COMPILE(src); } +TEST_F(VerifyTest, PartialTraitCall) +{ + // From issue #2...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"VerifyTest.PartialTraitCall": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1089, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1049, "failed_count": 1, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1090, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2261
ponylang
ponyc
2,247
closed
Fix empty string serialisation
This commit fixes a bug in how empty strings are serialised. Resolves #2245. ---------- This PR is based on @Praetonus's PR #2246 and includes the codegen test he added. It is an implementation of the diff I suggested in my comment on that PR.
{"label": "ponylang:master", "ref": "master", "sha": "9e26f0ac4b65462fda4cadbb80cc2fa53e3042b3"}
[ { "body": "The following segfaults when attempting to serialize a class with a single String field.\r\n\r\n```\r\nuse \"serialise\"\r\n\r\nactor Main\r\n new create(env: Env) =>\r\n try\r\n let auth = env.root as AmbientAuth\r\n let psd: V = V\r\n Serialised(SerialiseAuth(auth), psd)?\r\n ...
diff --git a/src/libponyc/codegen/genprim.c b/src/libponyc/codegen/genprim.c index d1fbe5423b..d1fa836736 100644 --- a/src/libponyc/codegen/genprim.c +++ b/src/libponyc/codegen/genprim.c @@ -1044,15 +1044,6 @@ void genprim_string_serialise_trace(compile_t* c, reach_type_t* t) LLVMValueRef size = field_value(c, obj...
diff --git a/test/libponyc/codegen.cc b/test/libponyc/codegen.cc index dc2631f316..9c2af79c31 100644 --- a/test/libponyc/codegen.cc +++ b/test/libponyc/codegen.cc @@ -316,6 +316,34 @@ TEST_F(CodegenTest, ViewpointAdaptedFieldReach) } +TEST_F(CodegenTest, StringSerialization) +{ + // From issue 2245 + const char*...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DontcareTest.CannotUseDontcareAsArgumentInCaseExpression": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.ClassWithoutFieldOrC...
{"SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ArrayTest.InferFromArrayBoxNeedNotRecovered": {"r...
null
null
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DontcareTest.CannotUseDontcareAsArgumentInCaseExpression": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.ClassWithoutFieldOrC...
{"passed_count": 1083, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 492, "failed_count": 0, "skipped_count": 0, "passed_tests": ["IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDont...
{"passed_count": 1084, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2247
ponylang
ponyc
2,221
closed
Fix inconsistencies in multi-line triple-quoted strings
* strip trailing whitespaces from the last line (but keep the linebreak) if the last line contains only of whitespaces * require multi-line triple-quoted strings to start on the line below the opening triple-quote (while tolerating whitespace characters on the same line) This fixes #2178
{"label": "ponylang:master", "ref": "master", "sha": "a58a532ecf9761eb8d91bbad3837ee62da4434b4"}
[ { "body": "# tl;dr\r\n\r\ntriple quoted strings get their indentation removed based on the indent of their first line.\r\nWhile this is totally fine for docstring handling, it is not for string literals in general.\r\nString literals should be treated in a uniform way which is independent of their content (imho...
diff --git a/src/libponyc/ast/lexer.c b/src/libponyc/ast/lexer.c index e5d84e62cb..75b498d224 100644 --- a/src/libponyc/ast/lexer.c +++ b/src/libponyc/ast/lexer.c @@ -514,6 +514,7 @@ static token_t* slash(lexer_t* lexer) * Removes longest common prefix indentation from every line in a triple * quoted string. If the s...
diff --git a/test/libponyc/lexer.cc b/test/libponyc/lexer.cc index 75939eef46..f1147ee358 100644 --- a/test/libponyc/lexer.cc +++ b/test/libponyc/lexer.cc @@ -370,92 +370,92 @@ TEST_F(LexerTest, StringUnicode6Escape) TEST_F(LexerTest, TripleString) { - const char* src = "\"\"\"Foo\"\"\""; + const char* src = "\"\...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"LexerTest.TripleStringWithNonWhiteSpaceBeforeFirstNewline": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "LexerTest.TripleStringWithoutIndentWithTrailingWsLine": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1066, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1030, "failed_count": 2, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1072, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2221
ponylang
ponyc
2,214
closed
Fix handling of empty and multi-byte character literals
This PR will treat empty character literals as invalid syntax and handle weird utf8 character literals like `'🎠'` correctly. The root cause was the casting from `char` to `int` which created ints like `0xFFFFFF9F` for a lexer char `\x9F`. This was treated as negative and thus ignored by the lexer. This fixes #2...
{"label": "ponylang:master", "ref": "master", "sha": "fff0bdb528a255eb1e87319b9eba908f96364a19"}
[ { "body": "Character literals should only support one character in them except for escape sequences:\r\n\r\n```pony\r\n//allowed\r\nlet escaped = '\\xFF'\r\n\r\n// forbidden\r\nlet multiple_chars = 'FF'\r\n```\r\n\r\nThe current logic for creating an Int from multiple characters is to concatenate the least sign...
diff --git a/src/libponyc/ast/lexer.c b/src/libponyc/ast/lexer.c index 24d67e923d..e5d84e62cb 100644 --- a/src/libponyc/ast/lexer.c +++ b/src/libponyc/ast/lexer.c @@ -837,6 +837,7 @@ static token_t* character(lexer_t* lexer) { consume_chars(lexer, 1); // Leading ' + size_t chars_consumed = 0; lexint_t value;...
diff --git a/test/libponyc/lexer.cc b/test/libponyc/lexer.cc index 77d6ad6e68..75939eef46 100644 --- a/test/libponyc/lexer.cc +++ b/test/libponyc/lexer.cc @@ -598,6 +598,71 @@ TEST_F(LexerTest, EmptyStringAtEndOfSource) DO(test(src)); } +// Character Literals + +TEST_F(LexerTest, SingleCharacterLiteral) +{ + c...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"LexerTest.EmptyCharacterLiteral": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "LexerTest.UTF8CharacterLiteral": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1059, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1024, "failed_count": 2, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1066, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2214
ponylang
ponyc
2,205
closed
Fix codegen failures on incompatible FFI declarations
This change fixes a bug where the same FFI function was being declared with incompatible signatures in different packages without being validated, causing various crashes from both ponyc and LLVM. Closes #1552.
{"label": "ponylang:master", "ref": "master", "sha": "25fa3b158281bee9fd0778de618ad8968d5ed026"}
[ { "body": "The Pony compiler doesn't handle multiple calls to undeclared FFI calls for the same function with different signatures (which is a bug but typos happen) the same way as declared FFI calls. With a debug build of the compiler, it results in an assertion failure. With a release build, the behavior is u...
diff --git a/src/libponyc/codegen/codegen.c b/src/libponyc/codegen/codegen.c index d29a9b9ef0..0aa8de7fb8 100644 --- a/src/libponyc/codegen/codegen.c +++ b/src/libponyc/codegen/codegen.c @@ -1020,6 +1020,7 @@ bool codegen(ast_t* program, pass_opt_t* opt) memset(&c, 0, sizeof(compile_t)); genned_strings_init(&c....
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index cca4847dde..a8d57ffda5 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -15,7 +15,7 @@ * suitable location for tests which don't obviously belong anywhere else. */ -#define TEST_COMPILE(src) DO(test_compile(src, "all")) ...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"CodegenFFITest.DeclParameterCountConflict": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "CodegenFFITest.InternalABIObjectConflict": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "CodegenFFITest.InternalABIFunctionConflict": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "CodegenFFITest.DeclParameterTypeConflic...
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1045, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1010, "failed_count": 7, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1057, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2205
ponylang
ponyc
2,203
closed
Fix internal failure on compilation when boxing bool as union into tuple.
Resolves #2191.
{"label": "ponylang:master", "ref": "master", "sha": "7f8c5b6ee6d27b8596c785960e5515e1fdebbca0"}
[ { "body": "Compiling following code ends in internal failure:\r\n\r\n```pony\r\ntype U is (Bool | C)\r\n\r\nclass C\r\n fun apply(): (I32, U) =>\r\n (0, false)\r\n\r\nactor Main\r\n new create(env: Env) =>\r\n C()\r\n```\r\n\r\nOutput:\r\n\r\n```\r\nBuilding builtin -> /home/ta3ta1/Code/ponyc/packages/b...
diff --git a/src/libponyc/codegen/genbox.c b/src/libponyc/codegen/genbox.c index 6dfa6f2278..b4fbe7ef3f 100644 --- a/src/libponyc/codegen/genbox.c +++ b/src/libponyc/codegen/genbox.c @@ -17,7 +17,7 @@ LLVMValueRef gen_box(compile_t* c, ast_t* type, LLVMValueRef value) pony_assert(t != NULL); compile_type_t* c_t =...
diff --git a/test/libponyc/codegen.cc b/test/libponyc/codegen.cc index 0fb49baf71..1feb059442 100644 --- a/test/libponyc/codegen.cc +++ b/test/libponyc/codegen.cc @@ -122,6 +122,26 @@ TEST_F(CodegenTest, JitRun) } +TEST_F(CodegenTest, BoxBoolAsUnionIntoTuple) +{ + // From #2191 + const char* src = + "type U i...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"CodegenTest.BoxBoolAsUnionIntoTuple": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1044, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1004, "failed_count": 1, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1045, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2203
ponylang
ponyc
2,201
closed
Fix compiler crash on illegal read from '_'
This change moves a check from the verify pass to the expr pass in order to catch an illegal read from '_' in a function argument before trying to use said argument. Closes #2157.
{"label": "ponylang:master", "ref": "master", "sha": "f00f95b30dd68c7faaff0aa88508c218bc19f02b"}
[ { "body": "In the following code:\r\n\r\n```pony\r\nactor Main\r\n new create(env:Env) =>\r\n let a = Array[U8]\r\n a.push(_)\r\n```\r\n\r\nThe last line causes the following assert in the compiler:\r\n\r\n```\r\nvagrant@buffy-leader-1:~/ponyc$ ./build/debug/ponyc -d z\r\nBuilding builtin -> /home/vagran...
diff --git a/src/libponyc/expr/reference.c b/src/libponyc/expr/reference.c index 83e66d392a..b2e2aed7aa 100644 --- a/src/libponyc/expr/reference.c +++ b/src/libponyc/expr/reference.c @@ -50,6 +50,72 @@ static bool check_provides(pass_opt_t* opt, ast_t* type, ast_t* provides, return false; } +static bool is_legal_...
diff --git a/test/libponyc/dontcare.cc b/test/libponyc/dontcare.cc index 4c5865ea51..8f627e0d1e 100644 --- a/test/libponyc/dontcare.cc +++ b/test/libponyc/dontcare.cc @@ -97,7 +97,7 @@ TEST_F(DontcareTest, CannotCallMethodOnDontcare) " fun f() =>\n" " _.foo()"; - TEST_ERRORS_1(src, "can't lookup by nam...
{"SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "RecoverTest.CantAccess_ParamOriginallyTagField": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.ClassWithoutFieldOrCreate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "RecoverTest.CantAccess_LocalOriginallyTagField": {"run": ...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"DontcareTest.CannotCallMethodOnDontcare": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "RecoverTest.CantAccess_ParamOriginallyTagField": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.ClassWithoutFieldOrCreate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "RecoverTest.CantAccess_LocalOriginallyTagField": {"run": ...
{"passed_count": 1042, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 460, "failed_count": 1, "skipped_count": 0, "passed_tests": ["IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.In...
{"passed_count": 1043, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2201
ponylang
ponyc
2,176
closed
Fix compiler crash on union-of-tuples to tuple conversions
This change fixes a compiler crash when converting a union of tuples to a tuple. Closes #1513.
{"label": "ponylang:master", "ref": "master", "sha": "87bca25efaa6d9329ed6c5805ac44e176068a8a4"}
[ { "body": "```pony\r\nprimitive Add\r\nprimitive Dec\r\ntype AddOrDec is (Add | Dec)\r\ntype CmRDTCounterOp is (AddOrDec, U128)\r\n\r\nclass CmRDTCounter\r\n var _value: U128\r\n\r\n new create() => _value = 0\r\n\r\n fun read(): U128 =>\r\n _value\r\n\r\n fun ref add(number: U128): CmRDTCounterOp =>\r\n...
diff --git a/src/libponyc/codegen/genexpr.c b/src/libponyc/codegen/genexpr.c index a29a1f5472..06d7aaae0e 100644 --- a/src/libponyc/codegen/genexpr.c +++ b/src/libponyc/codegen/genexpr.c @@ -1,12 +1,13 @@ #include "genexpr.h" -#include "genname.h" #include "genbox.h" +#include "gencall.h" #include "gencontrol.h" +#i...
diff --git a/test/libponyc/codegen.cc b/test/libponyc/codegen.cc index 14c1b5d0e9..0fb49baf71 100644 --- a/test/libponyc/codegen.cc +++ b/test/libponyc/codegen.cc @@ -235,6 +235,19 @@ TEST_F(CodegenTest, MatchExhaustiveAllCasesPrimitiveValues) ASSERT_EQ(exit_code, 3); } + +TEST_F(CodegenTest, UnionOfTuplesToTuple...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DontcareTest.CannotUseDontcareAsArgumentInCaseExpression": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "RecoverTest.CantAccess_ParamOr...
{"SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTuple": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LiteralTest.CantInfer_Return_InvalidUnion": {"run...
null
null
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DontcareTest.CannotUseDontcareAsArgumentInCaseExpression": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "RecoverTest.CantAccess_ParamOr...
{"passed_count": 1040, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 437, "failed_count": 0, "skipped_count": 0, "passed_tests": ["IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "LexerTest.IntHex", "CodegenTest.MatchExhaustiveAllCasesIncludingDont...
{"passed_count": 1041, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2176
ponylang
ponyc
2,168
closed
Inference of lambda type and array element type from an antecedent (RFC 45).
Resolves #2094.
{"label": "ponylang:master", "ref": "master", "sha": "ae5fabe6fdf7c99f3e797b85674ded5d52cde7a2"}
[ { "body": "Improve inference for lambdas and array literals, allowing implied information to be omitted in cases where there is a definite type on the \"left hand side\".\r\n\r\nhttps://github.com/ponylang/rfcs/blob/master/text/0045-lambda-and-array-inference.md", "number": 2094, "title": "RFC: lamdba-a...
diff --git a/packages/builtin/array.pony b/packages/builtin/array.pony index 4026e2e8f3..2bfa72c72f 100644 --- a/packages/builtin/array.pony +++ b/packages/builtin/array.pony @@ -357,8 +357,7 @@ class Array[A] is Seq[A] value: A!, offset: USize = 0, nth: USize = 0, - predicate: {(box->A!, box->A!): Bo...
diff --git a/packages/buffered/_test.pony b/packages/buffered/_test.pony index 023a712975..02b70a1e61 100644 --- a/packages/buffered/_test.pony +++ b/packages/buffered/_test.pony @@ -18,7 +18,7 @@ class iso _TestReader is UnitTest fun apply(h: TestHelper) ? => let b = Reader - b.append(recover [as U8: + ...
{"ArrayTest.InferFromArrayBoxNeedNotRecovered": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LambdaTest.InferFromNamedArgType": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"ArrayTest.InferFromArrayBoxNeedNotRecovered": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "LambdaTest.InferFromNamedArgType": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "LambdaTest.InferFromArgType": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "LambdaTest.InferFromUnambiguousLambdaChoices": {"run": "NONE...
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1066, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 1000, "failed_count": 36, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Ex...
{"passed_count": 1076, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2168
ponylang
ponyc
2,126
closed
Treat `as` type of array literals as the alias of the element type.
Resolves #2122.
{"label": "ponylang:master", "ref": "master", "sha": "8badbf6b6e6c0da9c99eaac59c90d98e1b3b8dad"}
[ { "body": "I came across this behaviour while working on #2094.\r\n\r\nIt appears that an array literal, even when the `as` type is given explicitly, uses the *alias* of the `as` type as the type argument for the `Array` type. Consider the following example:\r\n\r\n```pony\r\ntrait iso T\r\nclass iso A is T\r\n...
diff --git a/src/libponyc/expr/array.c b/src/libponyc/expr/array.c index bb751f9964..9063340a74 100644 --- a/src/libponyc/expr/array.c +++ b/src/libponyc/expr/array.c @@ -48,9 +48,10 @@ bool expr_array(pass_opt_t* opt, ast_t** astp) return false; c_type = ast_type(ele); // May have changed due to lite...
diff --git a/test/libponyc/sugar_expr.cc b/test/libponyc/sugar_expr.cc index 29ed702774..303c87a892 100644 --- a/test/libponyc/sugar_expr.cc +++ b/test/libponyc/sugar_expr.cc @@ -1097,3 +1097,145 @@ TEST_F(SugarExprTest, AsDontCareMultiTuple) TEST_EQUIV(short_form, full_form); } + + +TEST_F(SugarExprTest, ArrayLi...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.ArrayLiteralAsIsoAliasedElements": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "SugarExprTest.ArrayLiteralAsIso": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test":...
{"ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.IntHex": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "CodegenTest.MatchExhaustiveAllCasesIncludingDontCareAndTu...
{"SugarExprTest.ArrayLiteralAsIsoAliasedElements": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "SugarExprTest.ArrayLiteralAsIso": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "SugarExprTest.ArrayLiteralAsIsoConsumedElements": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 1016, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
{"passed_count": 981, "failed_count": 3, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
{"passed_count": 1024, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_2126
ponylang
ponyc
2,007
closed
Fix iftype where the type variable appears as a type parameter.
Fixes #2006
{"label": "ponylang:master", "ref": "master", "sha": "9c04a3730066df1372293efe44556460fecd57c4"}
[ { "body": "This came up when working on [my CRDT package](https://github.com/jemc/pony-crdt).\r\n\r\nIf I have a type parameter that is narrowed by an iftype constraint within a block, that constraint doesn't apply to a prior instantiated reference to a type that included the narrowed type parameter as a type a...
diff --git a/src/libponyc/type/typeparam.c b/src/libponyc/type/typeparam.c index 3e104dc4be..97b1b9a408 100644 --- a/src/libponyc/type/typeparam.c +++ b/src/libponyc/type/typeparam.c @@ -552,7 +552,7 @@ void typeparam_set_cap(ast_t* typeparamref) ast_setid(cap, tcap); } -static ast_t* typeparamref_current(ast_t* ...
diff --git a/test/libponyc/iftype.cc b/test/libponyc/iftype.cc index 5a97042eb5..ff52925681 100644 --- a/test/libponyc/iftype.cc +++ b/test/libponyc/iftype.cc @@ -345,3 +345,21 @@ TEST_F(IftypeTest, NestedCond) TEST_COMPILE(src); } + + +TEST_F(IftypeTest, ReplaceTypeargs) +{ + const char* src = + "class A\n" ...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "IftypeTest.ThenClause_TypeConstraint": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run"...
{"IftypeTest.ReplaceTypeargs": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 996, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
{"passed_count": 957, "failed_count": 1, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
{"passed_count": 997, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
ponylang__ponyc_2007
ponylang
ponyc
1,981
closed
Fix bug in `as` capture
Previously, the `as` sugar allowed unsafe captures through `consume !`, which could perform forbidden refcap conversion. closes #1979
{"label": "ponylang:master", "ref": "master", "sha": "560c412e0eb23a0b922a9ba3bea064c14f18d84a"}
[ { "body": "This program shows a modification to a val Array as if it was an iso reference.\r\n```pony\r\nclass iso T\r\n var data: (Array[I64] val | Array[I64] iso) // iso <: val -> Array[I64] val\r\n\r\n new create() =>\r\n data = recover iso Array[I64] end\r\n\r\n new from(array: Array[I64] val) =>\r\n ...
diff --git a/src/libponyc/expr/match.c b/src/libponyc/expr/match.c index 458c0dde4d..fb3a926295 100644 --- a/src/libponyc/expr/match.c +++ b/src/libponyc/expr/match.c @@ -461,6 +461,7 @@ bool expr_case(pass_opt_t* opt, ast_t* ast) ast_error(opt->check.errors, pattern, "this pattern can never match"); ast_...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index 96857faaa5..a71ba9344f 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -626,7 +626,7 @@ TEST_F(BadPonyTest, DefaultArgScope) TEST_F(BadPonyTest, GenericMain) { const char* src = - "actor Main[X]" + "actor Main[X]\n...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "BadPonyTest.AsBadCap": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest....
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "IftypeTest.ThenClause_TypeConstraint": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run"...
{"BadPonyTest.AsBadCap": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 998, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
{"passed_count": 960, "failed_count": 1, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
{"passed_count": 1000, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Exp...
ponylang__ponyc_1981
ponylang
ponyc
1,867
closed
Fix: assert failure on explicit reference to `this` in constructor.
Resolves #1865.
{"label": "ponylang:master", "ref": "master", "sha": "6446dfbbfba408f9771540d24168ca6ee725c34c"}
[ { "body": "Any program which refers to `this` explicitly in a constructor before the object is fully initialised causes an assertion failure. Implicit `this` is fine though.\r\n```pony\r\nactor Main\r\n var f: U8\r\n new create(env: Env) =>\r\n this.f = 0\r\n```\r\n\r\n```\r\nBuilding builtin -> /U...
diff --git a/src/libponyc/expr/reference.c b/src/libponyc/expr/reference.c index 0675379b06..b3e0bd8133 100644 --- a/src/libponyc/expr/reference.c +++ b/src/libponyc/expr/reference.c @@ -654,7 +654,7 @@ bool expr_this(pass_opt_t* opt, ast_t* ast) ast_t* parent = ast_parent(ast); if((ast_id(parent) == TK_DOT) ...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index 722c682f09..cc3a618494 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -50,7 +50,6 @@ TEST_F(BadPonyTest, ClassInOtherClassProvidesList) TEST_ERRORS_1(src, "can only provide traits and interfaces"); } - TEST_F(BadPonyT...
{"SugarTest.CaseFunctionTypeParamConstraint": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.Xor": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.CaseFunctionParamNotNamed": {"run": "PASS", "test": "NONE", "fix": "PASS"}...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "IftypeTest.ThenClause_TypeConstraint": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run"...
null
null
{"SugarTest.CaseFunctionTypeParamConstraint": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.Xor": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.CaseFunctionParamNotNamed": {"run": "PASS", "test": "NONE", "fix": "PASS"}...
{"passed_count": 904, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
{"passed_count": 668, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
{"passed_count": 905, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
ponylang__ponyc_1867
ponylang
ponyc
1,858
closed
Bare methods and bare lambdas (RFC 34)
These new language constructs can be used in FFI interoperation with C libraries that use function pointers as callbacks. Closes #1690.
{"label": "ponylang:master", "ref": "master", "sha": "939cf25789c72fec3e623570cb4f8cf934fc6214"}
[ { "body": "Adds \"bare\" lambdas for use in FFI interoperation with C libraries that use function pointers as callbacks: https://github.com/ponylang/rfcs/blob/master/text/0034-bare-ffi-lambdas.md", "number": 1690, "title": "RFC: bare-ffi-lambdas" } ]
diff --git a/examples/ffi-callbacks/callbacks.c b/examples/ffi-callbacks/callbacks.c new file mode 100644 index 0000000000..2c2dd947b0 --- /dev/null +++ b/examples/ffi-callbacks/callbacks.c @@ -0,0 +1,6 @@ +typedef void(*CB)(void*, int); + +void do_callback(CB callback, void* env) +{ + callback(env, 10); +} diff --git...
diff --git a/test/libponyc/annotations.cc b/test/libponyc/annotations.cc index 7823c4cd0e..c87cbc4c1d 100644 --- a/test/libponyc/annotations.cc +++ b/test/libponyc/annotations.cc @@ -112,7 +112,7 @@ TEST_F(AnnotationsTest, AnnotationsArePresent) ast = ast_annotation(ast); - ASSERT_TRUE((ast != NULL) && (ast_id(...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "IftypeTest.ThenClause_TypeConstraint": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run"...
null
null
null
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "IftypeTest.ThenClause_TypeConstraint": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAccessFail": {"run"...
{"passed_count": 933, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 963, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "IftypeTest.ThenClause_TypeConstraint", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "ParseExprTest.Expr...
ponylang__ponyc_1858
ponylang
ponyc
1,852
closed
Fix JIT symbol load
When loading symbols from a JITed program in `gen_jit_and_run`, the value stored is now the contents instead of the address. This avoids an incorrect level of indirection. In order to avoid copying big arrays, the compiler tests now load a pointer to the generated descriptor table instead of the table itself. The `_...
{"label": "ponylang:master", "ref": "master", "sha": "6631b63dd7792d84a4004bf733c1fcc92069a421"}
[ { "body": "The original problem was found by @aturley.\r\n\r\nThe `gen_jit_and_run` offers the ability to load symbols from the JITed program. There currently is a bug with that, where an incorrect additional indirection is introduced.\r\n\r\nI'm setting the issue to medium priority since it doesn't affect any ...
diff --git a/src/libponyc/codegen/gendesc.c b/src/libponyc/codegen/gendesc.c index abeac10206..98b26203c9 100644 --- a/src/libponyc/codegen/gendesc.c +++ b/src/libponyc/codegen/gendesc.c @@ -481,14 +481,20 @@ void gendesc_table(compile_t* c) } LLVMTypeRef type = LLVMArrayType(c->descriptor_ptr, len); - LLVMVal...
diff --git a/test/libponyc/util.cc b/test/libponyc/util.cc index ba9c8f9f4e..3f19c48e93 100644 --- a/test/libponyc/util.cc +++ b/test/libponyc/util.cc @@ -22,8 +22,8 @@ using std::string; // These will be set when running a JIT'ed program. extern "C" { - EXPORT_SYMBOL void* __DescTable; - EXPORT_SYMBOL void* __Des...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
null
null
null
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"passed_count": 892, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Su...
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 892, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Su...
ponylang__ponyc_1852
ponylang
ponyc
1,726
closed
Identity comparison of boxed values
Previously, the identity comparison for boxed values worked by comparing the addresses of the boxes regardless of their contents. This was leading to confusing behaviour, for example ```pony let a: U32 = 0 let b: U32 = 0 let boxa: Any = a let boxb: Any = b a is b // True. boxa is boxb // False. ``...
{"label": "ponylang:master", "ref": "master", "sha": "c995c4674b9ef062fa74b38be52682f945007dd2"}
[ { "body": "```pony\r\nactor Main\r\n new create(env: Env) =>\r\n let a = U8(2)\r\n let b = U8(2)\r\n env.out.print((a is b).string())\r\n foo(env, a, b)\r\n \r\n fun foo(env: Env, a: Any, b: Any) =>\r\n env.out.print((a is b).string())\r\n```\r\n\r\nThis code prints `true` then `false`, but ...
diff --git a/src/libponyc/codegen/codegen.c b/src/libponyc/codegen/codegen.c index 3ad4f25a3f..aa93beef31 100644 --- a/src/libponyc/codegen/codegen.c +++ b/src/libponyc/codegen/codegen.c @@ -763,6 +763,26 @@ static void init_runtime(compile_t* c) // i32 pony_personality_v0(...) type = LLVMFunctionType(c->i32, NUL...
diff --git a/test/libponyc/codegen_identity.cc b/test/libponyc/codegen_identity.cc new file mode 100644 index 0000000000..b0a04a82be --- /dev/null +++ b/test/libponyc/codegen_identity.cc @@ -0,0 +1,261 @@ +#include <gtest/gtest.h> +#include <platform.h> + +#include "util.h" + +#define TEST_COMPILE(src) DO(test_compile(...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"CodegenIdentityTest.BoxedTupleIsBoxedTuple": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "CodegenIdentityTest.NumericIsBoxedNumeric": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "CodegenIdentityTest.DigestofBoxedNumeric": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "CodegenIdentityTest.DigestofBoxedTuple"...
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 878, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Su...
{"passed_count": 846, "failed_count": 6, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Su...
{"passed_count": 890, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Su...
ponylang__ponyc_1726
ponylang
ponyc
1,536
closed
Packed structures (RFC 32)
This change adds program annotations allowing programmers to declare packed structures, i.e. structures without implementation-specific padding between members. Closes #1523.
{"label": "ponylang:master", "ref": "master", "sha": "9739cad84706037682dade0ee7a10d4641b099ce"}
[ { "body": "Add program annotations allowing programmers to declare packed structures, i.e. structures without implementation-specific padding between members.\r\n\r\nhttps://github.com/ponylang/rfcs/blob/master/text/0032-packed-structs.md", "number": 1523, "title": "RFC: Packed Structures" } ]
diff --git a/src/libponyc/codegen/gentype.c b/src/libponyc/codegen/gentype.c index db6a6da602..81a9fa12c0 100644 --- a/src/libponyc/codegen/gentype.c +++ b/src/libponyc/codegen/gentype.c @@ -407,6 +407,7 @@ static bool make_struct(compile_t* c, reach_type_t* t) { LLVMTypeRef type; int extra = 0; + bool packed =...
diff --git a/test/libponyc/codegen.cc b/test/libponyc/codegen.cc new file mode 100644 index 0000000000..aae6ea895f --- /dev/null +++ b/test/libponyc/codegen.cc @@ -0,0 +1,105 @@ +#include <gtest/gtest.h> +#include <platform.h> + +#include <reach/reach.h> + +#include "util.h" + +#ifdef _MSC_VER +// Stop MSVC from compla...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"CodegenTest.PackedStructIsPacked": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 865, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 831, "failed_count": 1, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 869, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1536
ponylang
ponyc
1,516
closed
Improved error for match over union of different capabilities
This PR resolves #1506 by improving the error message given on a match expression on a union of types with different capabilities. The previous error in this case vaguely stated that "this capture violates capabilities".
{"label": "ponylang:master", "ref": "master", "sha": "c6cd013119eb1f1a3b9b76a8111ac1877f61f9d8"}
[ { "body": "This code produces an error message that is very unclear about why the capture would violate capabilities:\r\n```pony\r\ninterface box Foo\r\n fun foo(): None\r\n\r\ninterface ref Bar\r\n fun ref bar(): None\r\n\r\nactor Main\r\n new create(env: Env) => None\r\n\r\n fun apply(x: (Foo | Bar)) =>\r...
diff --git a/src/libponyc/expr/match.c b/src/libponyc/expr/match.c index 19e389db79..994e304bf6 100644 --- a/src/libponyc/expr/match.c +++ b/src/libponyc/expr/match.c @@ -333,12 +333,26 @@ bool expr_case(pass_opt_t* opt, ast_t* ast) case MATCHTYPE_DENY: { - ast_error(opt->check.errors, pattern, - ...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index 57ab8b9c6d..3a01f7a06b 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -315,3 +315,26 @@ TEST_F(BadPonyTest, IndexArrayWithBrackets) TEST_ERRORS_1(src, "Value formal parameters not yet supported"); } + +TEST_F(BadPonyTe...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"BadPonyTest.MatchUnionOfDifferentCaps": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 862, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 825, "failed_count": 1, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 863, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1516
ponylang
ponyc
1,486
closed
Make non-sendable objects accessible as tag in recover
Locals and parameters are now accessible as `tag` inside of recover expressions instead of being completely unreferenceable. This change also fixes #1385 as a side-effect. Closes #1385.
{"label": "ponylang:master", "ref": "master", "sha": "336000f438564ca2863d32685964ccd23ec9d174"}
[ { "body": "I implemented this a couple months ago (ab98037) and I just realised it absolutely doesn't work for local variables because of the order in which the error checking occurs.\r\n\r\nThis is a reminder for me to eventually fix the problem, or for somebody else if anyone wants to have a go.", "number...
diff --git a/CHANGELOG.md b/CHANGELOG.md index 542795916e..7c54b06f7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -140,6 +140,7 @@ All notable changes to the Pony compiler and standard library will be documented - allow_tls_v1_1 - allow_tls_v1_2 - TCP sockets on Linux now use Epoll One Shot +- Non-sendab...
diff --git a/test/libponyc/recover.cc b/test/libponyc/recover.cc index 2d0bd1230b..0df7063719 100644 --- a/test/libponyc/recover.cc +++ b/test/libponyc/recover.cc @@ -71,7 +71,7 @@ TEST_F(RecoverTest, CantRecover_NewTagToVal) TEST_ERRORS_1(src, "can't recover to this capability"); } -TEST_F(RecoverTest, CantAcces...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "RecoverTest.CanSee_VarLocalRefAsTag": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"RecoverTest.CanSee_VarLocalRefAsTag": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "RecoverTest.CanAccess_LocalSendableField": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "RecoverTest.CanSee_ParamRefAsTag": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "RecoverTest.CanSee_LetLocalRefAsTag": {"run": "NONE", "...
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 823, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 786, "failed_count": 5, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 828, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1486
ponylang
ponyc
1,411
closed
Method chaining (RFC #25)
This change provides a way to chain calls on an object without depending on the method's API. Closes #1409.
{"label": "ponylang:master", "ref": "master", "sha": "4e9779959433c5b5c817e9a0cdb3b71bff9d09ae"}
[ { "body": "Introduce a syntax sugar for invoking a method such that the return value is discarded and replaced with the object itself allowing further operation.\r\n\r\nhttps://github.com/ponylang/rfcs/blob/master/text/0025-sugar-for-method-chaining.md", "number": 1409, "title": "RFC: Sugar for Method C...
diff --git a/pony.g b/pony.g index 7baf9c1815..e4cce72fee 100644 --- a/pony.g +++ b/pony.g @@ -172,6 +172,10 @@ call : '(' positional? named? ')' ; +chain + : '.>' ID + ; + tilde : '~' ID ; @@ -330,6 +334,7 @@ antlr_1 antlr_2 : dot | tilde + | chain | typeargs | call ; @@ -337,6 +342,7...
diff --git a/test/libponyc/chain.cc b/test/libponyc/chain.cc new file mode 100644 index 0000000000..2befa9a3bb --- /dev/null +++ b/test/libponyc/chain.cc @@ -0,0 +1,124 @@ +#include <gtest/gtest.h> +#include <platform.h> + +#include "util.h" + + +#define TEST_COMPILE(src) DO(test_compile(src, "expr")) + +#define TEST_E...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ChainTest.Chain_AliasRefcap": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashM...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"ChainTest.Chain_AliasRefcap": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "ChainTest.Chain_UniqueEphNoRecoverCall": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "ChainTest.Chain_UniqueEphRecoverCall": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "ChainTest.Chain_UniqueRefcap": {"run": "NONE", "test": "FAIL"...
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 807, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 772, "failed_count": 6, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 813, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1411
ponylang
ponyc
1,339
closed
Fix compiler assert fail on circular type inference error (issue #1334)
This PR fixes a compiler assert fail on circular type inference error. Resolves #1334.
{"label": "ponylang:master", "ref": "master", "sha": "ac20e0541167fa6893f2fbcf43aa68b784b3bd8b"}
[ { "body": "``` pony\nactor Main\n new create(env: Env) =>\n let x = x.create()\n```\n\nThis code is invalid because of the circular type inference, and it makes the compiler assert during the expr pass. The assertion is `src/libponyc/pass/expr.c:319: ast_result_t pass_expr(ast_t **, pass_opt_t *): Assertion...
diff --git a/src/libponyc/expr/reference.c b/src/libponyc/expr/reference.c index 09ef9dd15e..37b9421d6d 100644 --- a/src/libponyc/expr/reference.c +++ b/src/libponyc/expr/reference.c @@ -675,9 +675,6 @@ bool expr_reference(pass_opt_t* opt, ast_t** astp) ast_t* type = ast_type(def); - if(is_typecheck_err...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index 4b15e57f54..8422c2d3d7 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -259,7 +259,9 @@ TEST_F(BadPonyTest, WithBlockTypeInference) " new create(env: Env) =>\n" " with x = 1 do None end"; - TEST_ERRORS_1(src,...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Bad...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"BadPonyTest.WithBlockTypeInference": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "BadPonyTest.CircularTypeInfer": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 804, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 768, "failed_count": 2, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 805, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1339
ponylang
ponyc
1,260
closed
Improve error message for Main without constructor
resolves #1259
{"label": "ponylang:master", "ref": "master", "sha": "8910b3cd9fc71a30a340c8159a83991be7aee5be"}
[ { "body": "A pony program where the Main actor has no constructor produces the following error message:\n\n```\nthe create constructor of a Main actor must take a single Env parameter\nactor Main\n^\n```\n\nThis should be changed to `A Main actor must have a create constructor which takes a single Env parameter...
diff --git a/src/libponyc/expr/reference.c b/src/libponyc/expr/reference.c index 7fd81978fe..63b0d3fb56 100644 --- a/src/libponyc/expr/reference.c +++ b/src/libponyc/expr/reference.c @@ -1330,7 +1330,7 @@ static bool check_main_create(pass_opt_t* opt, ast_t* ast) if(ast_childcount(params) != 1) { ast_error(o...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index 702acd93f4..9d2c71e5c8 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -283,9 +283,19 @@ TEST_F(BadPonyTest, EmbedNestedTuple) "actor Main\n" " embed foo: Foo\n" " let x: U64\n" - + " new create(env...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"BadPonyTest.MainWithoutConstructor": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 753, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 718, "failed_count": 1, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 754, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1260
ponylang
ponyc
1,124
closed
Restrict mutable tuple recovery
This is a fix for #1123. Recovery of tuples is now completely forbidden. We could allow some tuples and rcap combinations while keeping it safe but I'm not sure if it would be a good thing. EDIT by @jemc: This PR now allows some tuple recovery, while disallowing the problematic combinations.
{"label": "ponylang:master", "ref": "master", "sha": "8ae0ecd7dcc1fc483cd964509f4a91ad35419dc3"}
[ { "body": "From today VUG presentation.\n\n``` pony\nclass Foo\n\nactor Main\n new create(env: Env) =>\n let x: (Foo, Foo val) = recover\n let y: Foo = Foo\n (y, y)\n end\n```\n\nThis program compiles but is clearly wrong (`ref` and `val` aliases to the same object).\n", "number": 1123, ...
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c0e36d6ce..3bfde52d58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to the Pony compiler and standard library will be documented ### Fixed - Compiling ponyrt with Clang versions >= 3.3, < 3.6. +- Restrict mutable tuple recovery to ma...
diff --git a/test/libponyc/recover.cc b/test/libponyc/recover.cc index 5a85c82fdc..2d0bd1230b 100644 --- a/test/libponyc/recover.cc +++ b/test/libponyc/recover.cc @@ -375,3 +375,70 @@ TEST_F(RecoverTest, CantDoPartialApplication_RefWithLowerToTag) TEST_ERRORS_1(src, "receiver type is not a subtype of target type")...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"RecoverTest.CantRecover_TupleInUnionInnerLift": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "RecoverTest.CantRecover_TupleMutableLift": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 799, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 767, "failed_count": 2, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 804, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1124
ponylang
ponyc
1,095
closed
Reject function types in is_x_match_nominal
Closes #903.
{"label": "ponylang:master", "ref": "master", "sha": "cdd5165d27e62b4b36541edf7ba83d6347ce3aa3"}
[ { "body": "If you try to match on the return value of a method and forget to call the method, you get the following unhelpful compiler message:\n\n`Assertion failed: (0), function is_x_match_nominal, file src/libponyc/type/matchtype.c, line 381.`\n\nThere's no indication of where you went wrong in your code.\n\...
diff --git a/src/libponyc/expr/literal.c b/src/libponyc/expr/literal.c index 1c0958e2d0..b1298bf8c7 100644 --- a/src/libponyc/expr/literal.c +++ b/src/libponyc/expr/literal.c @@ -424,6 +424,7 @@ static int uifset(pass_opt_t* opt, ast_t* type, lit_chain_t* chain) return uifset_simple_type(opt, type); case ...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index 323e408d21..b7f916b37b 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -231,3 +231,20 @@ TEST_F(BadPonyTest, ParenthesisedReturn2) TEST_ERRORS_1(src, "Unreachable code"); } + +TEST_F(BadPonyTest, MatchUncalledMethod) +{...
{"SugarTest.CaseFunctionTypeParamConstraint": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.Xor": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.CaseFunctionParamNotNamed": {"run": "PASS", "test": "NONE", "fix": "PASS"}...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
null
null
{"SugarTest.CaseFunctionTypeParamConstraint": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.Xor": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.TryWithoutElse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarTest.CaseFunctionParamNotNamed": {"run": "PASS", "test": "NONE", "fix": "PASS"}...
{"passed_count": 749, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 544, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 750, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1095
ponylang
ponyc
1,057
closed
Allow use of sendable members in recover expressions
This implements @sylvanc's idea for fields in #728. I also added function access, which is allowed if the receiver capability of the function isn't mutable and if the parameters and return value are sendable. I think I got the requirements right but I'm not entirely sure.
{"label": "ponylang:master", "ref": "master", "sha": "0c88dd775087f862f103faacdf569e57644e4ce0"}
[ { "body": "Take the following example:\n\n``` pony\nclass RecoverTest\n let size: USize val = 32\n\n fun box new_array1(): Array[USize] trn =>\n recover Array[USize].create(size) end\n\n fun box new_array2(): Array[USize] trn =>\n let local_size = size\n recover Array[USize].create(local_size) end\n...
diff --git a/CHANGELOG.md b/CHANGELOG.md index 59daa6834a..ec998153c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -109,6 +109,7 @@ All notable changes to the Pony compiler and standard library will be documented - `ponyc --version` now includes the build type (debug/release) in its output. - Strings now grow and ...
diff --git a/test/libponyc/recover.cc b/test/libponyc/recover.cc index 29702861e2..5a85c82fdc 100644 --- a/test/libponyc/recover.cc +++ b/test/libponyc/recover.cc @@ -10,6 +10,10 @@ { const char* errs[] = {err1, NULL}; \ DO(test_expected_errors(src, "ir", errs)); } +#define TEST_ERRORS_2(src, err1, err2) \ + ...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "RecoverTest.CanAccess_VarFieldVal": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "RecoverTest.CanAccess_EmbedFieldVal": {"run": "NONE", "test": "FAIL", ...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"RecoverTest.CanAccess_VarFieldVal": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "RecoverTest.CanAccess_EmbedFieldVal": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "RecoverTest.CanAccess_LetFieldVal": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "RecoverTest.CanAccess_MutableMethod": {"run": "NONE", "test":...
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 741, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 704, "failed_count": 10, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "P...
{"passed_count": 749, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1057
ponylang
ponyc
1,051
closed
Recursively check control flow AST errors
Previously, invalid uses of control flow statements were only checked on the AST node for the statement itself. We now check parent sequence nodes to catch errors if the statement is in parenthesis. Closes #1050.
{"label": "ponylang:master", "ref": "master", "sha": "5c49115c102c7165ef825794279e80600de297a7"}
[ { "body": "``` pony\nactor Main\n new create(env: Env) =>\n (return)\n```\n\nThis code should result in an error (`use return only to exit early from a method, not at the end`) but produces the following invalid LLVM IR.\n\n``` llvm\ndefine fastcc void @Main_tag_create_oo(%32* nocapture dereferenceable(248)...
diff --git a/src/libponyc/expr/control.c b/src/libponyc/expr/control.c index cfe16a1b45..d709016eb3 100644 --- a/src/libponyc/expr/control.c +++ b/src/libponyc/expr/control.c @@ -464,7 +464,17 @@ bool expr_return(pass_opt_t* opt, ast_t* ast) // return is always the last expression in a sequence assert(ast_sibling...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index e0661c24f2..323e408d21 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -205,3 +205,29 @@ TEST_F(BadPonyTest, MainActorFunCreate) TEST_ERRORS_1(src, "the create method of a Main actor must be a constructor"); } + +TEST_F...
{"BadPonyTest.ParenthesisedReturn2": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"BadPonyTest.ParenthesisedReturn2": {"run": "NONE", "test": "FAIL", "fix": "PASS"}, "BadPonyTest.ParenthesisedReturn": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 739, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 704, "failed_count": 2, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 741, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1051
ponylang
ponyc
1,035
closed
Improve error msg for lambda capture before their declaration (Issue #1018)
Hello, I tried to fix the issue I opened the other day (#1018) and I wrote a failing test for it. I found that this was already working correctly unless the type was to be inferred. I am not entirely sure I put the rather small fix in the correct location, so please point me in the correct direction if it is not, o...
{"label": "ponylang:master", "ref": "master", "sha": "e5e388df132fdff91d4e6afb8d8e66be175fa051"}
[ { "body": "I am running on the latest master (commit d65c22629f) on Ubuntu, ponyc compiled from source in release mode, and with this snippet alone, ponyc crashes:\n\n``` pony\nclass RandomClass\n fun repro() =>\n let my_lambda: {(): None} = lambda()(future_capture) => None end\n let future_capture ...
diff --git a/src/libponyc/expr/lambda.c b/src/libponyc/expr/lambda.c index a721a8a56f..e3bd25b7e4 100644 --- a/src/libponyc/expr/lambda.c +++ b/src/libponyc/expr/lambda.c @@ -1,5 +1,6 @@ #include "lambda.h" #include "literal.h" +#include "reference.h" #include "../ast/astbuild.h" #include "../ast/printbuf.h" #incl...
diff --git a/test/libponyc/badpony.cc b/test/libponyc/badpony.cc index 525408c215..e0661c24f2 100644 --- a/test/libponyc/badpony.cc +++ b/test/libponyc/badpony.cc @@ -155,6 +155,18 @@ TEST_F(BadPonyTest, ObjectLiteralUninitializedField) TEST_ERRORS_1(src, "object literal fields must be initialized"); } +TEST_F(Ba...
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"BadPonyTest.LambdaCaptureVariableBeforeDeclarationWithTypeInferenceExpressionFail": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
{"ListTest.InitializeList": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "DsFunTest.HashSameStringGivesSameKey": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ListTest.ListLength": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "HashMapTest.InsertAndRetrieve": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "Poo...
{"passed_count": 738, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 703, "failed_count": 1, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 739, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_1035
ponylang
ponyc
671
closed
Add -rpath to the link command for library paths
Add a new parameter, rpath_preamble, to program_lib_build_args (libponyc/pkg/program.c). If this argument is non-null, then for all library paths from the source code, command line, and PONYPATH environment variable, add rpath_preamble plus the libpath to the string used as a linker command line. For Linux and FreeBSD,...
{"label": "ponylang:master", "ref": "master", "sha": "18e81129ee5e0e365f4ed1aaf4680423efe447dc"}
[ { "body": "I have pcre2-8 installed in my home directory rather than in a directory in my system's search path. Building the stdlib tests with the command line:\n\n```\nbuild/debug/ponyc --path /home/mcguire/soft/pony/libpcre2/lib packages/stdlib\n```\n\nworks, but the resulting binary cannot find libpcre2-8:\n...
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ed23e017d..3786ee69be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ All notable changes to the Pony compiler and standard library will be documented - Crashing gc bug caused by "force freeing" objects with finalizers. - Bug in `String.compare` and `Stri...
diff --git a/test/libponyc/program.cc b/test/libponyc/program.cc index caa71448fe..288c0f82b3 100644 --- a/test/libponyc/program.cc +++ b/test/libponyc/program.cc @@ -29,7 +29,7 @@ TEST(ProgramTest, NoLibs) ast_t* prog = ast_blank(TK_PROGRAM); ASSERT_NE((void*)NULL, prog); - program_lib_build_args(prog, "", "p...
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
null
null
null
{"ParseEntityTest.TraitFunctionCannotBeCCallable": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "ParseExprTest.ExpressionNotAllowedBeforeCompileError": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "LexerTest.EmptyStringAtEndOfSource": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "SugarExprTest.PartialMemberAcc...
{"passed_count": 659, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 660, "failed_count": 0, "skipped_count": 0, "passed_tests": ["ParseEntityTest.TraitFunctionCannotBeCCallable", "ParseExprTest.ExpressionNotAllowedBeforeCompileError", "LexerTest.EmptyStringAtEndOfSource", "SugarExprTest.PartialMemberAccessFail", "LexerTest.TripleStringEndingWith4ExtraDoubleQuotes", "Pa...
ponylang__ponyc_671
facebook
zstd
3,942
closed
Fix #3719 : mixing -c, -o and --rm
`-c` disables `--rm`, but only if it's selected. In situations where `-o` is in the same command and happens to be present after `-c`, `-o` ends up being the selected one, and the different rules of `-o` become applicable (essentially `-o` respects `--rm` if there is only 1 input file). fix #3719
{"label": "facebook:dev", "ref": "dev", "sha": "372fddf4e6a6db6776b745f31c02a7c8c8dfc83f"}
[ { "body": "**Describe the bug**\r\nzstd won't remove the file after compression when `--rm` argument is passed.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. `zstd --rm -f -T0 -8qc dir/file -o dir/file.zst`\r\n2. `ls dir/file`\r\n3. `file` is still present\r\n\r\nIf `--rm` is placed as a las...
diff --git a/programs/zstd.1.md b/programs/zstd.1.md index c5d0ef70a36..646e3cf28eb 100644 --- a/programs/zstd.1.md +++ b/programs/zstd.1.md @@ -225,15 +225,17 @@ the last one takes effect. This parameter defines a loose target: compressed blocks will target this size "on average", but individual blocks can still ...
diff --git a/tests/playTests.sh b/tests/playTests.sh index bf5fba89b35..dc7794654aa 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -234,12 +234,23 @@ unset ZSTD_CLEVEL println "test : compress to stdout" zstd tmp -c > tmpCompressed zstd tmp --stdout > tmpCompressed # long command format -println "...
{"cltools/zstdgrep.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/verbose-wlog.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/levels.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/multi-threaded.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "file-stat/comp...
null
null
null
{"cltools/zstdgrep.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/verbose-wlog.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/levels.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/multi-threaded.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "file-stat/comp...
{"passed_count": 39, "failed_count": 2, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "file-stat/compress-stdin-to-file.sh", "file-stat/decompress-file-to-file.sh", "compression/adapt.sh", "decompression/detectErrors....
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 39, "failed_count": 2, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "file-stat/compress-stdin-to-file.sh", "file-stat/decompress-file-to-file.sh", "compression/adapt.sh", "decompression/detectErrors....
facebook__zstd_3942
facebook
zstd
3,530
closed
Add ZSTD_set{C,F,}Params() helper functions
* Add ZSTD_setFParams() and ZSTD_setParams() * Modify ZSTD_setCParams() to use ZSTD_setParameter() to avoid a second path setting parameters * Add unit tests * Update documentation to suggest using them to replace deprecated functions Fixes #3396.
{"label": "facebook:dev", "ref": "dev", "sha": "988ce61a0c019d7fc58575954636b9ff8d147845"}
[ { "body": "See PR #3395. A function that takes `ZSTD_parameters` or `ZSTD_compressionParams`, or `ZSTD_frameParams` and applies them to the cctx/cctxParams would be useful.", "number": 3396, "title": "Add helper functions to set ZSTD_parameters on a cctx or cctxParams" } ]
diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index dc70dfbd82e..72108311ace 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -1178,16 +1178,39 @@ size_t ZSTD_CCtx_setParametersUsingCCtxParams( size_t ZSTD_CCtx_setCParams(ZSTD_CCtx* cctx, ZSTD_compressionPara...
diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 85fa38475dd..fa5f89aa62e 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -1650,6 +1650,133 @@ static int basicUnitTests(U32 const seed, double compressibility) } DISPLAYLEVEL(3, "OK \n"); + DISPLAYLEVEL(3, "test%3d : ZSTD_CCtx_setCParams() : ", testN...
{"cltools/zstdgrep.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/verbose-wlog.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/levels.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/multi-threaded.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "file-stat/comp...
null
null
null
{"cltools/zstdgrep.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/verbose-wlog.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/levels.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/multi-threaded.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "file-stat/comp...
{"passed_count": 37, "failed_count": 0, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "file-stat/compress-stdin-to-file.sh", "file-stat/decompress-file-to-file.sh", "compression/adapt.sh", "compression/stream-size.sh"...
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 37, "failed_count": 0, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "file-stat/compress-stdin-to-file.sh", "file-stat/decompress-file-to-file.sh", "compression/adapt.sh", "compression/stream-size.sh"...
facebook__zstd_3530
facebook
zstd
3,438
closed
Cap hashLog & chainLog to ensure that we only use 32 bits of hash
* Cap shortCache chainLog to 24 * Cap row match finder hashLog so that rowLog <= 24 * Add unit tests to expose all cases. The row match finder unit tests are only run in 64-bit mode, because they allocate ~1GB. Fixes #3336
{"label": "facebook:dev", "ref": "dev", "sha": "64963dcbd6162c52ba9273bb55d78c7a442b12f4"}
[ { "body": "[This assert](https://github.com/embg/zstd/blob/dev/lib/compress/zstd_compress_internal.h#L785) which was added as part of short cache has uncovered two bugs:\r\n* The short cache PR only validates that hashLog is <= 24 bits. We need to do the same for chainLog, this has showed up in some CI failures...
diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 3a48e7dcd48..e0bcbfb165b 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -1412,7 +1412,8 @@ static ZSTD_compressionParameters ZSTD_adjustCParams_internal(ZSTD_compressionParameters cPar, ...
diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 4a091c8972b..e02d068722c 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -2832,6 +2832,90 @@ static int basicUnitTests(U32 const seed, double compressibility) } DISPLAYLEVEL(3, "OK \n"); + DISPLAYLEVEL(3, "test%3i : ZSTD_fast attach dicti...
{"cltools/zstdgrep.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/verbose-wlog.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/levels.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/multi-threaded.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "file-stat/comp...
null
null
null
{"cltools/zstdgrep.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/verbose-wlog.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/levels.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/multi-threaded.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "file-stat/comp...
{"passed_count": 37, "failed_count": 0, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "file-stat/compress-stdin-to-file.sh", "file-stat/decompress-file-to-file.sh", "compression/adapt.sh", "compression/stream-size.sh"...
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 37, "failed_count": 0, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "file-stat/compress-stdin-to-file.sh", "file-stat/decompress-file-to-file.sh", "compression/adapt.sh", "compression/stream-size.sh"...
facebook__zstd_3438
facebook
zstd
3,362
closed
check potential overflow of compressBound()
fixed #3323, reported by @nigeltao Completed documentation around overflow risk (Note : This scenario probably can't happen in a "valid" situation where `srcSize` is the real size of a really allocated and used buffer, but a bogus `srcSize` value could indeed trigger it).
{"label": "facebook:dev", "ref": "dev", "sha": "58508398f4121f2a84092ac771db0f2b0fbb3b1a"}
[ { "body": "The `size_t ZSTD_compressBound(size_t srcSize)` function is equivalent to the `ZSTD_COMPRESSBOUND` macro and it can silently overflow, as seen by compiling this program with `gcc -m32`:\r\n\r\n```\r\n#include <stdint.h>\r\n#include <stdio.h>\r\n\r\n#define ZSTD_COMPRESSBOUND(srcSize) \\\r\n ((srcSiz...
diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 0069a7b1bee..1eb8c99cfa3 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -59,14 +59,17 @@ * Helper functions ***************************************/ /* ZSTD_compressBound() - * Note that the result from t...
diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 879e537bc90..e15cf0648e7 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -82,8 +82,8 @@ static UTIL_time_t g_displayClock = UTIL_TIME_INITIALIZER; void FUZ_bug976(void); void FUZ_bug976(void) { /* these constants shall not depend on MIN() macro */ - assert(...
{"compression/window-resize.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "cltools/zstdgrep.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "basic/version.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "basic/output_dir.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/verbose-wlog.sh"...
null
null
null
{"compression/window-resize.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "cltools/zstdgrep.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "basic/version.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "basic/output_dir.sh": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "compression/verbose-wlog.sh"...
{"passed_count": 29, "failed_count": 0, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "compression/adapt.sh", "compression/stream-size.sh", "dict-builder/no-inputs.sh", "dict-builder/empty-input.sh", "compression/form...
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 29, "failed_count": 0, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "compression/adapt.sh", "compression/stream-size.sh", "dict-builder/no-inputs.sh", "dict-builder/empty-input.sh", "compression/form...
facebook__zstd_3362
facebook
zstd
3,223
closed
Add explicit --pass-through flag and default to enabled for *cat
Fixes #3211. Adds the `--[no-]pass-through` flag which enables/disables pass-through mode. * `zstdcat`, `zcat`, and `gzcat` default to `--pass-through`. Pass-through mode can be disabled by passing `--no-pass-through`. * All other binaries default to not setting pass-through mode. However, we preserve the ...
{"label": "facebook:dev", "ref": "dev", "sha": "d0dcc9d775789af73f44accb318579465ccdada4"}
[ { "body": "**Describe the bug**\r\nPassthrough behavior found in zstdcat does not persist when an output file is specified. \r\n\r\n**To Reproduce**\r\n```fish\r\necho hello > hello\r\nzstdcat hello\r\nzstdcat hello -o file\r\nzstd -dcf hello -o file\r\n```\r\n\r\n```\r\nhello\r\nzstd: hello: unsupported format...
diff --git a/programs/fileio.c b/programs/fileio.c index 16518131450..96cf602a300 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -290,6 +290,7 @@ FIO_prefs_t* FIO_createPreferences(void) ret->excludeCompressedFiles = 0; ret->allowBlockDevices = 0; ret->asyncIO = AIO_supported(); + ret->pass...
diff --git a/tests/cli-tests/decompression/pass-through.sh b/tests/cli-tests/decompression/pass-through.sh new file mode 100755 index 00000000000..2cab463f840 --- /dev/null +++ b/tests/cli-tests/decompression/pass-through.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +set -e + +. "$COMMON/platform.sh" + +echo "" > 1 +echo "2" > 2 +...
{"decompression/pass-through.sh": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
{"cltools/zstdgrep.sh": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "basic/version.sh": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "basic/output_dir.sh": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "compression/verbose-wlog.sh": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "compression/levels.sh": {"run...
{"decompression/pass-through.sh": {"run": "NONE", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 24, "failed_count": 0, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "compression/adapt.sh", "compression/stream-size.sh", "dict-builder/no-inputs.sh", "dict-builder/empty-input.sh", "compression/form...
{"passed_count": 24, "failed_count": 4, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "compression/adapt.sh", "compression/stream-size.sh", "dict-builder/no-inputs.sh", "dict-builder/empty-input.sh", "compression/form...
{"passed_count": 25, "failed_count": 0, "skipped_count": 0, "passed_tests": ["cltools/zstdgrep.sh", "compression/verbose-wlog.sh", "compression/levels.sh", "compression/multi-threaded.sh", "compression/adapt.sh", "compression/stream-size.sh", "dict-builder/no-inputs.sh", "dict-builder/empty-input.sh", "compression/form...
facebook__zstd_3223
facebook
zstd
2,451
closed
Don't shrink window log when streaming with a dictionary
Fixes #2442. 1. When creating a dictionary keep the same behavior as before. Assume the source size is 513 bytes when adjusting parameters. 2. When calling ZSTD_getCParams() or ZSTD_adjustCParams() use the same logic as case 4 (not attaching a dictionary). 3. When attaching a dictionary keep the same behav...
{"label": "facebook:dev", "ref": "dev", "sha": "e8560525763fc2cc87943e7437573db960141be4"}
[ { "body": "When using the streaming compression API using a dictionary, there were two regressions between 1.4.5 and 1.4.7 that make dictionary compression unusable at least for my use case:\r\n\r\nA 120kB file compressed with a 20kB dictionary gives the following sizes (all at level 19):\r\n\r\n* 1.4.5 without...
diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 3cebbe17336..9e704a4b20f 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -1188,15 +1188,26 @@ ZSTD_adjustCParams_internal(ZSTD_compressionParameters cPar, const U64 maxWindowResize = 1ULL << (ZSTD_WINDOWL...
diff --git a/tests/fuzzer.c b/tests/fuzzer.c index c22871878fd..7e3b4628ec2 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -3051,6 +3051,32 @@ static int basicUnitTests(U32 const seed, double compressibility) free(dict); } DISPLAYLEVEL(3, "OK \n"); + + DISPLAYLEVEL(3, "test%3i : ZSTD_getCPara...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_2451
facebook
zstd
2,130
closed
Fix for initStatic
Fix #2107 Ensure no context downsizing is happening if context is initialized with `ZSTD_initStatic*()`. Updated tests to control tighter memory scenarios.
{"label": "facebook:dev", "ref": "dev", "sha": "e7d2391e9a75154657183b049b69a7a2effa9724"}
[ { "body": "This is more of a query than an issue. I am trying to use ZSTD_compressCCtx() to be more memory efficient. I am allocating the context and initializing it as a static context per-cpu basis. At the time of write IO, I am using ZSTD_compressCCtx() and passing the per-cpu zstd-context. After sometime, I...
diff --git a/lib/common/error_private.h b/lib/common/error_private.h index ced1a3ba978..982cf8e9fe6 100644 --- a/lib/common/error_private.h +++ b/lib/common/error_private.h @@ -49,7 +49,7 @@ typedef ZSTD_ErrorCode ERR_enum; /*-**************************************** * Error codes handling *************************...
diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 1983ae1421d..9b01bc9449e 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -35,19 +35,19 @@ #include "zstdmt_compress.h" #define ZDICT_STATIC_LINKING_ONLY #include "zdict.h" /* ZDICT_trainFromBuffer */ -#include "datagen.h" /* RDG_genBuffer */ #includ...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_2130
facebook
zstd
2,094
closed
[lib] Add ZSTD_d_stableOutBuffer + fix single-pass mode for empty frames
This flag allows users to skip the output buffer allocation + memcpy if they guarantee that the `ZSTD_outBuffer*` passed to `ZSTD_decompressStream()` is large enough to fit the entire frame, and is never modified by the user. Also fixes a bug where empty frames weren't eligible for single-pass mode. It caused a smal...
{"label": "facebook:dev", "ref": "dev", "sha": "6b4a3e019f8eeb3423065f7b24d790358e8cbc59"}
[ { "body": "Main questions:\r\n- Does decompression require referencing previously used input data?\r\n- If it does not reference previous input data, is a working buffer (other than the destination) required when writing to a fully allocated output buffer, aka non-streaming mode?\r\n- If no additional working b...
diff --git a/lib/common/error_private.c b/lib/common/error_private.c index 39205844091..cd437529c12 100644 --- a/lib/common/error_private.c +++ b/lib/common/error_private.c @@ -47,6 +47,7 @@ const char* ERR_getErrorString(ERR_enum code) /* following error codes are not stable and may be removed or changed in a...
diff --git a/tests/fuzz/stream_decompress.c b/tests/fuzz/stream_decompress.c index df3b009aee8..503d32d6614 100644 --- a/tests/fuzz/stream_decompress.c +++ b/tests/fuzz/stream_decompress.c @@ -70,6 +70,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) * buffers in a row. */ int prevInWasZero =...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_2094
facebook
zstd
1,837
closed
Fix ZSTD_f_zstd1_magicless for small data
* Fix `ZSTD_FRAMEHEADERSIZE_PREFIX` and `ZSTD_FRAMEHEADERSIZE_MIN` to take a `format` parameter, so it is impossible to get the wrong size. * Fix the places that called `ZSTD_FRAMEHEADERSIZE_PREFIX` without taking the format into account, which is now impossible by design. * Call `ZSTD_frameHeaderSize_internal(...
{"label": "facebook:dev", "ref": "dev", "sha": "919d1d8e93809327687ec34502cf4cf50573598e"}
[ { "body": "The frameHeaderSize calculation ignores the context's format and results in the wrong size. Change the `ZSTD_frameHeaderSize` call to use `ZSTD_frameHeaderSize_internal` and pass in the dctx->format parameter.\r\n\r\nhttps://github.com/facebook/zstd/blob/ad2a2785f7cf470ebe458e015671e6e8e1f010d2/lib/d...
diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index 751060b2cd1..ca47a6678b5 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -88,10 +88,7 @@ size_t ZSTD_estimateDCtxSize(void) { return sizeof(ZSTD_DCtx); } static size_t ZSTD_startingInputLeng...
diff --git a/tests/fullbench.c b/tests/fullbench.c index f750ee0d78f..0e2761e111f 100644 --- a/tests/fullbench.c +++ b/tests/fullbench.c @@ -450,7 +450,7 @@ static int benchMem(unsigned benchNb, case 31: /* ZSTD_decodeLiteralsBlock : starts literals block in dstBuff2 */ { size_t frameHeaderSize; ...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_1837
facebook
zstd
1,733
closed
Add --size-hint=# option
Certain streaming situations can result in significantly different compression ratios between a file and stdin (streaming the same file). This is mainly an issue for smaller source sizes, where the default compression parameters are not appropriate. This diff adds an experimental --size-hint option, which allows the...
{"label": "facebook:dev", "ref": "dev", "sha": "a505463710aa34bccafd268c44064c129cdfb3e2"}
[ { "body": "The compression ratio for stdin can be worse than for the corresponding file, e.g.\r\n\r\n > cat j000 | zstd -14 -f -o a\r\n /*stdin*\\ : 16.54% ( 75885 => 12549 bytes, a)\r\n > zstd -14 j000\r\n j000 : 15.51% ( 75885 => 11767 bytes, j000.zst)\r\n\r\nIs th...
diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index b4ae4e8778f..8308bf5d13a 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -392,6 +392,11 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param) bounds.upperBound = ZSTD_TARGETCBLOCKSIZE_MAX; ...
diff --git a/tests/fuzz/zstd_helpers.c b/tests/fuzz/zstd_helpers.c index 9dff2895a9c..5ff057b8cdc 100644 --- a/tests/fuzz/zstd_helpers.c +++ b/tests/fuzz/zstd_helpers.c @@ -90,6 +90,9 @@ void FUZZ_setRandomParameters(ZSTD_CCtx *cctx, size_t srcSize, uint32_t *state) setRand(cctx, ZSTD_c_forceMaxWindow, 0, 1, state...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_1733
facebook
zstd
1,726
closed
Add --stream-size=# option
Certain streaming situations can result in significantly different compression ratios between a file and stdin (streaming the same file). This is mainly an issue for smaller source sizes, where the default compression parameters are not appropriate. This diff adds a `--stream-size` option, which allows the user to s...
{"label": "facebook:dev", "ref": "dev", "sha": "c9072ee674c9a928281286022f4d9393b0d113ec"}
[ { "body": "The compression ratio for stdin can be worse than for the corresponding file, e.g.\r\n\r\n > cat j000 | zstd -14 -f -o a\r\n /*stdin*\\ : 16.54% ( 75885 => 12549 bytes, a)\r\n > zstd -14 j000\r\n j000 : 15.51% ( 75885 => 11767 bytes, j000.zst)\r\n\r\nIs th...
diff --git a/programs/fileio.c b/programs/fileio.c index 569a410c1a2..873013a514a 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -304,6 +304,7 @@ struct FIO_prefs_s { int ldmMinMatch; int ldmBucketSizeLog; int ldmHashRateLog; + size_t streamSrcSize; size_t targetCBlockSize; ZSTD_l...
diff --git a/tests/playTests.sh b/tests/playTests.sh index 69387321f92..b740767632e 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -108,7 +108,6 @@ else fi - println "\n===> simple tests " ./datagen > tmp @@ -409,6 +408,23 @@ println "compress multiple files including a missing one (notHere) : " ...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_1726
facebook
zstd
1,540
closed
Fix zero variadic macro arguments
Fix the `RETURN_ERROR` macro and friends to have a `RETURN_ERROR_MSG` macro to avoid empty `__VA_ARGS__`. We can't enable the flag to detect this, since it is gcc only. We can't enable `-pedantic` right now because it is too noisy. It would take quite some work to enable, and we'd have to disable certain parts, so t...
{"label": "facebook:dev", "ref": "dev", "sha": "be3bd70c57a23383401f8a883cdecaca1d10a4d7"}
[ { "body": "When compiling with `-Wall -pedantic`\r\n\r\n> warning: ISO C99 requires at least one argument for the \"...\" in a variadic macro\r\n> RETURN_ERROR_IF(!cctxParams, GENERIC);\r\n\r\n> warning: ISO C99 requires at least one argument for the \"...\" in a variadic macro\r\n> RETURN_ERROR_IF(!...
diff --git a/lib/common/zstd_internal.h b/lib/common/zstd_internal.h index c4e2647a24f..96a1c64b521 100644 --- a/lib/common/zstd_internal.h +++ b/lib/common/zstd_internal.h @@ -61,33 +61,37 @@ extern "C" { * (particularly, printing the conditional that failed), this can't just wrap * RETURN_ERROR(). */ -#define R...
diff --git a/tests/decodecorpus.c b/tests/decodecorpus.c index b03dc55eabf..21eaf9d0917 100644 --- a/tests/decodecorpus.c +++ b/tests/decodecorpus.c @@ -938,7 +938,7 @@ static size_t writeSequences(U32* seed, frame_t* frame, seqStore_t* seqStorePtr, FSE_CState_t stateOffsetBits; FSE_CState_t stateLi...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_1540
facebook
zstd
1,532
closed
[libzstd] Rename ZSTD_CCtxParam_* to ZSTD_CCtxParams_*
* Renames functions to `ZSTD_CCtxParams_*`. * The CI will test that everything still builds, and that I didn't miss a call-site. * I've left the `ZSTDMT_` functions alone, since they are only here for compatibility, so it would be silly to rename them. Side question, when do we want to deprecate/delete these? Fixe...
{"label": "facebook:dev", "ref": "dev", "sha": "eb3a7a38270dc2a1f533c1b347f8b9b56e789f8f"}
[ { "body": "We have functions prefixed with `ZSTD_CCtxParams_` and `ZSTD_CCtxParam_`, we should make this consistent.", "number": 1529, "title": "ZSTD_CCtxParams functions" } ]
diff --git a/CHANGELOG b/CHANGELOG index 2a394227833..0c09b4ad363 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +dev +api : Rename ZSTD_CCtxParam_getParameter to ZSTD_CCtxParams_getParameter +api : Rename ZSTD_CCtxParam_setParameter to ZSTD_CCtxParams_setParameter + v1.3.8 perf: better decompression speed on...
diff --git a/tests/fuzzer.c b/tests/fuzzer.c index e9da862b2c6..9aed11e3835 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -849,22 +849,22 @@ static int basicUnitTests(U32 seed, double compressibility) { ZSTD_CCtx_params* params = ZSTD_createCCtxParams(); int value; /* Check that the overl...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_1532
facebook
zstd
1,530
closed
Clean up parameter code
* Move all ZSTDMT parameter setting code to ZSTD_CCtxParams_*Parameter(). ZSTDMT now calls these functions, so we can keep all the logic in the same place. * Make setting `ZSTD_c_nbWorkers` not clear overlap log / job size. * Clean up `ZSTD_CCtx_setParameter()` to only add extra checks where needed. * Clean up...
{"label": "facebook:dev", "ref": "dev", "sha": "54e9412ddd02ca4c6663d09dbf44f5a209a9a7ce"}
[ { "body": "When porting python-zstandard to use `ZSTD_CCtxParam_getParameter()`, I inadvertently changed the order in which `ZSTD_CCtxParam_setParameter()` was being called such that `ZSTD_c_nbWorkers` was being set after `ZSTD_c_overlapLog` (instead of before).\r\n\r\nTo my surprise, tests for the retrieval of...
diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 9ea7f04efb4..1429b84f97b 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -385,6 +385,18 @@ static int ZSTD_cParam_withinBounds(ZSTD_cParameter cParam, int value) return 1; } +/* ZSTD_cParam_clampBounds...
diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 946844e1614..e9da862b2c6 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -124,12 +124,14 @@ static U32 FUZ_highbit32(U32 v32) #define CHECK(fn) { CHECK_V(err, fn); } #define CHECKPLUS(var, fn, more) { CHECK_V(var, fn); more; } -#define CHECK_EQ(lhs, rhs) { ...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_1530
facebook
zstd
1,459
closed
[zstdcli] Refuse to overwrite input file
Compare the input and output files by their inode number and refuse to open the output file if the input file is the same. This doesn't work when (de)compressing multiple files to a single file, but that is a very uncommon use case, mostly used for benchmarking by me. Fixes #1422.
{"label": "facebook:dev", "ref": "dev", "sha": "d0e15f8d327f72f891d4cae80850e3303f31ddb5"}
[ { "body": "Running ***zstd filename -o filename*** deletes the contents of the file before erroring. Because compressed files are normally saved with a format specific extension, I see no reason to support this kind of operation. To prevent inadvertent data loss, the CLI should error before the file contents a...
diff --git a/programs/fileio.c b/programs/fileio.c index 5016294f811..9ba8c63708c 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -404,7 +404,7 @@ static FILE* FIO_openSrcFile(const char* srcFileName) /** FIO_openDstFile() : * condition : `dstFileName` must be non-NULL. * @result : FILE* to `dstFileName...
diff --git a/tests/playTests.sh b/tests/playTests.sh index 7758f46e938..b861391eb8e 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -183,6 +183,9 @@ $ECHO "test: --no-progress flag" $ZSTD tmpro -c --no-progress | $ZSTD -d -o "$INTOVOID" --no-progress $ZSTD tmpro -cv --no-progress | $ZSTD -dv -o "$INTOVOID...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_1459
facebook
zstd
1,458
closed
[libzstd] Fix estimate with negative levels
* Fix `ZSTD_estimateCCtxSize()` with negative levels. * Fix `ZSTD_estimateCStreamSize()` with negative levels. * Add a unit test to test for this error. Fixes #1424
{"label": "facebook:dev", "ref": "dev", "sha": "517d8c984ce9b30792fe5b6c8c79547d3748f34d"}
[ { "body": "[Today, the result is initialized to zero, and the routine enumerates levels from 1 up to the supplied level](https://github.com/facebook/zstd/blob/f15f1bfefb218a29f777493302be892a89dfe1be/lib/compress/zstd_compress.c#L895). However, negative levels are less than one, so the return value is always z...
diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index c41a1b07f22..7ab0485ecad 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -1013,7 +1013,7 @@ size_t ZSTD_estimateCCtxSize(int compressionLevel) { int level; size_t memBudget = 0; - for (level=1; l...
diff --git a/tests/fuzzer.c b/tests/fuzzer.c index ba7c0bc5af0..d150267f6b4 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -694,6 +694,17 @@ static int basicUnitTests(U32 seed, double compressibility) free(staticDCtxBuffer); } + DISPLAYLEVEL(3, "test%3i : Static negative levels : ", testNb++); +...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_1458
facebook
zstd
1,416
closed
Add rsyncable mode
- Factor out LDM's hash function for reuse - Add rsyncable mode to zstdmt and expose it via the advanced API - Fix `-B`/`--block-size` to actually set the job size - Add rsyncable tests to `zstreamtest` and `playTests.sh` Tested by: ``` > cat A.100MB B.100MB C.100MB D.100MB E.100MB | zstd --rsyncable -fo src/...
{"label": "facebook:dev", "ref": "dev", "sha": "c584e84e68109e6722e32cf0157a2c3706ca8f0d"}
[ { "body": "We're considering adding the `--rsyncable` option to zstd, but we want to make sure that we're not solving a problem that no one has. We imagine it being useful for multi-gigabyte backups with chunks of a few MB. Does anyone want this features, and if so what is your use case?", "number": 1155, ...
diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index c6d72f584bc..99a00701d9c 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -254,6 +254,7 @@ static int ZSTD_isUpdateAuthorized(ZSTD_cParameter param) case ZSTD_p_nbWorkers: case ZSTD_p_jobSize: ca...
diff --git a/tests/playTests.sh b/tests/playTests.sh index f35f5fee6ef..99609a5ea01 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -836,6 +836,12 @@ $ECHO "===> test: --adapt must fail on incoherent bounds " ./datagen > tmp $ZSTD -f -vv --adapt=min=10,max=9 tmp && die "--adapt must fail on incoherent b...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_1416
facebook
zstd
1,390
closed
support decompressing an empty frame into NULL
fix #1385 : decompressing into `NULL` is an automatic error in `v1.3.7`. This patch now allows it, as long as the content of the frame is empty. This behavior seems to simplify things a bit for `arrow`. Not sure if any other project may rely on this behavior...
{"label": "facebook:dev", "ref": "dev", "sha": "e26126cacaa9ac6f1db4021ac3d32f4ac8387c50"}
[ { "body": "I'm maintaining an arrow-cpp (https://github.com/apache/arrow) package in nixpkgs. arrow-cpp can use zstd as one of the compression backends. Since we made an upgrade for zstd from 1.3.5 to 1.3.6 one of the tests in arrow-cpp started to fail. After some debugging I found that the source of failure is...
diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index 54b9bf70d4d..7f721e20bab 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -404,9 +404,9 @@ unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize) } /** ZSTD_getDecompr...
diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 5616285b9ed..d17140392dd 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -411,11 +411,55 @@ static int basicUnitTests(U32 seed, double compressibility) DISPLAYLEVEL(3, "OK \n"); DISPLAYLEVEL(3, "test%3d : check CCtx size after compressing empty input : ...
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
{"all tests": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
null
null
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 1, "skipped_count": 0, "passed_tests": [], "failed_tests": ["all tests"], "skipped_tests": []}
{"passed_count": 1, "failed_count": 0, "skipped_count": 0, "passed_tests": ["all tests"], "failed_tests": [], "skipped_tests": []}
facebook__zstd_1390