git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Handle TypeLevelString when checking orphans (#2393)
a8756f0Hardy Jones
examples/failing/2378.pursnew file+6
@@ -0,0 +1,6 @@
1+-- @shouldFailWith OrphanInstance
2+module Main where
3+
4+import Lib
5+
6+instance fooX :: Foo "x"
examples/failing/2378/Lib.pursnew file+3
@@ -0,0 +1,3 @@
1+module Lib (class Foo) where
2+
3+class Foo (a :: Symbol)
examples/passing/2378.pursnew file+9
@@ -0,0 +1,9 @@
1+module Main where
2+
3+import Control.Monad.Eff.Console (log)
4+
5+class Foo (a :: Symbol)
6+
7+instance fooX :: Foo "x"
8+
9+main = log "Done"
purescript.cabal+1
@@ -55,6 +55,7 @@ extra-source-files: examples/passing/*.purs
55 , examples/passing/TypeWithoutParens/*.purs
55 , examples/passing/TypeWithoutParens/*.purs
56 , examples/failing/*.purs
56 , examples/failing/*.purs
57 , examples/failing/1733/*.purs
57 , examples/failing/1733/*.purs
58+ , examples/failing/2378/*.purs
58 , examples/failing/ConflictingExports/*.purs
59 , examples/failing/ConflictingExports/*.purs
59 , examples/failing/ConflictingImports/*.purs
60 , examples/failing/ConflictingImports/*.purs
60 , examples/failing/ConflictingImports2/*.purs
61 , examples/failing/ConflictingImports2/*.purs
src/Language/PureScript/TypeChecker.hs+1
@@ -312,6 +312,7 @@ typeCheckAll moduleName _ = traverse go
312 where
312 where
313 checkType :: Type -> Bool
313 checkType :: Type -> Bool
314 checkType (TypeVar _) = False
314 checkType (TypeVar _) = False
315+ checkType (TypeLevelString _) = False
315 checkType (TypeConstructor (Qualified (Just mn'') _)) = moduleName == mn''
316 checkType (TypeConstructor (Qualified (Just mn'') _)) = moduleName == mn''
316 checkType (TypeConstructor (Qualified Nothing _)) = internalError "Unqualified type name in checkOrphanInstance"
317 checkType (TypeConstructor (Qualified Nothing _)) = internalError "Unqualified type name in checkOrphanInstance"
317 checkType (TypeApp t1 _) = checkType t1
318 checkType (TypeApp t1 _) = checkType t1