Skip to content

Commit cd4c708

Browse files
committed
Merge pull request purescript#2131 from purescript/name-resolving
Name resolving
2 parents 57e9201 + 66c1f74 commit cd4c708

File tree

127 files changed

+349
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+349
-255
lines changed

core-tests/tests/generic-deriving/Main.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ module GenericDeriving where
22

33
import Prelude
44

5-
import Control.Monad.Eff (Eff())
6-
import Control.Monad.Eff.Console (CONSOLE())
5+
import Control.Monad.Eff (Eff)
6+
import Control.Monad.Eff.Console (CONSOLE, log)
77
import Data.Generic
88

99
data Void
1010

1111
derive instance genericVoid :: Generic Void
1212

13-
data A a
13+
data A a
1414
= A Number String
1515
| B Int
16-
| C (Array (A a))
16+
| C (Array (A a))
1717
| D { "asgård" :: a }
1818
| E Void
1919

@@ -24,4 +24,4 @@ newtype X b = X b
2424
derive instance genericX :: Generic (X String)
2525

2626
main :: forall eff. Eff (console :: CONSOLE | eff) Unit
27-
main = Control.Monad.Eff.Console.log (gShow (D { "asgård": C [ A 1.0 "test", B 42, D { "asgård": true } ] }))
27+
main = log (gShow (D { "asgård": C [ A 1.0 "test", B 42, D { "asgård": true } ] }))

examples/failing/ExportExplicit1.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
module Main where
33

44
import M1
5+
import Control.Monad.Eff.Console (log)
56

67
testX = X
78

89
-- should fail as Y constructor is not exported from M1
910
testY = Y
1011

11-
main = Control.Monad.Eff.Console.log "Done"
12+
main = log "Done"
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
-- @shouldFailWith UnknownName
22
module Main where
33

4-
import M1
4+
import M1 as M
5+
import Control.Monad.Eff.Console (log)
56

67
-- should fail as Z is not exported from M1
7-
testZ = M1.Z
8+
testZ = M.Z
89

9-
main = Control.Monad.Eff.Console.log "Done"
10+
main = log "Done"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
-- @shouldFailWith KindsDoNotUnify
22
module Main where
33

4-
import Prelude
4+
import Control.Monad.Eff.Console (log)
55

66
data Foo = Bar
77
type Baz = { | Foo }
88

9-
main = Control.Monad.Eff.Console.log "Done"
9+
main = log "Done"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
-- @shouldFailWith KindsDoNotUnify
22
module Main where
33

4-
import Prelude
4+
import Control.Monad.Eff.Console (log)
55

66
type Foo r = (x :: Number | r)
77
type Bar = { | Foo }
88

9-
main = Control.Monad.Eff.Console.log "Done"
9+
main = log "Done"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
-- @shouldFailWith KindsDoNotUnify
22
module Main where
33

4-
import Prelude
4+
import Control.Monad.Eff.Console (log)
55

66
type Foo = { x :: Number }
77
type Bar = { | Foo }
88

9-
main = Control.Monad.Eff.Console.log "Done"
9+
main = log "Done"

examples/failing/TypedBinders.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
-- @shouldFailWith ErrorParsingModule
1+
-- @shouldFailWith ErrorParsingModule
22
module Main where
33

4-
import Prelude
4+
import Control.Monad.Eff.Console (log)
55

66
test = (\f :: Int -> Int -> f 10) id
77

88
main = do
99
let t1 = test
10-
Control.Monad.Eff.Console.log "Done"
10+
log "Done"

examples/failing/TypedBinders2.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
module Main where
33

44
import Prelude
5+
import Control.Monad.Eff.Console (log)
56

67
main = do
7-
s :: String <- Control.Monad.Eff.Console.log "Foo"
8-
Control.Monad.Eff.Console.log "Done"
9-
8+
s :: String <- log "Foo"
9+
log "Done"

examples/failing/TypedBinders3.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
module Main where
33

44
import Prelude
5+
import Control.Monad.Eff.Console (log)
56

67
test = case 1 of
78
(0 :: String) -> true
89
_ -> false
910

1011
main = do
1112
let t = test
12-
Control.Monad.Eff.Console.log "Done"
13+
log "Done"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- @shouldFailWith ErrorParsingModule
22
module Bad_Module where
33

4-
import Prelude
4+
import Control.Monad.Eff.Console (log)
55

6-
main = Control.Monad.Eff.Console.log "Done"
6+
main = log "Done"

0 commit comments

Comments
 (0)