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
3.5.1-RC1
Observed when upgrading from 3.3.0 to 3.3.1 originally.
Minimized code
packageobjectpacker:// the super class needs to be in a different packageclassSuperClass():protectedvalproblem:Any=???// needs to be protectedclassSuperClass():protectedvalproblem:Any=???// needs to be protected// type Target = SuperClass // passestypeTarget= packer.SuperClass// errortraitChildextendsTarget:valaliased: problem.type= problem
typeAlias= problem.typevalnewProblem:Any {valprog: problem.type} =???// error// val newProblem: Any {val prog: Alias} = ??? // passes// val newProblem: Any {val prog: aliased.type} = ??? // passesclassChildImplextendsTargetwithChild// concrete implementation is needed
There are a few conditions for this we discovered:
the super class has to be in a different package
the reference to the val has to be in a type refinement
the value has to be protected
there has to be a concrete implementation
Output
--Error:Child.scala:20:6-----------------------------------------------------------------------------20|classChildImplextendsTargetwithChild// concrete implementation is needed|^|parent traitChild has a super call which binds to the value packer.SuperClass.problem. Super calls can only target methods.
1 error found
Expectation
The type alias, at least, should not change the checks. I'm not entirely sure if the error is expected in the first place.
Gedochao
added
stat:needs bisection
Need to use nightly builds and git bisect to find out the commit where this issue was introduced
and removed
stat:needs bisection
Need to use nightly builds and git bisect to find out the commit where this issue was introduced
labels
Jul 8, 2024
Compiler version
3.5.1-RC1
Observed when upgrading from 3.3.0 to 3.3.1 originally.
Minimized code
There are a few conditions for this we discovered:
Output
Expectation
The type alias, at least, should not change the checks. I'm not entirely sure if the error is expected in the first place.
The check/error was added in #16908 .
Credit
Minimized during a Scala Spree with @EugeneFlesselle . Originally discovered as epfl-lara/inox#210 .
The text was updated successfully, but these errors were encountered: