Skip to content

Commit

Permalink
Add type widening for ADT constructor lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
samarion committed Mar 13, 2018
1 parent 135d04b commit e701e01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/inox/ast/Expressions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ trait Expressions { self: Trees =>
sealed case class ADTSelector(adt: Expr, selector: Identifier) extends Expr with CachingTyped {

def constructor(implicit s: Symbols) = {
val tpe = adt.getType.asInstanceOf[ADTType]
val tpe = s.widen(adt.getType).asInstanceOf[ADTType]
tpe.getSort.constructors.find(_.fields.exists(_.id == selector)).get
}

Expand Down

0 comments on commit e701e01

Please sign in to comment.