Skip to content

Commit

Permalink
Do substitution correctly for generics when constructing types for ca…
Browse files Browse the repository at this point in the history
…ses of switch statements.
  • Loading branch information
mcoblenz committed Jan 24, 2020
1 parent 5e55ba1 commit 87a5f63
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/main/scala/edu/cmu/cs/obsidian/typecheck/Checker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2112,14 +2112,7 @@ class Checker(globalTable: SymbolTable, verbose: Boolean = false) {
}

def checkSwitchCase(sc: SwitchCase) : (Context, SwitchCase) = {
val newType: ObsidianType =
contractTable.state(sc.stateName) match {
case Some(stTable) =>
StateType(contractTable.contractType, stTable.name, NotRemoteReferenceType())
case None =>
logError(sc, StateUndefinedError(contractTable.name, sc.stateName))
ContractReferenceType(contractTable.contractType, Owned(), NotRemoteReferenceType())
}
val newType: ObsidianType = t.withTypeState(States(Set(sc.stateName)))

/* special case to allow types to change in the context if we match on a variable */
val startContext = e match {
Expand Down

0 comments on commit 87a5f63

Please sign in to comment.