Testing an assertion that something must not compile

前端 未结 5 959
有刺的猬
有刺的猬 2020-12-04 09:52

The problem

When I\'m working with libraries that support type-level programming, I often find myself writing comments like the following (from an example presente

5条回答
  •  我在风中等你
    2020-12-04 10:32

    The compileError macro in µTest does just that:

    compileError("true * false")
    // CompileError.Type("value * is not a member of Boolean")
    
    compileError("(}")
    // CompileError.Parse("')' expected but '}' found.")
    

提交回复
热议问题