From 92e01176876c831a7abfaad8ffeaf87bd4bfd82d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Wed, 1 Nov 2017 09:35:57 +0200 Subject: [PATCH] Removed a workaround converting universal variables to existential refs #7575 Change-Id: Ia43fb4d69ddd3798685557916c3d3bb907a6be18 --- .../server/request/ServerSCLHandlerValueRequest.java | 7 +------ .../document/server/request/ServerSCLValueRequest.java | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/bundles/org.simantics.document.server/src/org/simantics/document/server/request/ServerSCLHandlerValueRequest.java b/bundles/org.simantics.document.server/src/org/simantics/document/server/request/ServerSCLHandlerValueRequest.java index 7283cf26b..286cae272 100644 --- a/bundles/org.simantics.document.server/src/org/simantics/document/server/request/ServerSCLHandlerValueRequest.java +++ b/bundles/org.simantics.document.server/src/org/simantics/document/server/request/ServerSCLHandlerValueRequest.java @@ -1,6 +1,5 @@ package org.simantics.document.server.request; -import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -28,8 +27,6 @@ import org.simantics.scl.compiler.environment.specification.EnvironmentSpecifica import org.simantics.scl.compiler.runtime.RuntimeEnvironment; import org.simantics.scl.compiler.top.SCLExpressionCompilationException; import org.simantics.scl.compiler.types.TCon; -import org.simantics.scl.compiler.types.TMetaVar; -import org.simantics.scl.compiler.types.TVar; import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; import org.simantics.scl.compiler.types.kinds.Kinds; @@ -235,9 +232,7 @@ public class ServerSCLHandlerValueRequest extends AbstractExpressionCompilationR protected Type getExpectedType(ReadGraph graph, CompilationContext context) throws DatabaseException { if(possibleExpectedValueType != null) { try { - Type type = Environments.getType(context.runtimeEnvironment.getEnvironment(), possibleExpectedValueType); - type = Types.instantiate(Types.forAll(Types.freeVars(type).toArray(new TVar[0]), type), new ArrayList()); - return type; + return Environments.getType(context.runtimeEnvironment.getEnvironment(), possibleExpectedValueType); } catch (SCLExpressionCompilationException e) { LOGGER.error("Could not get type for " + String.valueOf(possibleExpectedValueType), e); } diff --git a/bundles/org.simantics.document.server/src/org/simantics/document/server/request/ServerSCLValueRequest.java b/bundles/org.simantics.document.server/src/org/simantics/document/server/request/ServerSCLValueRequest.java index 68602de69..b4d4d2c1f 100644 --- a/bundles/org.simantics.document.server/src/org/simantics/document/server/request/ServerSCLValueRequest.java +++ b/bundles/org.simantics.document.server/src/org/simantics/document/server/request/ServerSCLValueRequest.java @@ -1,6 +1,5 @@ package org.simantics.document.server.request; -import java.util.ArrayList; import java.util.Map; import org.simantics.databoard.Bindings; @@ -29,8 +28,6 @@ import org.simantics.scl.compiler.environment.Environments; import org.simantics.scl.compiler.environment.specification.EnvironmentSpecification; import org.simantics.scl.compiler.runtime.RuntimeEnvironment; import org.simantics.scl.compiler.top.SCLExpressionCompilationException; -import org.simantics.scl.compiler.types.TMetaVar; -import org.simantics.scl.compiler.types.TVar; import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; import org.simantics.scl.compiler.types.kinds.Kinds; @@ -211,9 +208,7 @@ public class ServerSCLValueRequest extends AbstractExpressionCompilationRequest< protected Type getExpectedType(ReadGraph graph, CompilationContext context) throws DatabaseException { if(possibleExpectedValueType != null) { try { - Type type = Environments.getType(context.runtimeEnvironment.getEnvironment(), possibleExpectedValueType); - type = Types.instantiate(Types.forAll(Types.freeVars(type).toArray(new TVar[0]), type), new ArrayList()); - return type; + return Environments.getType(context.runtimeEnvironment.getEnvironment(), possibleExpectedValueType); } catch (SCLExpressionCompilationException e) { LOGGER.error("Could not get type for " + String.valueOf(possibleExpectedValueType), e); } -- 2.47.1