mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge remote-tracking branch 'origin/topic/awelzel/3640-void-size-expr-assign-stmt'
* origin/topic/awelzel/3640-void-size-expr-assign-stmt: Expr: Handle TYPE_VOID in SizeExpr and AssignExpr::Typecheck()
This commit is contained in:
commit
2d1588277e
11 changed files with 79 additions and 3 deletions
2
testing/btest/Baseline/language.void-errors-2/output
Normal file
2
testing/btest/Baseline/language.void-errors-2/output
Normal file
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/void-errors.zeek, line 2: identifier not defined: void
|
2
testing/btest/Baseline/language.void-errors-3/output
Normal file
2
testing/btest/Baseline/language.void-errors-3/output
Normal file
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/void-errors.zeek, line 1: identifier not defined: void
|
2
testing/btest/Baseline/language.void-errors-4/output
Normal file
2
testing/btest/Baseline/language.void-errors-4/output
Normal file
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/void-errors.zeek, line 2: return statement cannot have an expression (return (a))
|
2
testing/btest/Baseline/language.void-errors-5/output
Normal file
2
testing/btest/Baseline/language.void-errors-5/output
Normal file
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/void-errors.zeek, line 4: cannot take size of void (sizeofx[3.4.5.6])
|
2
testing/btest/Baseline/language.void-errors-6/output
Normal file
2
testing/btest/Baseline/language.void-errors-6/output
Normal file
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/void-errors.zeek, line 2: can't assign void value (y = x[3])
|
4
testing/btest/Baseline/language.void-errors-7/output
Normal file
4
testing/btest/Baseline/language.void-errors-7/output
Normal file
|
@ -0,0 +1,4 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/void-errors.zeek, line 5: can't assign void value (z = x())
|
||||
error in <...>/void-errors.zeek, line 6: value of type void illegal (print x())
|
||||
error in <...>/void-errors.zeek, line 7: cannot take size of void (sizeofx())
|
2
testing/btest/Baseline/language.void-errors/output
Normal file
2
testing/btest/Baseline/language.void-errors/output
Normal file
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/void-errors.zeek, line 7: identifier not defined: void
|
43
testing/btest/language/void-errors.zeek
Normal file
43
testing/btest/language/void-errors.zeek
Normal file
|
@ -0,0 +1,43 @@
|
|||
# @TEST-DOC: Zeek does not have a script land void type, but internally it does exist (indexing a set, or a function returning no result). Regression test #3640.
|
||||
#
|
||||
# @TEST-EXEC-FAIL: zeek -b %INPUT >output 2>&1
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output
|
||||
|
||||
# identifier void not defined...
|
||||
global x: void = 1;
|
||||
|
||||
# @TEST-START-NEXT
|
||||
type R: record {
|
||||
x: void;
|
||||
};
|
||||
|
||||
|
||||
# @TEST-START-NEXT
|
||||
function x(): void {
|
||||
return "a";
|
||||
};
|
||||
|
||||
# @TEST-START-NEXT
|
||||
function x() {
|
||||
return "a";
|
||||
};
|
||||
|
||||
# @TEST-START-NEXT
|
||||
|
||||
global x = set(3.4.5.6, 9.8.7.6);
|
||||
print |x|;
|
||||
print |x[3.4.5.6]|;
|
||||
|
||||
# @TEST-START-NEXT
|
||||
local x = set(5, 3);
|
||||
local y: any = x[3];
|
||||
print y;
|
||||
|
||||
# @TEST-START-NEXT
|
||||
function x() {
|
||||
print "x()";
|
||||
}
|
||||
|
||||
global z: any = x();
|
||||
print x();
|
||||
print |x()|;
|
Loading…
Add table
Add a link
Reference in a new issue