Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Ticket #177 (new defect)

Opened 10 years ago

Last modified 10 years ago

Syntax Parser Fails on Aliases in Template Arguments?

Reported by: debio Assigned to:
Priority: major Component: descent.core
Version: 0.5 Keywords: parser alias HashMap HashSet
Cc:

Description

I'll have to come up with some example code to show what I'm seeing, but I'm having problems with templates. I'm running Tango 0.99.8, which has tango.util.collection.HashMap? and tango.util.container.HashMap?. I can use the collections one fine without the parser complaining, but if I use the one from containers, I get "No Property for type 'void'" on the constructor call, and all sorts of errors thereafter. I think the problem is this. The HashMap? from collections is declared like this:

deprecated public class HashMap(K, V) : MapCollection!(K, V), HashParams

Nice, sweet, simple. The one from containers looks like this:

class HashMap (K, V, alias Hash = Container.hash, 
                     alias Reap = Container.reap, 
                     alias Heap = Container.DefaultCollect) 
                     : IContainer!(V)

I'm guessing that the syntax parser is choking on the aliases? I'll make some sample code to check it out.

Oh, and should I make a separate ticket to request that Descent give a warning when a deprecated class is used?

I'm not sure exactly where the parsing code falls, so I'm putting this under descent.core.

Attachments

ParseTest.d (409 bytes) - added by debio on 06/12/09 04:30:08.
This file doesn't compile. It contains a very cut down version of HashSet?.
WorkingParseTest.d (20.9 kB) - added by debio on 06/12/09 04:32:50.
See next comment.

Change History

06/12/09 04:30:08 changed by debio

  • attachment ParseTest.d added.

This file doesn't compile. It contains a very cut down version of HashSet?.

06/12/09 04:31:00 changed by debio

Note: When I say "this file doesn't compile," I mean that the syntax parser finds errors, but the compiler doesn't.

06/12/09 04:32:50 changed by debio

  • attachment WorkingParseTest.d added.

See next comment.

06/12/09 04:35:06 changed by debio

WorkingParseTest?.d is the same as ParseTest?.d, except that I replaced "public import tango.util.container.Container;" with the full content of tango/util/container/Container.d, without the "module" statement. The parser accepts this, even though it should be treated just like the original file.

06/12/09 04:36:16 changed by debio

  • keywords set to parser alias HashMap HashSet.
  • version set to 0.5.