-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix to testLifted #361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to testLifted #361
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,18 @@ trait TypeAssigner { | |
} | ||
} | ||
|
||
def avoid(tp: Type, syms: => List[Symbol])(implicit ctx: Context): Type = { | ||
/** An upper approximation of the given type `tp` that does not refer to any symbol in `symsToAvoid`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks fine but is unrelated to the current pull request and ideally should be split in another commit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, but I don't have time to do that. Way too many other things on my plate :-( |
||
* Approximation steps are: | ||
* | ||
* - follow aliases if the original refers to a forbidden symbol | ||
* - widen termrefs that refer to a forbidden symbol | ||
* - replace ClassInfos of forbidden classes by the intersection of their parents, refined by all | ||
* non-private fields, methods, and type members. | ||
* - drop refinements referring to a forbidden symbol. | ||
*/ | ||
def avoid(tp: Type, symsToAvoid: => List[Symbol])(implicit ctx: Context): Type = { | ||
val widenMap = new TypeMap { | ||
lazy val forbidden = syms.toSet | ||
lazy val forbidden = symsToAvoid.toSet | ||
def toAvoid(tp: Type): Boolean = tp match { | ||
case tp: TermRef => | ||
val sym = tp.symbol | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation still seems incomplete, we don't always check that there is a base type where the type parameters match
tparams
, and there's a special case whentparams.isEmpty
.