Skip to content

Wildcard is inferred for partial function #4268

@JordanMartinez

Description

@JordanMartinez

Description

See purescript/purescript-lists#203 (comment)

To Reproduce

module Main where

import Prelude

data List a = Nil | Cons a (List a)

last :: forall a. Partial => List a -> a
last (Cons a Nil) = a
last (Cons _ xs) = last xs

Compiling the above produces this warning:

[1/1 WildcardInferredType] src/Main.purs:10:1

  10  last :: forall a. Partial => List a -> a
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  Wildcard type definition has the inferred type
  
    a0
  
  in binding group last
  
  where a0 is a rigid type variable
          bound at (line 0, column 0 - line 0, column 0)

Expected behavior

The warning should not be produced.

PureScript version

This doesn't occur on v0.14.5 but does on v0.14.7.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions