Jump to content

Spec# Problem

- - - - -

  • Please log in to reply
2 replies to this topic

#1
keithodulaigh

keithodulaigh

    Newbie

  • Members
  • Pip
  • 2 posts
So for those who do not know, Spec# is a superset of C# that takes Code contracts to a new level.

My problem is that if I add an asertion to my code like this:

assert 6 == sum{int k in (1..3); k};

It says that assertion may fail...but I don't see how, 1 + 2 + 3 = 6 and always will be!

Anyone have any ideas?

Thanks,
Keith

#2
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
It says that it MAY fail, but does it?
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

#3
keithodulaigh

keithodulaigh

    Newbie

  • Members
  • Pip
  • 2 posts
No but the message should not appear. If I start taking the attitude that "oh I can ignore that message because I know better" then I may as well not be using design by contract...




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users