This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
forked from Bluefire2/xic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Class can't inherit itself: typechecking error
- Loading branch information
1 parent
12c8623
commit db0d94d
Showing
17 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
class A { | ||
a: int | ||
ma() | ||
} | ||
|
||
fa() |
1 change: 1 addition & 0 deletions
1
tests/pa7-typecheck-tests/class_decl_defn_dont_match_error0.typedsol
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 @@ | ||
3:1 error:Different methods in declaration and definition of class A |
8 changes: 8 additions & 0 deletions
8
tests/pa7-typecheck-tests/class_decl_defn_dont_match_error0.xi
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,8 @@ | ||
use a | ||
|
||
// A defines an extra method | ||
class A { | ||
a: int | ||
ma() {} | ||
extra_method() {} | ||
} |
1 change: 1 addition & 0 deletions
1
tests/pa7-typecheck-tests/class_decl_defn_dont_match_error1.typedsol
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 @@ | ||
7:5 error:Function ma already defined |
8 changes: 8 additions & 0 deletions
8
tests/pa7-typecheck-tests/class_decl_defn_dont_match_error1.xi
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,8 @@ | ||
use a | ||
|
||
// A provides duplicate methods | ||
class A { | ||
a: int | ||
ma() {} | ||
ma() {} | ||
} |
1 change: 1 addition & 0 deletions
1
tests/pa7-typecheck-tests/class_decl_defn_dont_match_error2.typedsol
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:5 error:Mismatch signatures of overriden function with name ma |
7 changes: 7 additions & 0 deletions
7
tests/pa7-typecheck-tests/class_decl_defn_dont_match_error2.xi
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,7 @@ | ||
use a | ||
|
||
// A defines ma with a different signature than the declaration in module a | ||
class A { | ||
a: int | ||
ma(p: int) {} | ||
} |
1 change: 1 addition & 0 deletions
1
tests/pa7-typecheck-tests/class_decl_defn_dont_match_error3.typedsol
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 @@ | ||
7:1 error:Declaration and definition for class A don't inherit the same class |
10 changes: 10 additions & 0 deletions
10
tests/pa7-typecheck-tests/class_decl_defn_dont_match_error3.xi
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,10 @@ | ||
use a | ||
|
||
class B { | ||
} | ||
|
||
// A inherits a class but the declaration doesn't | ||
class A extends B { | ||
a: int | ||
ma() {} | ||
} |
1 change: 1 addition & 0 deletions
1
tests/pa7-typecheck-tests/class_decl_defn_dont_match_error4.typedsol
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 @@ | ||
7:1 error:Declaration and definition for class B don't inherit the same class |
9 changes: 9 additions & 0 deletions
9
tests/pa7-typecheck-tests/class_decl_defn_dont_match_error4.xi
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,9 @@ | ||
use b | ||
|
||
class C { | ||
} | ||
|
||
// B's def inherits C but decl inherits A | ||
class B extends C { | ||
b: int | ||
} |
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 @@ | ||
1:1 error:Class can't inherit itself |
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,2 @@ | ||
class B extends B { | ||
} |
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