You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gives the error message below. It seems fine to reject such wrapper as it causes non-termination etc., but we seem to reject by way of an internal error and possibly by accident, so we should at least report a meaningful error to the user.
[ Info ] Finished compiling
[ Info ] Preprocessing the symbols...
[ Error ] WrapperTest.scala:9:5: Type error: @final
[ Error ] def w: Spec = Wrapper({
[ Error ] case class $anon extends Wrapper {
[ Error ]
[ Error ]
[ Error ]
[ Error ] }
[ Error ] $anon()
[ Error ] })
[ Error ] (), expected Unit,
[ Error ] found <untyped>
[ Error ]
[ Error ] Typing explanation:
[ Error ] @final
[ Error ] def w: Spec = Wrapper({
[ Error ] case class $anon extends Wrapper {
[ Error ]
[ Error ]
[ Error ]
[ Error ] }
[ Error ] $anon()
[ Error ] })
[ Error ] () is of type <untyped>
[ Error ] Wrapper({
[ Error ] case class $anon extends Wrapper {
[ Error ]
[ Error ]
[ Error ]
[ Error ] }
[ Error ] $anon()
[ Error ] }) is of type <untyped>
[ Error ] case class $anon extends Wrapper {
[ Error ]
[ Error ]
[ Error ]
[ Error ] }
[ Error ] $anon() is of type $anon
[ Error ] $anon() is of type $anon
[ Error ] () is of type Unit
def w: Spec = Wrapper(new Wrapper(w) { })
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ Fatal ] Well-formedness check failed after extraction
[ Error ] Stainless terminated with an error.
The text was updated successfully, but these errors were encountered:
So it looks like there's some limitation in how our type checker or extractor uses expected type in the presence of subtyping with anonymous classes
vkuncak
changed the title
Internal type error when wrapping interface around an inner class
Internal type error in extraction when passing anonymous class instance to method expecting trait
Aug 11, 2024
vkuncak
changed the title
Internal type error in extraction when passing anonymous class instance to method expecting trait
Internal type error in extraction when passing anonymous trait instance to method expecting trait
Aug 11, 2024
This code:
gives the error message below. It seems fine to reject such wrapper as it causes non-termination etc., but we seem to reject by way of an internal error and possibly by accident, so we should at least report a meaningful error to the user.
The text was updated successfully, but these errors were encountered: