viperproject / viperproject/silver
AdtPlugin java.lang.ClassCastException
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 100
- Forks
- 53
- Avg merge
- 8h 10m
- Merged PRs (30d)
- 2
Description
Hello! I found my way here through doing some research for Prusti and I noticed the ADT plugin got merged very recently :) This looks like a really great feature, thank you for adding it! I set my Viper IDE to nightly and took it for a spin. I managed to break something when adding a post-condition that mentions a returned ADT:
adt Test {
A()
B()
}
function test(): Test
ensures result.isA
{
A()
}
This results in the error:
Server: Issue of severity 1: [silicon] [exception] 1:1 The verification job #16 resulted in a terrible error:
java.util.concurrent.ExecutionException:
viper.server.core.ServerCrashException:
java.lang.ClassCastException:
class viper.silver.plugin.standard.adt.Adt cannot be cast to class viper.silver.ast.Domain
(viper.silver.plugin.standard.adt.Adt and viper.silver.ast.Domain are in unnamed module of loader 'app')
Everything seems to work for pre-conditions okay, as far as I can tell this error is only triggered by a post-condition that mentions an ADT result. I suspect this corner case was missed when translating from the Parser AST to the Viper AST.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure in the ADT plugin with the supplied Silver program, then trace translation from the Parser AST to the Viper AST for a post-condition mentioning result. Done means the example verifies without the Adt-to-Domain ClassCastException; compare with the working pre-condition case while investigating.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, scala
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100