Skip to content

Commit

Permalink
Remove unsound IllegalStateExceptions in Narrow
Browse files Browse the repository at this point in the history
Summary: These `IllegalStateException`s are actually unsound in presence of `eqwalizer:dynamic/1`, because it can produce types `t` such that `t <: map()` but some children of `t` are not maps.

Reviewed By: ilya-klyuchnikov

Differential Revision: D62582334

fbshipit-source-id: fd119d239e88e6a41b3732c20e7db4b892747b5a
  • Loading branch information
VLanvin authored and facebook-github-bot committed Sep 13, 2024
1 parent 114a361 commit 7af66a2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class Narrow(pipelineContext: PipelineContext) {
case NoneType =>
NoneType
case _ =>
throw new IllegalStateException()
NoneType
}

def setAllFieldsOptional(mapT: Type, newValTy: Option[Type] = None): Type =
Expand All @@ -502,7 +502,7 @@ class Narrow(pipelineContext: PipelineContext) {
case NoneType =>
NoneType
case _ =>
throw new IllegalStateException()
NoneType
}

def getRecordField(recDecl: RecDeclTyped, recTy: Type, fieldName: String): Type = {
Expand Down

0 comments on commit 7af66a2

Please sign in to comment.