Skip to content

Commit

Permalink
fixed some None.get errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Naum-Tomov committed Oct 12, 2023
1 parent e660054 commit c960e86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/rewrite/vct/rewrite/exc/EncodeBreakReturn.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case object EncodeBreakReturn extends RewriterBuilder {
PreferredName("break_" + label.o.getPreferredNameOrElse()),
ShortPosition("generated"),
Context("[At node generated to jump past a statement]"),
InlineContext("[After] " + label.o.getInlineContext.get.inlineContext),
InlineContext("[After] " + label.o.getInlineContext.getOrElse(InlineContext("[unknown label inline context")).inlineContext),
)
)

Expand Down
6 changes: 3 additions & 3 deletions src/rewrite/vct/rewrite/lang/LangJavaToCol.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.typesafe.scalalogging.LazyLogging
import hre.util.{FuncTools, ScopedStack}
import vct.col.ast._
import vct.col.rewrite.lang.LangSpecificToCol.{NotAValue, ThisVar}
import vct.col.origin.{AbstractApplicable, DerefPerm, JavaArrayInitializerBlame, Origin, PanicBlame, PostBlameSplit, TrueSatisfiable}
import vct.col.origin.{AbstractApplicable, Context, DerefPerm, JavaArrayInitializerBlame, Origin, PanicBlame, PostBlameSplit, TrueSatisfiable}
import vct.col.ref.{LazyRef, Ref}
import vct.col.resolve.ctx._
import vct.col.rewrite.{Generation, Rewritten}
Expand All @@ -20,12 +20,12 @@ import scala.collection.mutable
case object LangJavaToCol {
private def JavaFieldOrigin(fields: JavaFields[_], idx: Int): Origin = {
fields.decls(idx).o.replacePrefName(fields.decls(idx).name)
.replaceContext(fields.o.getContext.get.context)
.replaceContext(fields.o.getContext.getOrElse(Context("[unknown context]")).context)
}

private def JavaLocalOrigin(locals: JavaLocalDeclaration[_], idx: Int): Origin = {
locals.decls(idx).o.replacePrefName(locals.decls(idx).name)
.replaceContext(locals.o.getContext.get.context)
.replaceContext(locals.o.getContext.getOrElse(Context("[unknown context]")).context)
}

private def JavaConstructorOrigin(cons: JavaConstructor[_]): Origin = {
Expand Down

0 comments on commit c960e86

Please sign in to comment.