Commit 612e0c1
committed
Supress safe initialization warning in Types.scala
This change supresses the following 7 safe-init errors that occur in
Types.scala, but are too complicated for the checker to reason about:
```
[error] -- Error: /*******/dotty/compiler/src/dotty/tools/dotc/core/Types.scala:3951:53
[error] 3951 | val paramInfos: List[TypeBounds] = paramInfosExp(this)
[error] | ^^^^
[error] |Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
[error] -- Error: /*******/dotty/compiler/src/dotty/tools/dotc/core/Types.scala:3952:38
[error] 3952 | val resType: Type = resultTypeExp(this)
[error] | ^^^^
[error] |Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
[error] -- Error: /*******/dotty/compiler/src/dotty/tools/dotc/core/Types.scala:3882:53
[error] 3882 | val paramInfos: List[TypeBounds] = paramInfosExp(this)
[error] | ^^^^
[error] |Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
[error] -- Error: /*******/dotty/compiler/src/dotty/tools/dotc/core/Types.scala:3883:38
[error] 3883 | val resType: Type = resultTypeExp(this)
[error] | ^^^^
[error] |Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
[error] -- Error: /*******/dotty/compiler/src/dotty/tools/dotc/core/Types.scala:3708:47
[error] 3708 | val paramInfos: List[Type] = paramInfosExp(this)
[error] | ^^^^
[error] |Cannot prove that the value is fully initialized. Only initialized values may be used as arguments. Calling trace:
[error] | -> extends MethodType(paramNames)(paramInfosExp, resultTypeExp) [ Types.scala:3730 ]
[error] | -> abstract case class MethodType(paramNames: List[TermName])( [ Types.scala:3701 ]
[error] -- Error: /*******/dotty/compiler/src/dotty/tools/dotc/core/Types.scala:3709:38
[error] 3709 | val resType: Type = resultTypeExp(this)
[error] | ^^^^
[error] |Cannot prove that the value is fully initialized. Only initialized values may be used as arguments. Calling trace:
[error] | -> extends MethodType(paramNames)(paramInfosExp, resultTypeExp) [ Types.scala:3730 ]
[error] | -> abstract case class MethodType(paramNames: List[TermName])( [ Types.scala:3701 ]
[error] -- Error: /*******/dotty/compiler/src/dotty/tools/dotc/core/Types.scala:3017:33
[error] 3017 | val parent: Type = parentExp(this)
[error] | ^^^^
[error] |Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
```
Due to the `this` pointer being passed to an external method during initialization, the initialization checker cannot prove that these are safe.
Review by @liufengyun1 parent e078e79 commit 612e0c1
1 file changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3014 | 3014 | | |
3015 | 3015 | | |
3016 | 3016 | | |
3017 | | - | |
| 3017 | + | |
3018 | 3018 | | |
3019 | 3019 | | |
3020 | 3020 | | |
| |||
3705 | 3705 | | |
3706 | 3706 | | |
3707 | 3707 | | |
3708 | | - | |
3709 | | - | |
| 3708 | + | |
| 3709 | + | |
3710 | 3710 | | |
3711 | 3711 | | |
3712 | 3712 | | |
| |||
3879 | 3879 | | |
3880 | 3880 | | |
3881 | 3881 | | |
3882 | | - | |
3883 | | - | |
| 3882 | + | |
| 3883 | + | |
3884 | 3884 | | |
3885 | 3885 | | |
3886 | 3886 | | |
| |||
3948 | 3948 | | |
3949 | 3949 | | |
3950 | 3950 | | |
3951 | | - | |
3952 | | - | |
| 3951 | + | |
| 3952 | + | |
3953 | 3953 | | |
3954 | 3954 | | |
3955 | 3955 | | |
| |||
0 commit comments