Open davecamp opened 2 years ago
On my BlitzMax-NG installation from June 2021, it behaves as expected:
SuperStrict
Framework Brl.Blitz
Type T End Type
Type TBlitzException Extends T
Field f:Int
End Type
Local o1:TBlitzException = New TBlitzException ' resolves to local type
Local o2:BRL.Blitz.TBlitzException = New BRL.Blitz.TBlitzException ' resolves to type from module
'Local o2:TBlitzException = New BRL.Blitz.TBlitzException ' compile error
'Local o3:Object = New BRL.Blitzasdf.TBlitzException ' compile error
DebugStop
This must be a more recently introduced bug then.
@HurryStarfish Your example also works as expected for me too. What do you get if you try this one?
SuperStrict
Type Foo
Field Bar:Float
EndType
Local Test:Foo = New Brl.Blitz.Foo
DebugStop
Ah, yes. Apparently, instead of causing an error the module namespace is completely ignored if it refers to a module that is being imported and the member is not found in that namespace. Whether the local scope has something with the same name doesn't seem to make a difference.
SuperStrict
Framework BRL.StandardIO
Local Test:Object = New BRL.StandardIO.TRuntimeException ' creates a BRL.Blitz.TRuntimeException
BRL.StandardIO.RuntimeError "test" ' calls a BRL.Blitz.RuntimeError
Is module scope taken into account with respect to Types within modules? It works Ok for Global variables - Ie If a Global variable is in a module and a Global variable is in the main code file you can resolve module resolution by:
There appears to be an issue when doing the same for Types
There are a couple of things kind of expected to happen with that last code.
The code above compiles and runs creating an instance of Foo using the local version.