Fix compiler crash on try expression with infix as (Fixes #7116) (#7112)

* Fix compiler crash

* make sure type is not lost
This commit is contained in:
cooldome 2018-01-29 04:59:49 +00:00 • committed by Andreas Rumpf
commit 12b11fd848
2 changed files with 10 additions and 2 deletions

View file

@ -21,5 +21,13 @@ proc test2() =
testTemplate(Exception)
doAssert(not declared(foobar))
proc testTryAsExpr(i: int) =
let x = try: i
except ValueError as ex:
echo(ex.msg)
-1
test[Exception]()
test2()
test2()
testTryAsExpr(5)