Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
uydwl
mjtest-tests
Commits
d6615144
Verified
Commit
d6615144
authored
Nov 16, 2018
by
Maximilian Stemmer-Grabow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test cases for field access from static contexts
parent
957e4d74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
semantic/field_access_from_static_context.invalid.mj
semantic/field_access_from_static_context.invalid.mj
+7
-0
semantic/field_access_on_class_identifier.invalid.mj
semantic/field_access_on_class_identifier.invalid.mj
+11
-0
No files found.
semantic/field_access_from_static_context.invalid.mj
0 → 100644
View file @
d6615144
class FieldAccessStatic {
public int nonStatic;
public static void main(String[] args) {
nonStatic = 42;
}
}
semantic/field_access_on_class_identifier.invalid.mj
0 → 100644
View file @
d6615144
class FieldAccess {
public int field;
public static void main(String[] args) {
new FieldAccess().accessField();
}
public void accessField() {
int i = FieldAccess.field;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment