http://d.puremagic.com/issues/show_bug.cgi?id=8837

           Summary: BigInt/boolean error message
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-10-17 13:39:56 PDT ---
import std.bigint: BigInt;
void main() {
    auto r1 = BigInt(10) / true;
    auto r2 = BigInt(10) /= true;
}


DMD 2.061alpha gives:

...\dmd2\src\phobos\std\bigint.d(135): Error: operation not allowed on bool 'y'
...\dmd2\src\phobos\std\bigint.d(258): Error: template instance
std.bigint.BigInt.opOpAssign!("/",bool) error instantiating
test.d(3):        instantiated from here: opBinary!("/",bool)
test.d(3): Error: template instance std.bigint.BigInt.opBinary!("/",bool) error
instantiating


If this operation is not allowed, then maybe it's better to disallow it
statically (maybe with a template constraint), to give a nicer/more clean error
message.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to