1. 05 Nov, 2008 10 commits
    • Russ Cox's avatar
      new interface error messages · 6f07ec72
      Russ Cox authored
      	package main
      	func main() {
      		var i interface { } = 1;
      		a := i.(*[]byte);
      	}
      
      interface { } is int, not *[]uint8
      throw: interface conversion
      
      	package main
      	func main() {
      		var i interface { };
      		a := i.(*[]byte);
      	}
      
      interface is nil, not *[]uint8
      throw: interface conversion
      
      	package main
      	func main() {
      		i := sys.unreflect(0, "*bogus");
      		a := i.(*[]byte);
      	}
      
      interface { } is *bogus, not *[]uint8
      throw: interface conversion
      
      R=r
      DELTA=30  (24 added, 2 deleted, 4 changed)
      OCL=18548
      CL=18565
      6f07ec72
    • Rob Pike's avatar
      trim tags from type strings for structure fields. · 5a1cbe8b
      Rob Pike authored
      R=rsc
      DELTA=28  (14 added, 4 deleted, 10 changed)
      OCL=18561
      CL=18563
      5a1cbe8b
    • Ian Lance Taylor's avatar
      Fix powser1.go to compile with the current 6g, which doesn't · 7fe34ea0
      Ian Lance Taylor authored
      recognize methods for a variable whose type is a named type
      which is a pointer type.  Add bug117 to test this case.
      
      R=r
      DELTA=24  (22 added, 0 deleted, 2 changed)
      OCL=18547
      CL=18554
      7fe34ea0
    • Russ Cox's avatar
      6g interface changes: · 1983121b
      Russ Cox authored
      	* allow conversion between nil interface and any type.
      	* mark signatures as DUPOK so that multiple .6 can
      	  contain sigt.*[]byte and only one gets used.
      
      R=ken
      OCL=18538
      CL=18542
      1983121b
    • Ian Lance Taylor's avatar
      Don't use a named pointer type as a receiver type. The · 6cd74b03
      Ian Lance Taylor authored
      current spec forbids it:
          The type specified by the type name is called ``receiver
          base type''.  The receiver base type must be a type
          declared in the current file, and it must not be a pointer
          type.
      
      R=r
      DELTA=2  (0 added, 0 deleted, 2 changed)
      OCL=18527
      CL=18541
      6cd74b03
    • Rob Pike's avatar
      minor tweak to still non-portable alignment calculation · 44a82746
      Rob Pike authored
      R=rsc
      DELTA=4  (1 added, 1 deleted, 2 changed)
      OCL=18528
      CL=18533
      44a82746
    • Rob Pike's avatar
      make sizes and offsets int, not uint64 · 554d0aa5
      Rob Pike authored
      add Value.Interface, to extract an empty interface
      that can be converted to a regular Go value of the
      appropriate type, if known.
      
      R=rsc
      DELTA=49  (2 added, 0 deleted, 47 changed)
      OCL=18526
      CL=18526
      554d0aa5
    • Rob Pike's avatar
      fix bugs parsing functions in reflect library. · bdbb9588
      Rob Pike authored
      parsed interfaces wrong.
      could not handle a function with a single type as a return value.
      
      R=rsc
      DELTA=34  (20 added, 2 deleted, 12 changed)
      OCL=18511
      CL=18520
      bdbb9588
    • Rob Pike's avatar
      type strings through the reflection library. · a45f947c
      Rob Pike authored
      R=rsc
      DELTA=187  (107 added, 28 deleted, 52 changed)
      OCL=18510
      CL=18510
      a45f947c
    • Robert Griesemer's avatar
      - added (incomplete) section on parameter passing · 69e26bf2
      Robert Griesemer authored
      - decribe passing of "..." parameters for a start
      
      R=r
      DELTA=70  (69 added, 0 deleted, 1 changed)
      OCL=18503
      CL=18503
      69e26bf2
  2. 04 Nov, 2008 10 commits
  3. 03 Nov, 2008 12 commits
  4. 02 Nov, 2008 3 commits
    • Rob Pike's avatar
      printf as we know and love it. · 2d4f7ba0
      Rob Pike authored
      Plus print[ln] with the ability to print struct values.
      
      Note for language mavens: if a "..." function passes its argument
      to another "..." function, the argument is not wrapped again.  This
      allows printf to call fprintf without extra manipulation. It's good
      but needs to go in the spec.
      
      This code works:
      ///
      package main
      
      import fmt "fmt"
      import os "os"
      
      type T struct { s string; a, b int }
      
      func main() {
      	P := fmt.Printer();
      	P.printf("%s = %d with float value %.4f\n", "hi there", 7, 123.456);
      	P.println("hi there", 7, 123.456);
      	P.fprintf(os.Stdout, "%s = %d with float value %.4f\n", "hi there", 7, 123.456);
      	P.println(T{"x", 7, 234}, "end of struct", 8, 9);
      }
      
      R=rsc
      DELTA=28  (7 added, 3 deleted, 18 changed)
      OCL=18321
      CL=18324
      2d4f7ba0
    • Rob Pike's avatar
      add creator for missing types, to avoid crashes when · 178e37e7
      Rob Pike authored
      signature is absent from object file.
      
      R=rsc
      DELTA=18  (18 added, 0 deleted, 0 changed)
      OCL=18315
      CL=18323
      178e37e7
    • Ken Thompson's avatar
      >>= and <<= shift bug · d2472eb8
      Ken Thompson authored
      R=r
      OCL=18322
      CL=18322
      d2472eb8
  5. 01 Nov, 2008 4 commits
  6. 31 Oct, 2008 1 commit