Having the same plural and singular word for a noun fails

Bug #503190 reported by Matt Jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rootin Tootin
Fix Released
High
Unassigned

Bug Description

Create a new project with:

rootintootin name:journal port:3000 db_user:root db_password:letmein
cd journal
./gen create database
./gen create noun singular:note plural:note
./gen create scaffold note title:string content:string
./gen migrate
./run

The "./run" will fail. If you look at the compile error in your browser, it will look something like:

note_controller.d(8): Error: variable note_controller.NoteController._note conflicts with variable note_controller.NoteController._note at note_controller.d(7)

Revision history for this message
Matt Jones (workhorsy) wrote :

This is a side effect of D being a statically typed language. It cannot have a variable named "note" that holds all the notes, and another that holds just the one note:

public class NoteController : ControllerBase {
 public Note[] _note;
 public Note _note;
}

Changed in rester:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Matt Jones (workhorsy) wrote :

Fixed in trunk:

We now disallow using the same noun for plural and singular:
./gen create noun singular:deer plural:deer

This is not an ideal solution. Feel free to re-open this bug with your solution.

Changed in rester:
status: Confirmed → Fix Committed
Matt Jones (workhorsy)
Changed in rester:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.