-
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.
fix(error_templates/java): include access modifiers in typo
- Loading branch information
Showing
5 changed files
with
55 additions
and
3 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
3 changes: 3 additions & 0 deletions
3
error_templates/java/test_files/identifier_expected_error_public/Main.java
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 @@ | ||
publc class Main { | ||
public static void main(String[] args) {} | ||
} |
27 changes: 27 additions & 0 deletions
27
error_templates/java/test_files/identifier_expected_error_public/test.txt
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,27 @@ | ||
name: "Public" | ||
template: "Java.IdentifierExpectedError" | ||
--- | ||
Main.java:1: error: class, interface, or enum expected | ||
publc class Main { | ||
^ | ||
1 error | ||
=== | ||
template: "Java.IdentifierExpectedError" | ||
--- | ||
# IdentifierExpectedError | ||
This error indicates there's a typo or misspelled word in your code. | ||
``` | ||
publc class Main { | ||
^^^^^ | ||
public static void main(String[] args) {} | ||
} | ||
``` | ||
## Steps to fix | ||
### Correct the typo | ||
Change `publc` to `public`. | ||
```diff | ||
- publc class Main { | ||
+ public class Main { | ||
public static void main(String[] args) {} | ||
} | ||
``` |
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 @@ | ||
package slice | ||
|
||
func ContainsString(slice []string, value string) bool { | ||
for _, v := range slice { | ||
if v == value { | ||
return true | ||
} | ||
} | ||
return false | ||
} |