Skip to content

Commit

Permalink
repair normalform, wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wadoon committed Jul 22, 2023
1 parent 3da3422 commit 209349f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ public IProgramMethod getConstructor(KeYJavaType ct, ImmutableList<KeYJavaType>
List<ResolvedType> sig = signature.stream().map(this::getJavaParserType).toList();

List<ResolvedConstructorDeclaration> constructors = rt.get().getConstructors();
constr: for (var constructor : constructors) {
constr:
for (var constructor : constructors) {
if (sig.size() != constructor.getNumberOfParams()) {
continue;
}
Expand Down Expand Up @@ -336,6 +337,10 @@ public IProgramMethod getProgramMethod(@Nonnull KeYJavaType ct, String name,
List<ResolvedType> jpSignature = StreamSupport.stream(signature.spliterator(), false)
.map(this::getJavaParserType).toList();
var method = MethodResolutionLogic.solveMethodInType(rct, name, jpSignature);

if (!method.isSolved())
return null;

return method.getDeclaration()
.map(d -> (IProgramMethod) Objects.requireNonNull(mapping.resolvedDeclarationToKeY(d)))
.orElse(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ private void attachDefaultConstructor(ClassOrInterfaceDeclaration cd) {
*/
private void normalform(ClassOrInterfaceDeclaration cd, ConstructorDeclaration cons) {
final var enclosingClass = getEnclosingClass(cd);
if (enclosingClass.isEmpty()) {
return; // throw reportError(cd, "No enclosing class found");
}

NodeList<Modifier> mods = new NodeList<>();
var et = getImplicitEnclosingThis(cd);
Expand Down

0 comments on commit 209349f

Please sign in to comment.