Closed TipluSebastian closed 2 years ago
7 is the magic number for the Roslyn compilator, it generates different code for switch statements and expressions when there are more than 7 options available. In that case, Roslyn introduced a new compiler-generated type of which NetArchTest was not aware of.
Hi,
we want to assert that a project only depends on certain assemblies. This check fails if we use a switch-expression in the project under test.
net-arch-switch-bug is a minimal example repository to show the unexpected behaviour of the test: We would expect the test to pass, but it fails.
It is odd, that the test passes if there are 7 or less statements inside the switch-expression (see
NotFailingLocalNameTranslator
).Thank you for this nice library.