Ticket #148 (new defect)
method call to a method defined within the same object type (which then makes call to builtinPrimitive) is not disambiguated correctly.
| Reported by: | angelee | Owned by: | dr2chase |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | interpreter | Version: | |
| Keywords: | Cc: |
Description
The following code fails -- the evaluator can't find the method "myJavaDigit"; this only seems to be a problem when myJavaDigit is called by another method defined in the same type but not when it's called directly. Also, the fact that it makes a call to builtinPrimitive makes a difference. The test is committed into the not_passing_yet directory, named builtinPrimTest.fss.
object MyChar?(val:Char)
myJavaDigit(self, radix:ZZ32): ZZ32 =
builtinPrimitive("com.sun.fortress.interpreter.glue.prim.Char$JavaDigit?")
myDigit(self, radix:ZZ32): Maybe[\ZZ32\] = do
x:ZZ32 = myJavaDigit(self, radix) if(x = -1) then
Nothing[\ZZ32\]
else
Just[\ZZ32\](x)
end
end
end
run(args:String...):() = do
c = MyChar?('5') myDigit(c, 10)
end
NOTE: When this bug is fixed, need to change the work-around in the object Char definition in LibraryBuiltin/FortressBuiltin?.fsi/fss: 1) Remove the javaDigit method decl from object Char definition in fsi 2) Remove the function myJavaDigit in fss (just about the definition of object Char) 3) Change call to myJavaDigit to javaDigit in the object Char definition

