mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-23 18:08:29 +00:00
don't report missing constructors if superclass has none
This commit is contained in:
@@ -18,12 +18,14 @@ function checkConstructor(source_type, probs) {
|
||||
// - which means the inherited class is Object (and a default constructor exists)
|
||||
return;
|
||||
}
|
||||
if (superclass.constructors.length) {
|
||||
if (!superclass.constructors.find(c => c.parameterCount === 0)) {
|
||||
// the source type has no declared constructors, but the superclass
|
||||
// does not include a default (parameterless) constructor
|
||||
probs.push(ParseProblem.Error(source_type.nameToken, `Class '${source_type.fullyDottedRawName}' requires a constructor to be declared because the inherited class '${superclass.fullyDottedRawName}' does not define a default constructor.`));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {SourceType[]} source_types
|
||||
|
||||
Reference in New Issue
Block a user