error 21: Internal!, HMEMBERID

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
CanMetax
Posts: 16
Joined: Jan 18, 2018 11:40

error 21: Internal!, HMEMBERID

Post by CanMetax »

Hello,

Code: Select all

enum colors
		RED= 1
		GREEN
		BLUE
end enum

type _colors as colors

type foo

	type farbe as _colors

private:
	as ubyte nop= -1
end type

dim as foo bar
bar.farbe= GREEN

fxm
Moderator
Posts: 12106
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: error 21: Internal!, HMEMBERID

Post by fxm »

type farbe as _colors
farbe as _colors
or
dim farbe as _colors
CanMetax
Posts: 16
Joined: Jan 18, 2018 11:40

Re: error 21: Internal!, HMEMBERID

Post by CanMetax »

yes the declaration is nonsense.
doesn't this error message indicate a compiler error?
fxm
Moderator
Posts: 12106
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: error 21: Internal!, HMEMBERID

Post by fxm »

CanMetax wrote: Nov 16, 2022 10:24 Hello,

Code: Select all

enum colors
		RED= 1
		GREEN
		BLUE
end enum

type _colors as colors

type foo

	type farbe as _colors

private:
	as ubyte nop= -1
end type

dim as foo bar
bar.farbe= GREEN


With the last freeBASIC compiler version (under testing) which allows the Nested Types (I suppose you use it), this declaration ('type farbe as _colors') is a Type (Alias) declaration nested in the 'foo' Type (UDT), which is valid.
Your code is valid up to:
'bar.farbe= GREEN'
Here, I think this detected internal error is not the one to report to user and must be modified.

Simple example of bugged error message:

Code: Select all

Type UDT
    Dim As Integer I
    Type Int_ As Long
End Type

Dim As UDT u
u.Int_ = 0
C:\.....\FBIDETEMP.bas(7) error 21: Internal!, HMEMBERID in 'u.Int_ = 0'
coderJeff
Site Admin
Posts: 4323
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: error 21: Internal!, HMEMBERID

Post by coderJeff »

CanMetax wrote: Nov 16, 2022 10:24 Hello,
Thanks for the feedback.

Yes, the new feature with nested named types basically adds TYPE-NAME as a new kind of member that never existed before. I actually thought I looked at this case before, but I guess is something we missed. Ah, didn't look at this since adding some capabilities with the type alias's (typedef's).
---
@fxm, I seen your cases for the new feature and bug report. I will try to get on it soon.
coderJeff
Site Admin
Posts: 4323
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: error 21: Internal!, HMEMBERID

Post by coderJeff »

fxm wrote: Nov 16, 2022 12:03 Here, I think this detected internal error is not the one to report to user and must be modified.
I pushed changed to fbc/master to fix this.

I didn't update the changelog.txt for this specifically. I know we talked about this before, but I don't know, it's a change to a feature currently in active development seems irrelevant to differences from previous fbc 1.09.0 version.
Post Reply