ursus
10/09/2019, 7:17 PMFoo : Bar<Quax> require Quax to be public, i.e. internal not allowed?Dominaezzz
10/09/2019, 7:31 PMCasey Brooks
10/09/2019, 7:41 PMFoo public? I would guess that the type parameter needs to have the same level of access as the class itself.ursus
10/09/2019, 8:43 PMursus
10/09/2019, 8:44 PMDominaezzz
10/09/2019, 9:41 PMursus
10/09/2019, 9:57 PMDominaezzz
10/09/2019, 10:07 PMFoo will see that it inherits Bar. Since Bar has a generic parameter, the parameter would have to be visible to anything that has access to Foo. So if Foo is public, anything it exposes has to be public.
If something has access to Foo, it won't know what Quax is, since it's internal.
I hope this makes sense.ursus
10/09/2019, 10:19 PMDominaezzz
10/09/2019, 10:23 PMFoo can be used outside the package?ursus
10/09/2019, 10:24 PMursus
10/09/2019, 10:26 PMpublic class Rah extends Meh<Ohe> {
}
class Ohe {
}
public abstract class Meh<T> {
}Dominaezzz
10/09/2019, 10:49 PMursus
10/09/2019, 11:09 PMursus
10/09/2019, 11:11 PMthanksforallthefish
10/10/2019, 7:06 AMthanksforallthefish
10/10/2019, 7:08 AMabstract class Bar<T>
internal class Quax
class Foo : Bar<Quax>
compiles:
interface Bar<T> //visibility here does not matter, it always compiles
internal class Quax
class Foo : Bar<Quax>ursus
10/10/2019, 8:47 AMcorneil
10/21/2019, 12:45 PM