Skip to content

Commit

Permalink
solved problem2 and therewith fixed #270
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingo60 committed Apr 21, 2016
1 parent 2b785d9 commit 2cc984b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions frege/compiler/gen/java/VarCode.fr
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,8 @@ genExpr rflg rm ex binds = do
ForAll{bound, rho}
| not (null bound),
Just sym g.findit ex.name,
-- exclude local methods
not (isJust sym.expr && sym.depth > 0 && RMethod `member` sym.rkind),
b' if sym.depth == 0 && RMethod `member` sym.rkind
then b.{jex JX.invoke []} -- evaluate method CAFs
else b
Expand Down
14 changes: 7 additions & 7 deletions tests/comp/Issue270.fr
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
as in the enclosing function, errors may occur. Specifically, *whiteSpace* references
*languageDef* and while the frege compiler can sort out its type variables quite fine
in type checking, it ruins it in code generation by doing something like:
final<st> ... whiteSpace() { .... languageDef.<st>commentStart ... }
and the Java compiler complains that the both *st* types are actually different.
This can only happen in the rare cases where type annotated let bindings cannot be
lifted to the top level.
Solution: alpha conversion of annotations for let bound functions. (This should also
better the error message problem "type is st, expected st")
## Problem 2
For some reason the "lexeme" function, when written without the superfluous () argument
is generated as a function, but the code generator thinks it is lambda. This must be
a (hopefully minor) glitch in the let-code generator.
-}
module tests.comp.Issue270 where

Expand Down

0 comments on commit 2cc984b

Please sign in to comment.