Skip to content

REPL: values that fail to initialise should not be accessible in later runs #4416

Closed
@allanrenucci

Description

@allanrenucci
scala> val x = 1 / 0 
java.lang.ArithmeticException: / by zero
	at rs$line$5$.<init>(rs$line$5:1)
	at rs$line$5$.<clinit>(rs$line$5)
	at rs$line$5.xShow(rs$line$5)
        ...

scala> def foo = x // should not compile
def foo: Int

scala> x // should not compile
java.lang.NoClassDefFoundError: Could not initialize class rs$line$5$
	at rs$line$8$.<init>(rs$line$8:1)
	at rs$line$8$.<clinit>(rs$line$8)
	at rs$line$8.res3Show(rs$line$8)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions