Skip to content

Commit

Permalink
Merge pull request #2957 from michaellilltokiwa/dfa/Instance--fix-toS…
Browse files Browse the repository at this point in the history
…tring-for-NO_SITE

dfa/Instance: fix toString for NO_SITE
  • Loading branch information
fridis committed Apr 25, 2024
2 parents 0870d97 + 65ec19f commit b5a0328
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/dev/flang/fuir/FUIR.java
Expand Up @@ -2269,12 +2269,17 @@ public SourcePosition codeAtAsPos(int s)
{
if (PRECONDITIONS) require
(s >= 0,
withinCode(s));
s == NO_SITE || withinCode(s));

var e = getExpr(s);
return (e instanceof Expr expr) ? expr.pos() :
(e instanceof Clazz z) ? z._type.declarationPos() /* implicit assignment to argument field */
: null;
SourcePosition result = SourcePosition.notAvailable;
if (s != NO_SITE)
{
var e = getExpr(s);
result = (e instanceof Expr expr) ? expr.pos() :
(e instanceof Clazz z) ? z._type.declarationPos() /* implicit assignment to argument field */
: null;
}
return result;
}


Expand Down

0 comments on commit b5a0328

Please sign in to comment.