mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-23 01:48:18 +00:00
make default a modifer keyword for interface default method support
This commit is contained in:
@@ -96,6 +96,13 @@ function checkMethodModifiers(type, ownertypemods, method, probs) {
|
||||
if (allmods.has('native') && method.body().simplified.startsWith('B')) {
|
||||
probs.push(ParseProblem.Error(allmods.get('native'), 'Method declarations marked as native cannot have a method body'));
|
||||
}
|
||||
// JLS8
|
||||
if (type.kind() !== 'interface' && allmods.has('default')) {
|
||||
probs.push(ParseProblem.Error(method, `Default method declarations are only allowed inside interfaces`));
|
||||
}
|
||||
if (allmods.has('default') && !method.body().simplified.startsWith('B')) {
|
||||
probs.push(ParseProblem.Error(method, `Default method declarations must have an implementation`));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user