Skip to content

Newtype constructor from another module makes type Coercible #4588

Description

@wclr

Description

Having in scope newtype with the same name (with constructor) from another module makes type Coercible.

To Reproduce

module A where
newtype T = T String
module B where
newtype T = T String
module M where

import A (T) as A
import B (T(..)) as B -- type T from B makes A.T Coersible
import Safe.Coerce (coerce)

fromAT :: A.T -> String
fromAT = coerce

Expected behavior

Should require the newtype constructor from A be in scope.

Additional context

Add any other context about the problem here.

PureScript version

0.15.15

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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