compiler: Type Check All Binary Operators
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -318,17 +318,15 @@ import TreeSitterP4
|
||||
}
|
||||
};
|
||||
"""
|
||||
let program = try #UseOkResult(Program.Compile(simple_parser_declaration))
|
||||
let runtime = try #UseOkResult(
|
||||
P4Runtime.Runtime<InstantiatedParserState, P4Lang.Parser>.create(program: program))
|
||||
let (state_result, _) = try! #UseOkResult(runtime.run())
|
||||
|
||||
// TODO: This test should throw an error.
|
||||
#expect(
|
||||
#RequireErrorResult(
|
||||
Error(
|
||||
withMessage:
|
||||
"{49, 35}: Failed to parse a statement element: Types of values used with binary expression are not the same"
|
||||
),
|
||||
Program.Compile(simple_parser_declaration)))
|
||||
|
||||
// false == 5 == true
|
||||
// false == true
|
||||
// false
|
||||
#expect(AsInstantiatedParserState(state_result) == P4Lang.reject)
|
||||
}
|
||||
|
||||
@Test func test_expression_in_declaration_initializer_invalid_types2() async throws {
|
||||
|
||||
Reference in New Issue
Block a user