verified-network-toolchain / petr4

Petr4: Formal Semantics for P4
Apache License 2.0
74 stars 20 forks source link

Type check test fails on `cast_call` #333

Closed jnfoster closed 1 year ago

jnfoster commented 2 years ago

Running make test on the main branch halts with this bug:

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ [FAIL]        typecheck tests good            445   cast-call.p4.                                                                                        │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Testing file ../examples/checker_tests/good/cast-call.p4...
Unknown exception: ("illegal explicit cast"
  (old_type
    (Function
      ((type_params (T))
        (parameters
          (((annotations ()) (direction Directionless)
             (typ (TypeName (BareName ((M "") T))))
             (variable
               ((I (filename ../examples/checker_tests/good/cast-call.p4)
                  (line_start 21) (line_end ()) (col_start 16) (col_end 17))
                 x))
             (opt_value ()))))
        (kind Extern) (return (TypeName (BareName ((M "") T)))))))
  (new_type (Bit ((width 32)))))ASSERT good test
FAIL good test

   Expected: `true'
   Received: `false'

Raised at Alcotest_engine__Test.check in file "src/alcotest-engine/test.ml", line 196, characters 4-261
Called from Alcotest_engine__Core.Make.protect_test.(fun) in file "src/alcotest-engine/core.ml", line 180, characters 17-23
Called from Alcotest_engine__Monad.Identity.catch in file "src/alcotest-engine/monad.ml", line 24, characters 31-35

This looks like a regression...

hackedy commented 2 years ago

Not a regression, but an old bug (#69). The test case is excluded from make ci-test, maybe we should just make that the make test target?

hackedy commented 1 year ago

Closing as duplicate of #69