From 73c3f0743f3b59a35a559f11df04c9d39cf86684 Mon Sep 17 00:00:00 2001 From: yunsong Date: Sat, 26 Dec 2020 09:08:57 -0500 Subject: [PATCH] Upgrade versions and add format check (#41) --- .github/workflows/ci.yml | 6 ++++-- lib/ex_type/typespec.ex | 2 ++ lib/ex_type/unification.ex | 3 ++- mix.exs | 6 +++--- mix.lock | 15 ++++++++------- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89087a9..9d301f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,14 +8,16 @@ jobs: runs-on: ubuntu-latest container: - image: elixir:1.9.1-slim + image: elixir:1.11 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Install Dependencies run: | mix local.rebar --force mix local.hex --force mix deps.get + - name: Check Format + run: mix format --check-formatted - name: Run Tests run: mix test diff --git a/lib/ex_type/typespec.ex b/lib/ex_type/typespec.ex index c41c95c..d61b5a5 100644 --- a/lib/ex_type/typespec.ex +++ b/lib/ex_type/typespec.ex @@ -632,6 +632,7 @@ defmodule ExType.Typespec do |> Enum.into(%{}) eval_type(type_body, {module, vars}) + {:error, message} -> Helper.inspect(%{ error: :eval_type, @@ -639,6 +640,7 @@ defmodule ExType.Typespec do context: context, message: message }) + Helper.throw(message: "Could not evaluate type") end end diff --git a/lib/ex_type/unification.ex b/lib/ex_type/unification.ex index a58d6de..9bcce95 100644 --- a/lib/ex_type/unification.ex +++ b/lib/ex_type/unification.ex @@ -304,7 +304,8 @@ defmodule ExType.Unification do Context.update_scope(context, var, %Type.Float{}) end - def unify_guard(context, {{:., _, [:erlang, op]}, _, [_, _]}) when op in [:>, :<, :>=, :"=<", :"=:="] do + def unify_guard(context, {{:., _, [:erlang, op]}, _, [_, _]}) + when op in [:>, :<, :>=, :"=<", :"=:="] do context end diff --git a/mix.exs b/mix.exs index 927420d..d7cc936 100644 --- a/mix.exs +++ b/mix.exs @@ -6,7 +6,7 @@ defmodule ExType.MixProject do app: :ex_type, version: "0.5.0", description: "A type checker for Elixir", - elixir: "~> 1.8", + elixir: "~> 1.11", elixirc_paths: elixirc_paths(), start_permanent: Mix.env() == :prod, package: package(), @@ -28,8 +28,8 @@ defmodule ExType.MixProject do defp deps do [ {:ex_type_runtime, "~> 0.2.0"}, - {:ex_doc, "~> 0.20.2", only: :dev, runtime: false}, - {:dialyxir, "~> 1.0.0-rc.6", only: [:dev], runtime: false} + {:ex_doc, "~> 0.23", only: :dev, runtime: false}, + {:dialyxir, "~> 1.0", only: :dev, runtime: false} ] end diff --git a/mix.lock b/mix.lock index a3b2b33..ff9f5d9 100644 --- a/mix.lock +++ b/mix.lock @@ -1,10 +1,11 @@ %{ - "dialyxir": {:hex, :dialyxir, "1.0.0-rc.6", "78e97d9c0ff1b5521dd68041193891aebebce52fc3b93463c0a6806874557d7d", [:mix], [{:erlex, "~> 0.2.1", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm"}, + "dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"}, "earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm"}, - "erlex": {:hex, :erlex, "0.2.1", "cee02918660807cbba9a7229cae9b42d1c6143b768c781fa6cee1eaf03ad860b", [:mix], [], "hexpm"}, - "ex_doc": {:hex, :ex_doc, "0.20.2", "1bd0dfb0304bade58beb77f20f21ee3558cc3c753743ae0ddbb0fd7ba2912331", [:mix], [{:earmark, "~> 1.3", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, - "ex_type_runtime": {:hex, :ex_type_runtime, "0.2.0", "bc9ac486d5f6a0109d8d2082a76bacd592e7100403e10c98fd6b79d23a290ebb", [:mix], [], "hexpm"}, - "makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.13.0", "be7a477997dcac2e48a9d695ec730b2d22418292675c75aa2d34ba0909dcdeda", [:mix], [{:makeup, "~> 0.8", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"}, - "nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"}, + "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, + "ex_doc": {:hex, :ex_doc, "0.23.0", "a069bc9b0bf8efe323ecde8c0d62afc13d308b1fa3d228b65bca5cf8703a529d", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "f5e2c4702468b2fd11b10d39416ddadd2fcdd173ba2a0285ebd92c39827a5a16"}, + "ex_type_runtime": {:hex, :ex_type_runtime, "0.2.0", "bc9ac486d5f6a0109d8d2082a76bacd592e7100403e10c98fd6b79d23a290ebb", [:mix], [], "hexpm", "172c592508c760789ca05995f88869c5bcb92d176f97f33998e6097c384e3303"}, + "makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.15.0", "98312c9f0d3730fde4049985a1105da5155bfe5c11e47bdc7406d88e01e4219b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "75ffa34ab1056b7e24844c90bfc62aaf6f3a37a15faa76b07bc5eba27e4a8b4a"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"}, }