-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement named constructor * Fix llvm backend trying to use relative paths After #186 all module paths should be absolute, and as such it's not necessary to prefix them with ./
- Loading branch information
Showing
11 changed files
with
203 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
type T a b = | ||
x: a | ||
y: b | ||
|
||
x = 4 | ||
|
||
t1 = T with x = 3, z = 5 | ||
t2 = T with y = 3.2, x | ||
|
||
// Declarations should not leak from the named constructor | ||
z = y * 2.0 | ||
|
||
// args: --check | ||
// expected stderr: | ||
// named_constructor.an:7:6 error: Missing fields: y | ||
// t1 = T with x = 3, z = 5 | ||
// | ||
// named_constructor.an:7:20 error: z is not a struct field | ||
// t1 = T with x = 3, z = 5 | ||
// | ||
// named_constructor.an:11:5 error: No declaration for `y` was found in scope | ||
// z = y * 2.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
type Foo a b= | ||
x: a | ||
y: b | ||
|
||
x = "Hello World" | ||
|
||
hello_foo y = Foo with x, y | ||
|
||
foo = hello_foo 42 | ||
|
||
// args: --check --show-types | ||
// expected stdout: | ||
// Foo : (forall a b c. (a - b -> (Foo a b) can c)) | ||
// foo : (Foo String (Int a)) | ||
// hello_foo : (forall a b. (a -> (Foo String a) can b)) | ||
// x : String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters