静态检查器是否能够证明基于字符串的断言(包括trim,contains,...)? [英] Will the static checker ever be able to prove String based asserts (involving trim, contains, ...) ?

查看:106
本文介绍了静态检查器是否能够证明基于字符串的断言(包括trim,contains,...)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

静态检查器是否能够检查这些断言?

Hi,
Will the Static checker ever be able to check asserts like these ?

Imports System.Diagnostics.Contracts

Public Class Class1
    Sub test()
        Dim str As String
        str = "log.log"
        Contract.Assert(str.Contains("."))
        Contract.Assert(str.Length > 4)
        Contract.Assert(str.Trim.Length > 4)
    End Sub
End Class


这会产生以下警告:
Class1.vb(7,9):warning:contracts :断言未经证实
Class1.vb(9,9):警告:合同:断言未经证实的

This generates the following warnings:
Class1.vb(7,9): warning : contracts: assert unproven
Class1.vb(9,9): warning : contracts: assert unproven

推荐答案

嗨亚历山大,
我希望如此;-)这是我想在接下来的几个月/年里工作的事情之一。

Ciao,
f
Hi Alexander,
  I hope so ;-) This is one of the things I want to work in the next months/year.

Ciao,
f


这篇关于静态检查器是否能够证明基于字符串的断言(包括trim,contains,...)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆