diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f76bd24..dc50908 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,11 +29,16 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] crystal_version: [latest] + experimental: [false] include: - os: ubuntu-latest crystal_version: 1.4.0 + experimental: false + - os: ubuntu-latest + crystal_version: nightly + experimental: true runs-on: ${{ matrix.os }} - continue-on-error: false + continue-on-error: ${{ matrix.experimental }} steps: - uses: actions/checkout@v3 - uses: crystal-lang/install-crystal@v1 diff --git a/src/habitat.cr b/src/habitat.cr index d6a8e8a..a80fcda 100644 --- a/src/habitat.cr +++ b/src/habitat.cr @@ -34,7 +34,7 @@ class Habitat {% for type in TYPES_WITH_HABITAT %} {% for setting in type.constant(:HABITAT_SETTINGS) %} {% if !setting[:decl].type.is_a?(Union) || - (setting[:decl].type.is_a?(Union) && !setting[:decl].type.types.map(&.id).includes?(Nil.id)) %} + (setting[:decl].type.is_a?(Union) && !setting[:decl].type.types.any?(&.names.includes?(Nil.id))) %} if {{ type }}.settings.{{ setting[:decl].var }}?.nil? raise MissingSettingError.new {{ type }}, setting_name: {{ setting[:decl].var.stringify }}, example: {{ setting[:example] }} end @@ -231,7 +231,7 @@ class Habitat # NOTE: We can't use the macro level `type.resolve.nilable?` here because # there's a few declaration types that don't respond to it which would make the logic # more complex. Metaclass, and Proc types are the main, but there may be more. - {% if decl.type.is_a?(Union) && decl.type.types.map(&.id).includes?(Nil.id) %} + {% if decl.type.is_a?(Union) && decl.type.types.any?(&.names.includes?(Nil.id)) %} {% nilable = true %} {% else %} {% nilable = false %}