Skip to content

Using an infix type alias in a type application crashes the compiler. #4535

@jterbraak

Description

@jterbraak

Description

Using an infix type alias like /\ for Tuple will crash the compiler with the following error message:

[1 of 6] Compiling Page.Processing.Variables
purs.bin: An internal error occurred during compilation: inferKind: Unimplemented case 
String Data.Tuple.Nested./\ Maybe String

Please report this at https://github.com/purescript/purescript/issues
CallStack (from HasCallStack):
  error, called at src\Language\PureScript\Crash.hs:10:3 in purescript-0.15.14-EV4SLMOi0BcgeHmFJC7Hq:Language.PureScript.Crash
  internalError, called at src\Language\PureScript\TypeChecker\Kinds.hs:242:7 in purescript-0.15.14-EV4SLMOi0BcgeHmFJC7Hq:Language.PureScript.TypeChecker.Kinds
  inferKind, called at src\Language\PureScript\TypeChecker\Kinds.hs:327:25 in purescript-0.15.14-EV4SLMOi0BcgeHmFJC7Hq:Language.PureScript.TypeChecker.Kinds
  checkKind', called at src\Language\PureScript\TypeChecker\Kinds.hs:303:13 in purescript-0.15.14-EV4SLMOi0BcgeHmFJC7Hq:Language.PureScript.TypeChecker.Kinds
  checkKind, called at src\Language\PureScript\TypeChecker\Types.hs:476:45 in purescript-0.15.14-EV4SLMOi0BcgeHmFJC7Hq:Language.PureScript.TypeChecker.Types

Using Tuple by itself works as expected.

To Reproduce

Try PS

module Main where

import Prelude

import Effect(Effect)
import Effect.Console(log)
import Data.Tuple.Nested(type(/\))

someVTA :: forall @a . String
someVTA =
  "some VTA"

main :: Effect Unit
main =
  log $ someVTA @( Int /\ Int )

Expected behavior

A successful compilation or a normal error/warning that this is not supported.

PureScript version

0.15.14 but the version on Try PS also has this bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions