Skip to content

Commit

Permalink
fmt after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Dec 31, 2024
1 parent 5853a1e commit 968af64
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.enso.compiler.pass.analyse.types;

import org.enso.compiler.pass.analyse.types.scope.AtomType;
import org.enso.compiler.pass.analyse.types.scope.BuiltinsFallbackScope;
import org.enso.compiler.pass.analyse.types.scope.ModuleResolver;
import org.enso.compiler.pass.analyse.types.scope.StaticMethodResolution;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ protected abstract void encounteredNoSuchMethod(
IR relatedIr, TypeRepresentation type, String methodName, MethodCallKind kind);

/**
* The callback that is called when a constructor is being invoked on a type that does not have such a constructor.
* The callback that is called when a constructor is being invoked on a type that does not have
* such a constructor.
*/
protected abstract void encounteredNoSuchConstructor(IR relatedIr, TypeRepresentation type, String constructorName);
protected abstract void encounteredNoSuchConstructor(
IR relatedIr, TypeRepresentation type, String constructorName);

enum MethodCallKind {
MEMBER,
Expand Down Expand Up @@ -364,7 +366,8 @@ private TypeRepresentation processUnresolvedSymbolApplication(
if (constructor != null) {
if (constructor.type() == null) {
// type is unknown due to default arguments
// TODO later on this should be assert != null because all constructors should have a type (once we can deal with default arguments)
// TODO later on this should be assert != null because all constructors should have a
// type (once we can deal with default arguments)
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ public QualifiedName getAssociatedType() {
* <p>Instances that are assigned this type are built with one of the available constructors, but
* statically we do not necessarily know which one.
*/
record AtomType(QualifiedName fqn)
implements TypeRepresentation {
record AtomType(QualifiedName fqn) implements TypeRepresentation {
@Override
public String toString() {
return fqn.item();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.enso.compiler.pass.analyse.types.scope;

import org.enso.compiler.pass.analyse.types.TypeRepresentation;

import java.util.List;
import org.enso.compiler.pass.analyse.types.TypeRepresentation;

public final class AtomType {
private final String name;
Expand All @@ -26,8 +25,8 @@ public Constructor getConstructor(String name) {
*
* @param name the name of the constructor
* @param isProjectPrivate whether the constructor is project private
* @param type the type ascribed to the constructor, it may be null if it is unknown
* TODO the type will soon be always non-null - once we can handle default arguments
* @param type the type ascribed to the constructor, it may be null if it is unknown TODO the type
* will soon be always non-null - once we can handle default arguments
*/
public record Constructor(String name, boolean isProjectPrivate, TypeRepresentation type) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ private TypeRepresentation buildAtomConstructorType(Definition.Data constructorD
}

var arguments =
constructorDef.arguments().map(
constructorDef
.arguments()
.map(
(arg) -> {
var typ = arg.ascribedType();
// TODO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ import org.enso.compiler.PackageRepository
import org.enso.compiler.PackageRepository.ModuleMap
import org.enso.compiler.context.CompilerContext.Module
import org.enso.compiler.core.Implicits.AsMetadata
import org.enso.compiler.core.ir
import org.enso.compiler.core.{ir, CompilerError}
import org.enso.compiler.core.ir.expression.errors
import org.enso.compiler.data.BindingsMap.{DefinedEntity, ModuleReference}
import org.enso.compiler.core.CompilerError
import org.enso.compiler.core.ir.Expression
import org.enso.compiler.core.ir.module.scope.Definition
import org.enso.compiler.data.BindingsMap.{DefinedEntity, ModuleReference}
import org.enso.compiler.pass.IRPass
import org.enso.compiler.pass.analyse.BindingAnalysis
import org.enso.compiler.pass.resolve.MethodDefinitions
import org.enso.persist.Persistance.Reference
import org.enso.pkg.QualifiedName
import org.enso.editions.LibraryName
import org.enso.pkg.QualifiedName

import java.io.ObjectOutputStream
import scala.annotation.unused
Expand Down

0 comments on commit 968af64

Please sign in to comment.