forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
t3273.check
16 lines (16 loc) · 1.26 KB
/
t3273.check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- Error: tests/init/neg/t3273.scala:4:42 ------------------------------------------------------------------------------
4 | val num1: LazyList[Int] = 1 #:: num1.map(_ + 1) // error
| ^^^^^^^^^^^^^^^
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
|
| The unsafe promotion may cause the following problem:
| Access non-initialized value num1. Calling trace:
| -> val num1: LazyList[Int] = 1 #:: num1.map(_ + 1) // error [ t3273.scala:4 ]
-- Error: tests/init/neg/t3273.scala:5:61 ------------------------------------------------------------------------------
5 | val num2: LazyList[Int] = 1 #:: num2.iterator.map(_ + 1).to(LazyList) // error
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
|
| The unsafe promotion may cause the following problem:
| Access non-initialized value num2. Calling trace:
| -> val num2: LazyList[Int] = 1 #:: num2.iterator.map(_ + 1).to(LazyList) // error [ t3273.scala:5 ]