-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve diagnostic messages for errors in elaborating record projections
- Loading branch information
Showing
17 changed files
with
154 additions
and
85 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
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,6 @@ | ||
//~ exit-code = 1 | ||
|
||
let _ : Bool = {x=false}.y; | ||
let _ : Bool = {x=false}.x.y; | ||
|
||
{} |
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,19 @@ | ||
stdout = '' | ||
stderr = ''' | ||
error: no field named `y` in record | ||
┌─ tests/fail/elaboration/record-proj/field-not-found.fathom:3:16 | ||
│ | ||
3 │ let _ : Bool = {x=false}.y; | ||
│ ^^^^^^^^^ - unknown field | ||
│ │ | ||
│ expression of type `{ x : Bool }` | ||
error: tried to access field `y` of non-record expression | ||
┌─ tests/fail/elaboration/record-proj/field-not-found.fathom:4:16 | ||
│ | ||
4 │ let _ : Bool = {x=false}.x.y; | ||
│ ^^^^^^^^^^^ - field access | ||
│ │ | ||
│ expression of type `Bool` | ||
''' |
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,5 @@ | ||
//~ exit-code = 1 | ||
|
||
let _ : Bool = {}.foo; | ||
|
||
{} |
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,11 @@ | ||
stdout = '' | ||
stderr = ''' | ||
error: tried to access field `foo` of empty record | ||
┌─ tests/fail/elaboration/record-proj/head-is-unit.fathom:3:16 | ||
│ | ||
3 │ let _ : Bool = {}.foo; | ||
│ ^^ --- field access | ||
│ │ | ||
│ expression of type `()` | ||
''' |
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,6 @@ | ||
//~ exit-code = 1 | ||
|
||
let _ : Bool = Bool.foo; | ||
let _ : Bool = {x=false}.x.foo; | ||
|
||
{} |
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,19 @@ | ||
stdout = '' | ||
stderr = ''' | ||
error: tried to access field `foo` of non-record expression | ||
┌─ tests/fail/elaboration/record-proj/head-not-record.fathom:3:16 | ||
│ | ||
3 │ let _ : Bool = Bool.foo; | ||
│ ^^^^ --- field access | ||
│ │ | ||
│ expression of type `Type` | ||
error: tried to access field `foo` of non-record expression | ||
┌─ tests/fail/elaboration/record-proj/head-not-record.fathom:4:16 | ||
│ | ||
4 │ let _ : Bool = {x=false}.x.foo; | ||
│ ^^^^^^^^^^^ --- field access | ||
│ │ | ||
│ expression of type `Bool` | ||
''' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.