Skip to content

Commit

Permalink
remove repeated call to get_desc
Browse files Browse the repository at this point in the history
  • Loading branch information
garrigue committed May 31, 2021
1 parent c665e96 commit 9d866b5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions typing/ctype.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ let rec copy ?partial ?keep_names scope ty =
let copy = copy ?partial ?keep_names scope in
match get_desc ty with
Tsubst (ty, _) -> ty
| _ ->
| desc ->
let level = get_level ty in
if level <> generic_level && partial = None then ty else
(* We only forget types that are non generic and do not contain
Expand All @@ -1075,7 +1075,6 @@ let rec copy ?partial ?keep_names scope ty =
else generic_level
in
if forget <> generic_level then newty2 ~level:forget (Tvar None) else
let desc = get_desc ty in
let t = newstub ~scope:(get_scope ty) in
For_copy.redirect_desc scope ty (Tsubst (t, None));
let desc' =
Expand Down

0 comments on commit 9d866b5

Please sign in to comment.