Bug 4351 - Type checking fails for later declared type with strict_types
: Type checking fails for later declared type with strict_types
Status: RESOLVED FIXED
: Pike
Compiler
: 7.6
: All All
: P3 (normal) normal
: ---
Assigned To:
:
:
:
  Show dependency treegraph
 
Reported: 2007-04-04 11:21 CET by
Modified: 2009-11-17 16:08 CET (History)
Scrum Prio:
In scrum?: ---
Story included in sprints:
Unplanned in sprints:


Attachments


Description From 2007-04-04 11:21:02 CET
Compiling this will result in:
foo.pike:5: Warning: Arguments not strictly compatible.
foo.pike:5: Warning: Expected: function(zero | void ... : object(is 65620))
foo.pike:5: Warning: Got     : function(string : void | mixed)

Same in 7.6 and 7.7.

foo.pike:
#pragma strict_types

int main(int argc, array(string) argv)
{
    String("");
}

class String(string s) { }
------- Comment #1 From 2009-11-17 15:12:42 CET -------
Interesting problem...

There were two bugs; no prototype was added for the implicit lfun::create() in
the first pass, and the type of the program constant wasn't updated on exit, so
existance of lfun::create() didn't affect the type checking for code before the
class definition.

Fixed in Pike 7.8.371 and later.
------- Comment #2 From 2009-11-17 16:08:45 CET -------
*** Bug 2823 has been marked as a duplicate of this bug. ***

Note

You need to log in before you can comment on or make changes to this bug.