Skip to content

Implement the PkgPath() method on reflect.Type #2668

Closed
@kyleconroy

Description

@kyleconroy

Code generated by protoc-gen-go includes a init function like this in each file.

func init() { file_plugin_codegen_proto_init() }
func file_plugin_codegen_proto_init() {
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_plugin_codegen_proto_rawDesc,
			NumEnums:      0,
			NumMessages:   21,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_plugin_codegen_proto_goTypes,
		DependencyIndexes: file_plugin_codegen_proto_depIdxs,
		MessageInfos:      file_plugin_codegen_proto_msgTypes,
	}.Build()
	File_plugin_codegen_proto = out.File
	file_plugin_codegen_proto_rawDesc = nil
	file_plugin_codegen_proto_goTypes = nil
	file_plugin_codegen_proto_depIdxs = nil
}

This code fails to run on the current dev branch of TinyGo, as PkgPath() is not implemented for reflect.Type:

func (t rawType) PkgPath() string {
	panic("unimplemented: (reflect.Type).PkgPath()")
}

Required by #2667

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions