i find the reference code in cmd/compile/internal/gc/reflect.go

On Friday, August 14, 2020 at 8:52:54 PM UTC+8 Volker Dobler wrote:

> On Friday, 14 August 2020 13:00:19 UTC+2, xie cui wrote:
>>
>> the return instance of reflect.TypeOf(some object) should be generate by 
>> compiler, the type info which could be in elf files. i want to known where 
>> compiler generate it.
>>
>
> Maybe this is the reason for your confusion.
> Your assumption that the compiler creates the value returned
> by reflect.TypeOf is _plain_ _wrong_. This is _not_ done
> during compile time as it  cannot be during compile time.
> This happens during run time and thus _not_ by the compiler.
>
> You cannot know where the compiler generates it  because
> the compiler doesn't generate it.
>
> The instance which is returned by reflect.TypeOf is generated
> by package reflect in the two lines
> https://golang.org/src/reflect/type.go#L1367 and 1368.
>
> V.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/5adca4b5-0110-4a32-b18a-3752fa8ab762n%40googlegroups.com.

Reply via email to