Scoped capabilities can leak through path-dependent types #19330
Labels
area:experimental:cc
Capture checking related
cc-experiment
Intended to be merged with cc-experiment branch on origin
itype:bug
Milestone
Compiler version
main
Minimized code
Output
It compiles.
Expectation
It should not compile.
Essentially, the above example is equivalent to the following code but the following uses type parameters instead of path-dependent types:
But this code is rejected as wanted, as we perform the no-root-capability check for the type application
foo[() => Logger^]
.Given that path-dependent types is, in some sense, equivalent to type parameters, a similar check should be performed for
foo(bar)
in the unsound code example.But that one is currently missing.
Alternatively, instead of checking the type members on the callsite, we could do that check when instantiating a type member. In this case, that would be when defining the class
Bar
.The text was updated successfully, but these errors were encountered: