Giter VIP home page Giter VIP logo

Comments (4)

viper-admin avatar viper-admin commented on June 14, 2024

Bitbucket user Korbinian Breu commented on 2014-01-18 13:46

I just created a pull request that solves this issue - however, there may be more work to do, because apparently scopes are not built to be nested?

The following gives no error:

#!scala
method k(S:Seq[Ref]) {
    while(true) {
        var bla:Int
    }

    assume bla == 5
}

from silver.

viper-admin avatar viper-admin commented on June 14, 2024

@alexanderjsummers commented on 2014-01-20 13:11

Thanks for the fix - that's great!

We don't really have block scopes in SIL; the program that you wrote above is treated analogously to

#!scala

method k(S:Seq[Ref]) {
    var bla:Int
    while(true) {

    }

    assume bla == 5
}

In particular, if one "declares" a local variable with the same name in the two branches of an if-conditional (or in nested blocks), then an error is expected. This is a bit confusing, but we didn't want scopes built-in, and forcing all declarations to be at the start of the method body can be a bit annoying if the method gets large...

from silver.

viper-admin avatar viper-admin commented on June 14, 2024

@alexanderjsummers commented on 2014-01-22 13:16

Fixed in commit c206a59

from silver.

viper-admin avatar viper-admin commented on June 14, 2024

@alexanderjsummers on 2014-01-22 13:16:

  • changed state from new to resolved

from silver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.