Add test to make sure that ${null} isn't a target
This commit is contained in:
parent
8c86604ee6
commit
9414913286
|
@ -1061,7 +1061,11 @@ module Infer = struct
|
|||
|
||||
module Unexp = Make(Unexpanded.Uast)(S_unexp)(Outcome_unexp)(struct
|
||||
open Outcome_unexp
|
||||
let ( +@ ) acc fn = { acc with targets = fn :: acc.targets }
|
||||
let ( +@ ) acc fn =
|
||||
if SW.is_var fn ~name:"null" then
|
||||
acc
|
||||
else
|
||||
{ acc with targets = fn :: acc.targets }
|
||||
let ( +< ) acc _ = acc
|
||||
let ( +<! )= ( +< )
|
||||
end)
|
||||
|
|
|
@ -198,3 +198,8 @@ let to_string t =
|
|||
|> String.concat ~sep:""
|
||||
|
||||
let sexp_of_t t = Sexp.To_sexp.string (to_string t)
|
||||
|
||||
let is_var t ~name =
|
||||
match t.items with
|
||||
| [Var (_, v)] -> v = name
|
||||
| _ -> false
|
||||
|
|
|
@ -43,6 +43,8 @@ val iter : t -> f:(Loc.t -> string -> unit) -> unit
|
|||
(** [iter t ~f] iterates [f] over all variables of [t], the text
|
||||
portions being ignored. *)
|
||||
|
||||
val is_var : t -> name:string -> bool
|
||||
|
||||
module type EXPANSION = sig
|
||||
type t
|
||||
(** The value to which variables are expanded. *)
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
$ jbuilder runtest --debug-dependency-path
|
||||
File "jbuild", line 5, characters 26-33:
|
||||
Warning: Aliases must not have targets, this target will be ignored.
|
||||
This will become an error in the future.
|
||||
|
|
Loading…
Reference in New Issue