MCPcopy Create free account
hub / github.com/crossoverJie/gscript / NewPrimitiveTypeWithType

Function NewPrimitiveTypeWithType

symbol/primitive_type.go:37–49  ·  view source on GitHub ↗
(t Type)

Source from the content-addressed store, hash-verified

35}
36
37func NewPrimitiveTypeWithType(t Type) Type {
38 declareFunctionType, ok := t.(*DeclareFunctionType)
39 if ok {
40 returnType := declareFunctionType.GetReturnType()
41 if returnType != nil {
42 return NewPrimitiveType(returnType.GetName(), returnType.IsArray())
43 } else {
44 return NewPrimitiveType(t.GetName(), t.IsArray())
45 }
46 } else {
47 return t
48 }
49}
50
51func (b *PrimitiveType) GetName() string {
52 return b.name

Callers 1

ExitFunctionCallMethod · 0.92

Calls 4

NewPrimitiveTypeFunction · 0.85
GetReturnTypeMethod · 0.65
GetNameMethod · 0.65
IsArrayMethod · 0.65

Tested by

no test coverage detected