Merge remote-tracking branch 'origin/topic/jsiwek/bit-1367'

Bit-1367 #close
This commit is contained in:
Johanna Amann 2015-04-11 10:56:31 -07:00
commit fe9ff46cc5
6 changed files with 64 additions and 3 deletions

View file

@ -18,4 +18,7 @@ error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.set-type-che
error in port and /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.set-type-checking/set-type-checking.bro, line 38: arithmetic mixed with non-arithmetic (port and 1002)
error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.set-type-checking/set-type-checking.bro, line 38 and port: type mismatch (1002 and port)
error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.set-type-checking/set-type-checking.bro, line 38: inconsistent type in set constructor (set(1002))
error in port and /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.set-type-checking/set-type-checking.bro, line 44: arithmetic mixed with non-arithmetic (port and 1003)
error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.set-type-checking/set-type-checking.bro, line 44 and port: type mismatch (1003 and port)
error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.set-type-checking/set-type-checking.bro, line 44: inconsistent type in set constructor (set(1003))
error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.set-type-checking/set-type-checking.bro, line 44: type clash in assignment (lea = set(1003))

View file

@ -43,3 +43,18 @@ event bro_init()
{
local lea: MySet = set(1003); # type clash
}
type MyRecord: record {
user: string;
host: string;
host_port: count &default=22;
path: string;
};
global set_of_records: set[MyRecord];
event bro_init()
{
# Set ctor w/ anonymous record ctor should coerce.
set_of_records = set([$user="testuser", $host="testhost", $path="testpath"]);
}