Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.9.4
-
Fix Version/s: None
-
Component/s: Compiler
-
Labels:None
-
Number of attachments :
Description
I found possible issue while working with method Boo.OMeta.OMetaInput.Prepend
The method has inferred type of OMetaInputCons. Type OMetaInputCons is internal. But method Prepend is public.
I think that error should be returned in this case. C# returns the following error message in this case "Inconsistent accessibility: return type ' Boo.OMeta.OMetaInputCons' is less accessible than method 'Boo.OMeta.OMetaInput.Prepend".
Just adding the simpler scenario.
In the example provided below the static method A.GetA() is of inferred type B. I think it is an issue because type B is less accessible than method A.GetA(). The problem is undetectable during compile time. I found the issue when I placed the class C to another assembly and call method C.GetA(). The following run-time exception was raised: System.TypeAccessException : Attempt by method 'C.GetA()' to access type 'B' failed.
import System
class A:
static def GetA():
return B()
internal class B(A):
pass
class C:
def GetA():
a = A.GetA()
a = A.GetA()
assert not a isa B
assert a isa A
print "Press any key to continue . . . "
Console.ReadKey(true)