Skip to content

Commit e8e5be3

Browse files
committed
Do not use invalid typespec syntax
1 parent 83676dd commit e8e5be3

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

lib/ecto/multi.ex

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ defmodule Ecto.Multi do
279279
Adds an insert operation to the multi.
280280
281281
The `name` must be unique from other statements in the multi.
282-
282+
283283
The remaining arguments and options are the same as in `c:Ecto.Repo.insert/2`.
284284
285285
## Example
@@ -299,7 +299,7 @@ defmodule Ecto.Multi do
299299
@spec insert(
300300
t,
301301
name,
302-
Changeset.t() | Ecto.Schema.t() | fun(Changeset.t() | Ecto.Schema.t()),
302+
Changeset.t() | Ecto.Schema.t() | (changes -> Changeset.t() | Ecto.Schema.t()),
303303
Keyword.t()
304304
) :: t
305305
def insert(multi, name, changeset_or_struct_or_fun, opts \\ [])
@@ -320,7 +320,7 @@ defmodule Ecto.Multi do
320320
Adds an update operation to the multi.
321321
322322
The `name` must be unique from other statements in the multi.
323-
323+
324324
The remaining arguments and options are the same as in `c:Ecto.Repo.update/2`.
325325
326326
## Example
@@ -339,7 +339,7 @@ defmodule Ecto.Multi do
339339
|> MyApp.Repo.transaction()
340340
341341
"""
342-
@spec update(t, name, Changeset.t() | fun(Changeset.t()), Keyword.t()) :: t
342+
@spec update(t, name, Changeset.t() | (changes -> Changeset.t()), Keyword.t()) :: t
343343
def update(multi, name, changeset_or_fun, opts \\ [])
344344

345345
def update(multi, name, %Changeset{} = changeset, opts) do
@@ -354,7 +354,7 @@ defmodule Ecto.Multi do
354354
Inserts or updates a changeset depending on whether the changeset was persisted or not.
355355
356356
The `name` must be unique from other statements in the multi.
357-
357+
358358
The remaining arguments and options are the same as in `c:Ecto.Repo.insert_or_update/2`.
359359
360360
## Example
@@ -374,7 +374,7 @@ defmodule Ecto.Multi do
374374
|> MyApp.Repo.transaction()
375375
376376
"""
377-
@spec insert_or_update(t, name, Changeset.t() | fun(Changeset.t()), Keyword.t()) :: t
377+
@spec insert_or_update(t, name, Changeset.t() | (changes -> Changeset.t()), Keyword.t()) :: t
378378
def insert_or_update(multi, name, changeset_or_fun, opts \\ [])
379379

380380
def insert_or_update(
@@ -425,7 +425,7 @@ defmodule Ecto.Multi do
425425
@spec delete(
426426
t,
427427
name,
428-
Changeset.t() | Ecto.Schema.t() | fun(Changeset.t() | Ecto.Schema.t()),
428+
Changeset.t() | Ecto.Schema.t() | (changes -> Changeset.t() | Ecto.Schema.t()),
429429
Keyword.t()
430430
) :: t
431431
def delete(multi, name, changeset_or_struct_fun, opts \\ [])
@@ -461,7 +461,7 @@ defmodule Ecto.Multi do
461461
@spec one(
462462
t,
463463
name,
464-
queryable :: Ecto.Queryable.t() | fun(Ecto.Queryable.t()),
464+
queryable :: Ecto.Queryable.t() | (changes -> Ecto.Queryable.t()),
465465
opts :: Keyword.t()
466466
) :: t
467467
def one(multi, name, queryable_or_fun, opts \\ [])
@@ -478,7 +478,7 @@ defmodule Ecto.Multi do
478478
Runs a query and stores all entries in the multi.
479479
480480
The `name` must be unique from other statements in the multi.
481-
481+
482482
The remaining arguments and options are the same as in `c:Ecto.Repo.all/2` does.
483483
484484
## Example
@@ -494,7 +494,7 @@ defmodule Ecto.Multi do
494494
@spec all(
495495
t,
496496
name,
497-
queryable :: Ecto.Queryable.t() | fun(Ecto.Queryable.t()),
497+
queryable :: Ecto.Queryable.t() | (changes -> Ecto.Queryable.t()),
498498
opts :: Keyword.t()
499499
) :: t
500500
def all(multi, name, queryable_or_fun, opts \\ [])
@@ -511,7 +511,7 @@ defmodule Ecto.Multi do
511511
Checks if there exists an entry matching the given query and stores a boolean in the multi.
512512
513513
The `name` must be unique from other statements in the multi.
514-
514+
515515
The remaining arguments and options are the same as in `c:Ecto.Repo.exists?/2`.
516516
517517
## Example
@@ -527,7 +527,7 @@ defmodule Ecto.Multi do
527527
@spec exists?(
528528
t,
529529
name,
530-
queryable :: Ecto.Queryable.t() | fun(Ecto.Queryable.t()),
530+
queryable :: Ecto.Queryable.t() | (changes -> Ecto.Queryable.t()),
531531
opts :: Keyword.t()
532532
) :: t
533533
def exists?(multi, name, queryable_or_fun, opts \\ [])
@@ -639,7 +639,7 @@ defmodule Ecto.Multi do
639639
name,
640640
schema_or_source,
641641
entries_or_query_or_fun ::
642-
[map | Keyword.t()] | fun([map | Keyword.t()]) | Ecto.Query.t(),
642+
[map | Keyword.t()] | (changes -> [map | Keyword.t()]) | Ecto.Query.t(),
643643
Keyword.t()
644644
) :: t
645645
def insert_all(multi, name, schema_or_source, entries_or_query_or_fun, opts \\ [])
@@ -681,7 +681,7 @@ defmodule Ecto.Multi do
681681
@spec update_all(
682682
t,
683683
name,
684-
Ecto.Queryable.t() | fun(Ecto.Queryable.t()),
684+
Ecto.Queryable.t() | (changes -> Ecto.Queryable.t()),
685685
Keyword.t(),
686686
Keyword.t()
687687
) :: t
@@ -723,7 +723,8 @@ defmodule Ecto.Multi do
723723
|> MyApp.Repo.transaction()
724724
725725
"""
726-
@spec delete_all(t, name, Ecto.Queryable.t() | fun(Ecto.Queryable.t()), Keyword.t()) :: t
726+
@spec delete_all(t, name, Ecto.Queryable.t() | (changes -> Ecto.Queryable.t()), Keyword.t()) ::
727+
t
727728
def delete_all(multi, name, queryable_or_fun, opts \\ [])
728729

729730
def delete_all(multi, name, fun, opts) when is_function(fun, 1) and is_list(opts) do

0 commit comments

Comments
 (0)