aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog8
-rw-r--r--src/interp/compiler.boot6
-rw-r--r--src/testsuite/compiler/1872564.spad7
3 files changed, 15 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 55fb4d2b..4f404627 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-16 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ Fix SF/1872564
+ * interp/compiler.boot (compPretend): Don't check for `new'
+ compiler semantics.
+ (compColonInside): Likewise.
+ * testsuite/compiler/1872564.spad: New.
+
2008-01-15 Gabriel Dos Reis <gdr@cs.tamu.edu>
Fix SF/1850071
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 8915a10b..283b8868 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -1147,8 +1147,6 @@ compPretend(["pretend",x,t],m,e) ==
e:= addDomain(t,e)
T:= comp(x,t,e) or comp(x,$EmptyMode,e) or return nil
if T.mode=t then warningMessage:= ["pretend",t," -- should replace by @"]
- $newCompilerUnionFlag and opOf(T.mode) = 'Union and opOf(m) ^= 'Union =>
- stackSemanticError(["cannot pretend ",x," of mode ",T.mode," to mode ",m],nil)
T:= [T.expr,t,T.env]
T':= coerce(T,m) => (if warningMessage then stackWarning warningMessage; T')
@@ -1161,10 +1159,6 @@ compColonInside(x,m,e,m') ==
if warningMessage
then stackWarning warningMessage
else
- $newCompilerUnionFlag and opOf(m'') = 'Union =>
- return
- stackSemanticError(["cannot pretend ",x," of mode ",m''," to mode ",m'],nil)
-
stackWarning [":",m'," -- should replace by pretend"]
T'
diff --git a/src/testsuite/compiler/1872564.spad b/src/testsuite/compiler/1872564.spad
new file mode 100644
index 00000000..505a10b3
--- /dev/null
+++ b/src/testsuite/compiler/1872564.spad
@@ -0,0 +1,7 @@
+++ Contributed by Luke Wagner
+++ Issue: The compiler should allow pretend from Union types.
+)abbrev package TEST Test
+Test() : with
+ foo : Union(Integer, Float) -> SExpression
+ == add
+ foo u == u pretend SExpression