Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 81 for noposn (0.1 sec)

  1. src/go/types/errors_test.go

    	if got := err.msg(); got != want {
    		t.Errorf("empty error: got %q, want %q", got, want)
    	}
    
    	want = "foo 42"
    	err.addf(noposn, "foo %d", 42)
    	if got := err.msg(); got != want {
    		t.Errorf("simple error: got %q, want %q", got, want)
    	}
    
    	want = "foo 42\n\tbar 43"
    	err.addf(noposn, "bar %d", 43)
    	if got := err.msg(); got != want {
    		t.Errorf("simple error: got %q, want %q", got, want)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  2. src/go/types/errors.go

    	case ast.Node:
    		pos := x.Pos()
    		return posSpan{pos, pos, x.End()}
    	case *operand:
    		if x.expr != nil {
    			pos := x.Pos()
    			return posSpan{pos, pos, x.expr.End()}
    		}
    		return posSpan{nopos, nopos, nopos}
    	default:
    		pos := at.Pos()
    		return posSpan{pos, pos, pos}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 22:06:18 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  3. src/cmd/internal/src/xpos_test.go

    func TestNoXPos(t *testing.T) {
    	var tab PosTable
    	if tab.Pos(NoXPos) != NoPos {
    		t.Errorf("failed to translate NoXPos to Pos using zero PosTable")
    	}
    }
    
    func TestConversion(t *testing.T) {
    	b1 := NewFileBase("b1", "b1")
    	b2 := NewFileBase("b2", "b2")
    	b3 := NewLinePragmaBase(MakePos(b1, 10, 0), "b3", "b3", 123, 0)
    
    	var tab PosTable
    	for _, want := range []Pos{
    		NoPos,
    		MakePos(nil, 0, 0), // same table entry as NoPos
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:52:41 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/object_test.go

    	}
    
    	// various other types
    	pkg := NewPackage("p", "p")
    	t1 := NewTypeName(nopos, pkg, "t1", nil)
    	n1 := NewNamed(t1, new(Struct), nil)
    	t5 := NewTypeName(nopos, pkg, "t5", nil)
    	NewTypeParam(t5, nil)
    	for _, test := range []struct {
    		name  *TypeName
    		alias bool
    	}{
    		{NewTypeName(nopos, nil, "t0", nil), false}, // no type yet
    		{NewTypeName(nopos, pkg, "t0", nil), false}, // no type yet
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  5. src/go/types/object_test.go

    	}
    
    	// various other types
    	pkg := NewPackage("p", "p")
    	t1 := NewTypeName(nopos, pkg, "t1", nil)
    	n1 := NewNamed(t1, new(Struct), nil)
    	t5 := NewTypeName(nopos, pkg, "t5", nil)
    	NewTypeParam(t5, nil)
    	for _, test := range []struct {
    		name  *TypeName
    		alias bool
    	}{
    		{NewTypeName(nopos, nil, "t0", nil), false}, // no type yet
    		{NewTypeName(nopos, pkg, "t0", nil), false}, // no type yet
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/universe.go

    		recv := NewVar(nopos, nil, "", typ)
    		res := NewVar(nopos, nil, "", Typ[String])
    		sig := NewSignatureType(recv, nil, nil, nil, NewTuple(res), false)
    		err := NewFunc(nopos, nil, "Error", sig)
    
    		// interface{ Error() string }
    		ityp := &Interface{methods: []*Func{err}, complete: true}
    		computeInterfaceTypeSet(nil, nopos, ityp) // prevent races due to lazy computation of tset
    
    		typ.SetUnderlying(ityp)
    		def(obj)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  7. src/go/types/universe.go

    		recv := NewVar(nopos, nil, "", typ)
    		res := NewVar(nopos, nil, "", Typ[String])
    		sig := NewSignatureType(recv, nil, nil, nil, NewTuple(res), false)
    		err := NewFunc(nopos, nil, "Error", sig)
    
    		// interface{ Error() string }
    		ityp := &Interface{methods: []*Func{err}, complete: true}
    		computeInterfaceTypeSet(nil, nopos, ityp) // prevent races due to lazy computation of tset
    
    		typ.SetUnderlying(ityp)
    		def(obj)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/errors_test.go

    	if got := err.msg(); got != want {
    		t.Errorf("empty error: got %q, want %q", got, want)
    	}
    
    	want = "foo 42"
    	err.addf(nopos, "foo %d", 42)
    	if got := err.msg(); got != want {
    		t.Errorf("simple error: got %q, want %q", got, want)
    	}
    
    	want = "foo 42\n\tbar 43"
    	err.addf(nopos, "bar %d", 43)
    	if got := err.msg(); got != want {
    		t.Errorf("simple error: got %q, want %q", got, want)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 23 21:21:43 UTC 2024
    - 979 bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/context_test.go

    	var nullaryP, nullaryQ, unaryP Type
    	{
    		// type nullaryP = func[P any]()
    		tparam := NewTypeParam(NewTypeName(nopos, nil, "P", nil), &emptyInterface)
    		nullaryP = NewSignatureType(nil, nil, []*TypeParam{tparam}, nil, nil, false)
    	}
    	{
    		// type nullaryQ = func[Q any]()
    		tparam := NewTypeParam(NewTypeName(nopos, nil, "Q", nil), &emptyInterface)
    		nullaryQ = NewSignatureType(nil, nil, []*TypeParam{tparam}, nil, nil, false)
    	}
    	{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 17 04:32:02 UTC 2021
    - 2.3K bytes
    - Viewed (0)
  10. src/go/types/context_test.go

    	var nullaryP, nullaryQ, unaryP Type
    	{
    		// type nullaryP = func[P any]()
    		tparam := NewTypeParam(NewTypeName(nopos, nil, "P", nil), &emptyInterface)
    		nullaryP = NewSignatureType(nil, nil, []*TypeParam{tparam}, nil, nil, false)
    	}
    	{
    		// type nullaryQ = func[Q any]()
    		tparam := NewTypeParam(NewTypeName(nopos, nil, "Q", nil), &emptyInterface)
    		nullaryQ = NewSignatureType(nil, nil, []*TypeParam{tparam}, nil, nil, false)
    	}
    	{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 2.4K bytes
    - Viewed (0)
Back to top