-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(checker): set correct return type of array.last()
- Loading branch information
Showing
5 changed files
with
20 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
mut a := [1, 2, 3] | ||
a.push(true) | ||
a.index('a') | ||
a.contains(12 as i16) | ||
a.concat(['b', 'c']) | ||
mut a := [1, 2, 3] | ||
|
||
a.push(true) | ||
a.index('a') // FIXME should raise error | ||
a.contains(12 as i16) | ||
a.concat(['b', 'c']) | ||
|
||
mut x := 'a' | ||
x = a.last() |
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,4 +1,4 @@ | ||
tests/out/error/array/magic_methods.in.bt:2:7 error: type bool not matches i32 in argument 1 | ||
tests/out/error/array/magic_methods.in.bt:3:8 error: type string not matches i32 in argument 1 | ||
tests/out/error/array/magic_methods.in.bt:4:11 error: type i16 not matches i32 in argument 1 | ||
tests/out/error/array/magic_methods.in.bt:5:9 error: type []string not matches []i32 in argument 1 | ||
tests/out/error/array/magic_methods.in.bt:3:6 error: type bool not matches i32 in argument 1 | ||
tests/out/error/array/magic_methods.in.bt:5:10 error: type i16 not matches i32 in argument 1 | ||
tests/out/error/array/magic_methods.in.bt:6:8 error: type []string not matches []i32 in argument 1 | ||
tests/out/error/array/magic_methods.in.bt:9:2 error: cannot assign type i32 to 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